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:

  • subjectId and locationId are flat UUIDs.
  • performer[] and authorizingPrescription[] are arrays of FHIR references — standard { reference: "Type/<uuid>" } shape.

Dispense Status Flow

StatusMeaning
preparationBeing prepared
in-progressBeing dispensed
completedDispensed and given to patient
cancelledDispense cancelled
entered-in-errorRecord 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"
    }]
  }'