📘 Context
A clinical decision-support AI assistant needs a deterministic gate to prevent
prescribing decisions that could trigger dangerous drug-drug, drug-allergy, or
contraindication-based interactions.
This policy should serve as a pre-prescription safety gate, complementary to
clinician judgment, blocking obviously unsafe combinations and escalating
borderline cases for pharmacist review.
🎯 The Goal
Write a medication interaction safety policy for a clinical AI assistant.
Variables you can use:
new_drug_class (Enum): "ANTICOAGULANT", "OPIOID", "BENZODIAZEPINE", "NSAID", "SSRI", "MAOI", "OTHER".
current_medications (Set[String]): List of patient's active medications.
known_allergies (Set[String]): List of documented allergies.
patient_age (Integer): In years.
patient_pregnant (Boolean): Pregnancy status (if applicable).
renal_impairment (Boolean): Whether eGFR < 30.
hepatic_impairment (Boolean): Whether liver function is compromised.
pharmacist_approved (Boolean): Whether a pharmacist signed off.
interaction_severity (Enum): "NONE", "MINOR", "MODERATE", "MAJOR", "CONTRAINDICATED".
Requirements:
- BLOCK if
interaction_severity == "CONTRAINDICATED".
- BLOCK if the drug is in
known_allergies.
- BLOCK if
new_drug_class == "MAOI" and any SSRI is in current_medications.
- BLOCK if
new_drug_class == "OPIOID" and any BENZODIAZEPINE is in current_medications and pharmacist_approved is False.
- ESCALATE if
interaction_severity == "MAJOR".
- ESCALATE if
patient_pregnant is True and new_drug_class != "OTHER".
- ESCALATE if
renal_impairment is True and new_drug_class == "NSAID".
📚 Resources
- Start here:
docs/getting-started.md
- Check syntax:
quickstart/01_hello_world.csl
- See how examples are structured:
examples/community/
✅ Definition of Done
Submit a PR with: examples/community/healthcare_medication_interaction.csl
📘 Context
A clinical decision-support AI assistant needs a deterministic gate to prevent
prescribing decisions that could trigger dangerous drug-drug, drug-allergy, or
contraindication-based interactions.
This policy should serve as a pre-prescription safety gate, complementary to
clinician judgment, blocking obviously unsafe combinations and escalating
borderline cases for pharmacist review.
🎯 The Goal
Write a medication interaction safety policy for a clinical AI assistant.
Variables you can use:
new_drug_class(Enum): "ANTICOAGULANT", "OPIOID", "BENZODIAZEPINE", "NSAID", "SSRI", "MAOI", "OTHER".current_medications(Set[String]): List of patient's active medications.known_allergies(Set[String]): List of documented allergies.patient_age(Integer): In years.patient_pregnant(Boolean): Pregnancy status (if applicable).renal_impairment(Boolean): Whether eGFR < 30.hepatic_impairment(Boolean): Whether liver function is compromised.pharmacist_approved(Boolean): Whether a pharmacist signed off.interaction_severity(Enum): "NONE", "MINOR", "MODERATE", "MAJOR", "CONTRAINDICATED".Requirements:
interaction_severity == "CONTRAINDICATED".known_allergies.new_drug_class == "MAOI"and anySSRIis in current_medications.new_drug_class == "OPIOID"and anyBENZODIAZEPINEis in current_medications andpharmacist_approvedis False.interaction_severity == "MAJOR".patient_pregnantis True andnew_drug_class != "OTHER".renal_impairmentis True andnew_drug_class == "NSAID".📚 Resources
docs/getting-started.mdquickstart/01_hello_world.cslexamples/community/✅ Definition of Done
Submit a PR with:
examples/community/healthcare_medication_interaction.csl