Skip to main content

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 for medication requests using various criteria.

GET Method

Use GET for simple searches with parameters in the query string.

GET /MedicationRequest?parameter=value

POST Method

Use POST for complex searches with form-encoded parameters.

POST /MedicationRequest/_search

Search Parameters

Patient-based Search:

ParameterTypeRequiredDescriptionExample
patientreferenceYesReturns prescriptions for a specific patientpatient=value
authoredondateNoReturn prescriptions written on this dateauthoredon=value
encounterreferenceNoReturn prescriptions with this encounter identifierencounter=value
intenttokenNoReturns prescriptions with different intentsintent=value
statustokenNoStatus of the prescriptionstatus=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:

ParameterTypeRequiredDescriptionExample
_idstringYesThe ID of the resource_id=value
authoredondateNoReturn prescriptions written on this dateauthoredon=value
encounterreferenceNoReturn prescriptions with this encounter identifierencounter=value
intenttokenNoReturns prescriptions with different intentsintent=value
statustokenNoStatus of the prescriptionstatus=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

curl -X GET "https://fhir.netsmartcloud.com/provider/patient-access/v2/{tenant-id}/MedicationRequest/123" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/fhir+json"

Request Examples

Search by patient
curl -X POST https://fhir.netsmartcloud.com/provider/patient-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"
Search by date range
curl -X GET "https://fhir.netsmartcloud.com/provider/patient-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

  1. Patient Medication History: Search by patient to retrieve all medication requests
  2. Encounter-based Prescriptions: Use encounter parameter to get medications prescribed during a specific visit
  3. Medication Reconciliation: Include related resources using _include parameters
  • 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: