Query active medication requests: GET [base]/MedicationRequest?patient=[id]&status=active; the status parameter accepts a comma-separated list (e.g., active,on-hold) for broader retrieval.
Use _include=MedicationRequest:medication to pull referenced Medication resources in the same Bundle when the medication is a reference rather than a CodeableConcept.
For each MedicationRequest, extract medicationCodeableConcept.coding (RxNorm codes, system http://www.nlm.nih.gov/research/umls/rxnorm) or resolve the medicationReference to the included Medication resource.
Read dosageInstruction[]: each element has text (human-readable), doseAndRate[].doseQuantity, and timing.repeat fields for structured dose frequency.
Check dispenseRequest.numberOfRepeatsAllowed and dispenseRequest.validityPeriod to determine refill status and prescription validity.
Correlate with MedicationStatement resources if present, as some systems record patient-reported medications there rather than in MedicationRequest.
Known gotchas
Medication coded as a reference (medicationReference) vs. inline CodeableConcept (medicationCodeableConcept) varies by EHR; your code must handle both shapes.
RxNorm codes may be at the clinical drug level or ingredient level; reconciliation logic should normalize to a common level (e.g., ingredient) before deduplicating.
Stopped or completed orders may still appear when querying without a status filter; always explicitly specify status values relevant to the use case.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp