executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
drug-interaction-checkerChecks active medications for drug-drug interactions by pulling all MedicationRequests and cross-referencing known interaction pairs with severity classification and CYP450 pathways. Use when user asks to "check drug interactions", "check for interactions", "are these medications safe together", mentions "drug-drug interaction", "CYP450", or needs interacti…
Independent GitHub snapshot · Automated classification · Original documentation governs
Pull all active medications for a patient, cross-reference each pair against known major drug-drug interaction databases, classify by severity (contraindicated, major, moderate, minor), identify CYP450 pathway conflicts, and suggest therapeutic alternatives when significant interactions are detected.
| Resource | Purpose | Key Fields |
|---|---|---|
| MedicationRequest | Active prescribed medications | status, medicationCodeableConcept, dosageInstruction |
| MedicationStatement | Patient-reported medications including OTC | status, medicationCodeableConcept, dosage |
| Patient | Patient demographics, age for risk stratification | birthDate, gender |
| Condition | Comorbidities affecting interaction severity | code, clinicalStatus |
| Observation | Renal/hepatic function affecting drug metabolism | code, valueQuantity |
| AllergyIntolerance | Cross-sensitivity patterns | code, reaction |
Tool: fhir_read
resourceType: "Patient"
id: "[patient-id]"
Extract age, gender, weight if available. Age and organ function affect CYP450 metabolism rates.
2a: Prescribed medications
Tool: fhir_search
resourceType: "MedicationRequest"
queryParams: "patient=[patient-id]&status=active&_count=100"
2b: Patient-reported medications (includes OTC, supplements)
Tool: fhir_search
resourceType: "MedicationStatement"
queryParams: "patient=[patient-id]&status=active&_count=100"
Merge both lists. Deduplicate by RxNorm code (system: http://www.nlm.nih.gov/research/umls/rxnorm).
Tool: fhir_search
resourceType: "Observation"
queryParams: "patient=[patient-id]&code=33914-3,48642-3,69405-9,77147-7&_sort=-date&_count=4"
LOINC codes:
Impaired renal/hepatic function reduces drug clearance and increases interaction risk.
For N active medications, evaluate N*(N-1)/2 unique pairs. For each pair, check against the interaction reference (see references/major-drug-interactions.md) in the following order:
For each medication, identify its CYP450 profile (see references/cyp450-pathways.md):
Flag when:
For each identified interaction, report:
| Field | Content |
|---|---|
| Drug A | Name, dose, RxNorm code |
| Drug B | Name, dose, RxNorm code |
| Severity | Contraindicated / Major / Moderate / Minor |
| Mechanism | Pharmacokinetic (CYP450, P-gp, renal) or Pharmacodynamic (additive, synergistic, antagonistic) |
| Clinical Effect | What happens (e.g., "increased bleeding risk", "QT prolongation") |
| Evidence Level | Established / Probable / Suspected / Possible |
| Management | Specific recommendation (avoid, adjust dose, monitor parameter, timing separation) |
| Alternative | Suggested substitute medication if available |
Structure output:
Tool: fhir_create
resourceType: "DetectedIssue"
resource: {
"resourceType": "DetectedIssue",
"status": "preliminary",
"code": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "DRG",
"display": "Drug Interaction Alert"
}]
},
"severity": "high",
"patient": {"reference": "Patient/[patient-id]"},
"identifiedDateTime": "[current-datetime]",
"implicated": [
{"reference": "MedicationRequest/[drug-a-id]"},
{"reference": "MedicationRequest/[drug-b-id]"}
],
"detail": "[interaction description]",
"mitigation": [{
"action": {"text": "[recommended action]"},
"date": "[date]"
}]
}
User says: "Check drug interactions for patient 67890 - about to start amiodarone."
Actions:
Result:
DRUG INTERACTION CHECK - Patient 67890
New medication: Amiodarone
CONTRAINDICATED: None
MAJOR INTERACTIONS:
1. Amiodarone + Warfarin [MAJOR]
Mechanism: Amiodarone inhibits CYP2C9, reducing warfarin metabolism
Effect: INR increase of 50-70%, bleeding risk
Management: Reduce warfarin dose by 30-50%. Check INR within 3-5 days, then weekly x4.
2. Amiodarone + Simvastatin [MAJOR]
Mechanism: Amiodarone inhibits CYP3A4, increasing simvastatin levels
Effect: Rhabdomyolysis risk. Simvastatin max dose with amiodarone is 20mg.
Alternative: Switch to pravastatin 40mg (not CYP3A4 metabolized) or rosuvastatin 10mg.
MODERATE INTERACTIONS:
3. Amiodarone + Metformin [MODERATE]
Mechanism: Amiodarone may increase metformin levels via OCT transporter inhibition
Effect: Increased metformin exposure, lactic acidosis risk (especially with eGFR 55)
Management: Monitor renal function closely. Consider metformin dose reduction.
CYP450 IMPACT:
- CYP3A4: STRONGLY INHIBITED by amiodarone (affects simvastatin)
- CYP2C9: STRONGLY INHIBITED by amiodarone (affects warfarin)
- CYP2D6: INHIBITED by amiodarone (no current substrates affected)
RECOMMENDED ACTIONS:
1. [URGENT] Reduce warfarin dose 30-50% before starting amiodarone
2. [URGENT] Switch simvastatin to pravastatin or reduce to 20mg max
3. [MONITOR] Renal function and metformin tolerance
4. [SCHEDULE] INR check 3-5 days after amiodarone start
User says: "Screen all drug interactions for patient Jane Doe, DOB 1940-07-22."
Actions:
Result:
DRUG INTERACTION SCREEN - Jane Doe (Age 85)
Total active medications: 14
Pairs evaluated: 91
MAJOR INTERACTIONS: 3
1. Clopidogrel + Omeprazole [MAJOR]
Mechanism: Omeprazole inhibits CYP2C19, reducing clopidogrel activation
Alternative: Switch to pantoprazole (weaker CYP2C19 inhibitor)
2. Methotrexate + Trimethoprim [MAJOR]
Mechanism: Both cause folate depletion, additive bone marrow suppression
Management: Avoid combination. If unavoidable, supplement with leucovorin.
3. Fluoxetine + Tramadol [MAJOR]
Mechanism: Serotonin syndrome risk (both serotonergic). Fluoxetine inhibits CYP2D6, reducing tramadol conversion to active metabolite.
Alternative: Switch tramadol to acetaminophen or non-serotonergic analgesic.
MODERATE INTERACTIONS: 5
[... listed with management ...]
AGE-RELATED CONSIDERATIONS:
- CYP450 activity reduced ~30% at age 85
- Renal clearance likely reduced (check eGFR)
- Polypharmacy (14 meds) increases interaction probability
- Recommend comprehensive prescription appropriateness review
medicationCodeableConcept.text for name-based matching against interaction tables.fhir_read on the referenced Medication resource.medication-reconciliation - Reconcile medication list before running interaction checkprescription-appropriateness-review - Broader appropriateness review beyond interactionsopioid-risk-assessment - Focused assessment when opioid interactions detectedproblem-list-review - Review conditions that affect interaction severity