The MedicationRequest resource represents an order or request for medication. All requests must reference a valid Patient.
Endpoints
Create MedicationRequest
Requires admin or practitioner role.
POST /api/fhir/MedicationRequest
Authorization: Bearer {token}
Content-Type: application/json
Must be "MedicationRequest"
active, on-hold, cancelled, completed, entered-in-error, stopped, draft, unknown
proposal, plan, order, original-order, reflex-order, filler-order, instance-order, option
medicationCodeableConcept
Medication being requested (RxNorm code)
Reference to Patient: {"reference": "Patient/{id}"}
When the request was initially created
How the medication should be taken
Medication supply authorization
Example Request
curl -X POST https://api.example.com/api/fhir/MedicationRequest \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resourceType": "MedicationRequest",
"status": "active",
"intent": "order",
"medicationCodeableConcept": {
"coding": [{
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "197361",
"display": "Lisinopril 10 MG Oral Tablet"
}]
},
"subject": {
"reference": "Patient/65f1234567890abcdef12345"
},
"authoredOn": "2024-03-15T10:00:00Z",
"dosageInstruction": [{
"text": "Take one tablet daily",
"timing": {
"repeat": {
"frequency": 1,
"period": 1,
"periodUnit": "d"
}
},
"route": {
"coding": [{
"system": "http://snomed.info/sct",
"code": "26643006",
"display": "Oral route"
}]
},
"doseAndRate": [{
"doseQuantity": {
"value": 10,
"unit": "mg",
"system": "http://unitsofmeasure.org",
"code": "mg"
}
}]
}],
"dispenseRequest": {
"numberOfRepeatsAllowed": 3,
"quantity": {
"value": 30,
"unit": "tablets",
"system": "http://unitsofmeasure.org",
"code": "{tablets}"
},
"expectedSupplyDuration": {
"value": 30,
"unit": "days",
"system": "http://unitsofmeasure.org",
"code": "d"
}
}
}'
Response
{
"resourceType": "MedicationRequest",
"id": "65f5678901234abcdef56789",
"status": "active",
"intent": "order",
"medicationCodeableConcept": {
"coding": [{
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "197361",
"display": "Lisinopril 10 MG Oral Tablet"
}]
},
"subject": {
"reference": "Patient/65f1234567890abcdef12345"
},
"authoredOn": "2024-03-15T10:00:00Z"
}
List MedicationRequests
GET /api/fhir/MedicationRequest
Authorization: Bearer {token}
Filter by patient: Patient/{id}
Get MedicationRequest by ID
GET /api/fhir/MedicationRequest/:id
Authorization: Bearer {token}
Update MedicationRequest
PUT /api/fhir/MedicationRequest/:id
Authorization: Bearer {token}
Content-Type: application/json
Medication Status Workflow
Draft
Initial creation, not yet finalized
Active
Medication is currently being taken
Completed
Medication course is finished
Role Permissions
| Role | Create | Read | Update |
|---|
| Admin | ✅ | ✅ | ✅ |
| Practitioner | ✅ | ✅ | ✅ |
| Auditor | ❌ | ✅ | ❌ |