MedicationRequest
Overview
The MedicationRequest resource represents an order or request for both supply of the medication and the instructions for administration of the medication to a patient. This resource is used to communicate prescription orders, medication administration instructions, and related clinical information.
Use Cases:
- Retrieving patient prescription history
- Accessing medication orders for care coordination
- Supporting medication reconciliation workflows
Relationships:
- References Patient resources for the medication recipient
- May reference Encounter resources for the clinical context
- Can be referenced by Provenance resources for audit trails
Resource Schema
Key fields in the MedicationRequest resource:
{
"resourceType": "MedicationRequest",
"id": "example-medication-request",
"status": "active",
"intent": "order",
"medicationCodeableConcept": {
"coding": [{
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
"code": "197696",
"display": "Lisinopril 10 MG Oral Tablet"
}]
},
"subject": {
"reference": "Patient/123"
},
"authoredOn": "2023-01-15",
"dosageInstruction": [{
"text": "Take one tablet daily"
}]
}
Operations
Read
Retrieve a specific MedicationRequest by ID.
Search
Search for medication requests using various criteria.
GET Method
Use GET for simple searches with parameters in the query string.
- Production
- Preview
GET /MedicationRequest?parameter=value
GET /MedicationRequest?parameter=value
POST Method
Use POST for complex searches with form-encoded parameters.
- Production
- Preview
POST /MedicationRequest/_search
POST /MedicationRequest/_search
Search Parameters
Patient-based Search:
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
patient | reference | Yes | Returns prescriptions for a specific patient | patient=value |
authoredon | date | No | Return prescriptions written on this date | authoredon=value |
encounter | reference | No | Return prescriptions with this encounter identifier | encounter=value |
intent | token | No | Returns prescriptions with different intents | intent=value |
status | token | No | Status of the prescription | status=value |
| _lastUpdated | date | No | Only return resources which were last updated as specified by the given range | _lastUpdated=value |
| _revinclude | special | No | Include Provenance resource(s) that reference the matched search results. Allowed: "Provenance:target" | _revinclude=value |
ID-based Search:
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
_id | string | Yes | The ID of the resource | _id=value |
authoredon | date | No | Return prescriptions written on this date | authoredon=value |
encounter | reference | No | Return prescriptions with this encounter identifier | encounter=value |
intent | token | No | Returns prescriptions with different intents | intent=value |
status | token | No | Status of the prescription | status=value |
| _lastUpdated | date | No | Only return resources which were last updated as specified by the given range | _lastUpdated=value |
| _revinclude | special | No | Include Provenance resource(s) that reference the matched search results. Allowed: "Provenance:target" | _revinclude=value |
Common Search Patterns
Find medication requests for a patient:
GET /MedicationRequest?patient=Patient/123&_count=10
Search by status:
GET /MedicationRequest?patient=Patient/123&status=active
Find by authored date:
GET /MedicationRequest?patient=Patient/123&authoredon=ge2023-01-01
Search by encounter:
GET /MedicationRequest?encounter=Encounter/456
Examples
Read Request
- Production
- Preview
curl -X GET "https://fhir.netsmartcloud.com/provider/system-access/v2/{tenant-id}/MedicationRequest/123" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"
curl -X GET "https://fhirtest.netsmartcloud.com/provider/system-access/v2/{tenant-id}/MedicationRequest/123" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"
Request Examples
- Production
- Preview
curl -X POST https://fhir.netsmartcloud.com/provider/system-access/v2/{tenant-id}/MedicationRequest/_search \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "patient=Patient/123&status=active"
curl -X GET "https://fhir.netsmartcloud.com/provider/system-access/v2/{tenant-id}/MedicationRequest?patient=Patient/123&authoredon=ge2023-01-01" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"
curl -X POST https://fhirtest.netsmartcloud.com/provider/system-access/v2/{tenant-id}/MedicationRequest/_search \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "patient=Patient/123&status=active"
curl -X GET "https://fhirtest.netsmartcloud.com/provider/system-access/v2/{tenant-id}/MedicationRequest?patient=Patient/123&authoredon=ge2023-01-01" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"
Response Example
{
"resourceType": "Bundle",
"type": "searchset",
"total": 1,
"entry": [{
"resource": {
"resourceType": "MedicationRequest",
"id": "123",
"status": "active",
"intent": "order",
"subject": {
"reference": "Patient/123"
},
"authoredOn": "2023-01-15"
}
}]
}
Integration Patterns
Common Workflows
- Patient Medication History: Search by patient to retrieve all medication requests
- Encounter-based Prescriptions: Use encounter parameter to get medications prescribed during a specific visit
- Medication Reconciliation: Include related resources using _include parameters
Related Resources
- Patient: Subject of the medication request
- Encounter: Clinical context for the prescription
- Provenance: Audit trail information
Error Handling
For detailed error responses and troubleshooting, refer to the standard FHIR error response format.
Supported Profiles
This API supports the following FHIR profiles: