Overview
MedicationDispense represents medication that has been prepared and dispensed by a pharmacy. This resource bridges the gap between the prescriber’s order and the patient’s receipt of the medication.
Use Cases
- Outpatient pharmacy dispensing
- Hospital pharmacy dispensing
- Medication dispensing records
- Supply chain tracking
Creating a Dispense Record
curl -X POST https://api.esus.health/fhir/MedicationDispense \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/fhir+json" \
-d '{
"status": "completed",
"medicationCodeableConcept": {
"coding": [{
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "197361",
"display": "Amoxicillin 500mg capsule"
}]
},
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"locationId": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
"performer": [{
"actor": {
"reference": "Organization/9a8b7c6d-5e4f-3210-9876-543210fedcba"
}
}],
"authorizingPrescription": [{
"reference": "MedicationRequest/c1a2e3d4-5b6f-7890-abcd-ef1234567890"
}],
"quantity": { "value": 30, "unit": "capsules" },
"daysSupply": { "value": 10, "unit": "days" },
"whenPrepared": "2026-04-21T09:00:00Z",
"dosageInstruction": [{
"text": "Take 1 capsule by mouth 3 times a day for 10 days"
}]
}'
Notes:
subjectIdandlocationIdare flat UUIDs.performer[]andauthorizingPrescription[]are arrays of FHIR references — standard{ reference: "Type/<uuid>" }shape.
Dispense Status Flow
| Status | Meaning |
|---|---|
preparation | Being prepared |
in-progress | Being dispensed |
completed | Dispensed and given to patient |
cancelled | Dispense cancelled |
entered-in-error | Record error |
Tracking Refills
For medications with refills, each refill should be its own dispense. Use partOf to link refills to the original:
curl -X POST https://api.esus.health/fhir/MedicationDispense \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/fhir+json" \
-d '{
"status": "completed",
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"medicationCodeableConcept": {
"coding": [{ "code": "197361", "display": "Amoxicillin 500mg" }]
},
"authorizingPrescription": [{
"reference": "MedicationRequest/c1a2e3d4-5b6f-7890-abcd-ef1234567890"
}],
"quantity": { "value": 30, "unit": "tablets" },
"daysSupply": { "value": 30, "unit": "days" },
"partOf": [{
"reference": "MedicationDispense/aa11bb22-cc33-dd44-ee55-ff6677889900"
}]
}'