FHIR R4 MedicationStatement example
MedicationStatement says a person is taking, or took, a medicine. The medicine itself goes in medicationCodeableConcept (or a reference to a Medication resource); the schedule goes in dosage.
The MedicationStatement in JSON
{
"resourceType": "MedicationStatement",
"id": "metformin",
"status": "active",
"medicationCodeableConcept": {
"coding": [
{
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "6809",
"display": "metformin"
},
{
"system": "http://www.whocc.no/atc",
"code": "A10BA02",
"display": "metformin"
}
],
"text": "Metformin 500 mg tablet"
},
"subject": {
"reference": "Patient/example",
"display": "Jane Doe"
},
"effectivePeriod": {
"start": "2021-03-20"
},
"dateAsserted": "2026-10-01",
"dosage": [
{
"text": "500 mg twice a day with meals",
"timing": {
"repeat": {
"frequency": 2,
"period": 1,
"periodUnit": "d"
}
},
"route": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "26643006",
"display": "Oral route"
}
]
},
"doseAndRate": [
{
"doseQuantity": {
"value": 500,
"unit": "mg",
"system": "http://unitsofmeasure.org",
"code": "mg"
}
}
]
}
]
}
Validator result: raw JSON ยท open the validator
- informationNo errors: this MedicationStatement matches the FHIR R4 structure checked here.
The elements that matter
| Element | Cardinality | Notes |
|---|---|---|
status | 1..1 | active, completed, stopped and others. |
medication[x] | 1..1 | medicationCodeableConcept or medicationReference; the name medication alone does not exist. |
subject | 1..1 | The patient. |
effective[x] | 0..1 | When the medicine is or was taken. |
dosage | 0..* | Text for people, timing and dose for software. |
RxNorm 6809 is the ingredient; product-level RxNorm codes name strength and form. ATC A10BA02 is the WHO classification used across Europe.
The full definition is in the FHIR R4 MedicationStatement specification.
Common mistakes and the errors they cause
Medication without the type suffix
Choice elements carry their type in the name: medicationCodeableConcept.
- error
MedicationStatement.medicationUnknown element: it is not part of this resource in FHIR R4. Check the spelling and case, the FHIR version (R4, not STU3 or R5) and put custom data in an extension.
No medication at all
medication[x] is 1..1.
- error
MedicationStatementOne of these elements is required: medicationCodeableConcept, medicationReference.
Missing status
MedicationStatement.status is 1..1.
- error
MedicationStatement.statusRequired element is missing.
Store it in a real FHIR R4 serverA free sandbox key gives you 30 synthetic patients and the full API, including
Get a free API keyPOST /fhir/R4/MedicationStatement and $validate.More examples
- Patient resource example
- Observation example: blood pressure
- Observation example: laboratory result
- DiagnosticReport example: lab panel
- Condition resource example
- AllergyIntolerance example
- Immunization resource example
- Encounter resource example
Related guides
- How to store medical records using FHIR R4Tutorial: create a Patient, a blood-pressure Observation and a Condition, use a transaction, search, update with history and read provenance โ every request with curl and the real response, on the free sandbox.
- FHIR code systemsWhich code systems each FHIR resource type uses: LOINC for measurements and lab results, ICD-10 for conditions, ATC for medications, UCUM units, and SNOMED CT behind a licence flag.