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
medication-reconciliationPerforms comprehensive medication reconciliation across care transitions by comparing inpatient, outpatient, and patient-reported medication lists. Use when user asks to "reconcile medications", "compare medication lists", "check for medication discrepancies", mentions "care transition", "admission meds", "discharge meds", or needs a unified medication list…
Independent GitHub snapshot · Automated classification · Original documentation governs
Perform medication reconciliation per Joint Commission NPSG.03.06.01 requirements. Pull all medication sources (MedicationRequest, MedicationStatement, MedicationAdministration), normalize into a unified list, and identify discrepancies including duplicates, therapeutic duplications, discontinued medications still listed as active, and dose discrepancies across care settings.
| Resource | Purpose | Key Fields |
|---|---|---|
| MedicationRequest | Prescribed medications (orders) | status, intent, medicationCodeableConcept, dosageInstruction, authoredOn |
| MedicationStatement | Patient-reported and reconciled meds | status, medicationCodeableConcept, dosage, effectivePeriod, informationSource |
| MedicationAdministration | Administered medications (inpatient) | status, medicationCodeableConcept, dosage, effectiveDateTime, context |
| Patient | Patient demographics for identity verification | name, birthDate, identifier |
| AllergyIntolerance | Cross-check for contraindicated meds | code, clinicalStatus, reaction |
| Condition | Validate indication for each medication | code, clinicalStatus |
Tool: fhir_search
resourceType: "Patient"
queryParams: "family=[lastname]&given=[firstname]&birthdate=[YYYY-MM-DD]"
Confirm at least 2 identifiers match. If multiple patients returned, present options and halt until user confirms.
2a: Prescribed medications (orders)
Tool: fhir_search
resourceType: "MedicationRequest"
queryParams: "patient=[patient-id]&status=active,on-hold&_include=MedicationRequest:medication&_count=100"
2b: Patient-reported medications
Tool: fhir_search
resourceType: "MedicationStatement"
queryParams: "patient=[patient-id]&status=active,intended,on-hold&_count=100"
2c: Administered medications (inpatient context)
Tool: fhir_search
resourceType: "MedicationAdministration"
queryParams: "patient=[patient-id]&effective-time=ge[admission-date]&_count=100"
3a: Allergies
Tool: fhir_search
resourceType: "AllergyIntolerance"
queryParams: "patient=[patient-id]&clinical-status=active"
3b: Active conditions
Tool: fhir_search
resourceType: "Condition"
queryParams: "patient=[patient-id]&clinical-status=active"
For each medication entry, extract:
http://www.nlm.nih.gov/research/umls/rxnorm)Build a unified table with columns: Medication | Dose | Frequency | Route | Source | Status | Last Updated.
Flag the following categories:
Duplicates: Same RxNorm code appearing in multiple sources with identical dose/frequency. Mark for deduplication.
Therapeutic Duplications: Different medications in the same therapeutic class (e.g., two SSRIs, two ACE inhibitors, two statins). Use drug class grouping by RxNorm ingredient.
Discontinued Medications Still Active: MedicationRequest with status stopped or cancelled but a corresponding MedicationStatement with status active. Flag with the discontinuation date.
Dose Discrepancies: Same medication across sources with different dose or frequency. Present both values side by side.
Missing Indications: Active medications with no matching active Condition. Flag for clinician review.
Allergy Conflicts: Active medication matching a documented AllergyIntolerance substance code.
Cross-reference active medications against the ISMP high-alert medication list (see references/high-alert-medications.md). Apply extra scrutiny to:
Structure output as:
For each reconciled medication, update the MedicationStatement:
Tool: fhir_update
resourceType: "MedicationStatement"
id: "[medication-statement-id]"
resource: {
"resourceType": "MedicationStatement",
"status": "active",
"statusReason": [{"text": "Reconciled on [date]"}],
"dateAsserted": "[current-date]"
}
For medications to discontinue:
Tool: fhir_update
resourceType: "MedicationRequest"
id: "[medication-request-id]"
resource: {
"resourceType": "MedicationRequest",
"status": "stopped",
"statusReason": {"text": "Discontinued during medication reconciliation [date]"}
}
User says: "Reconcile medications for patient John Smith, DOB 1955-03-15, being admitted to the hospital."
Actions:
family=Smith&given=John&birthdate=1955-03-15. Confirm identity.Result:
MEDICATION RECONCILIATION - John Smith (DOB: 1955-03-15)
Reconciled: [date]
VERIFIED MEDICATIONS:
1. Lisinopril - HOME: 10mg daily | ORDERED: 20mg daily [DOSE DISCREPANCY]
2. Metformin 500mg BID - HOME only [NO INPATIENT ORDER]
3. Atorvastatin 40mg daily - HOME and ORDERED [MATCHED]
DISCREPANCIES:
- Lisinopril: Dose differs between home (10mg) and inpatient (20mg). Clarify with prescriber.
- Metformin: On home list but no inpatient order. Intentional hold or omission?
RECOMMENDATIONS:
- Confirm lisinopril dose change is intentional
- Confirm metformin hold (common for inpatient with contrast risk) or add order
User says: "Prepare discharge med rec for patient ID 12345."
Actions:
fhir_read. Confirm identity.Result:
DISCHARGE MEDICATION RECONCILIATION - Patient 12345
Reconciled: [date]
CONTINUE FROM HOME:
1. Amlodipine 5mg daily [UNCHANGED]
2. Omeprazole 20mg daily [UNCHANGED]
NEW MEDICATIONS (started during admission):
3. Apixaban 5mg BID [HIGH-ALERT: anticoagulant] - Indication: new atrial fibrillation
4. Metoprolol succinate 25mg daily - Indication: rate control for atrial fibrillation
DISCONTINUED:
5. Ibuprofen 400mg TID - Reason: interaction with apixaban (bleeding risk)
DOSE CHANGES:
6. Lisinopril: Changed 10mg -> 20mg daily - Reason: BP not at goal
PATIENT EDUCATION REQUIRED:
- Apixaban: bleeding precautions, no NSAIDs, consistent dosing
- Metoprolol: check heart rate before taking, do not stop abruptly
_include=MedicationRequest:medication to resolve inline references.medicationCodeableConcept.text for display name matching.fhir_search with resourceType: "MedicationRequest" and queryParams: "patient=[id]&code:text=[medication-name]".drug-interaction-checker - Run after reconciliation to check the unified list for interactionsprescription-appropriateness-review - Validate reconciled list against Beers/STOPP-START criteria for elderly patientsmedication-adherence-assessment - Assess fill history for reconciled home medicationsclinical-summary-generator - Include reconciliation results in clinical summary