Skip to content

FHIR MedicationRequest

Overview

An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.

Each FHIR MedicationRequest has the next elements:

  • a status
  • an intent code
  • a medication*
  • a patient
  • a date for when written
  • a prescriber

Each MedicationRequest supports the next elements:

  • the reported flag or reference signaling that information is from a secondary source such as a patient
  • the encounter
  • the prescription Sig

Profile specific implementation guidance:

  • See the Medication List section for guidance on accessing a patient medications including over the counter (OTC) medication and other substances taken for medical and recreational use.
  • *The FHIR MedicationRequest resources can represent a medication using either a code, or reference a Medication resource.
    • When referencing a Medication resource, the resource may be contained or an external resource.
    • The server application MAY choose any combination of these methods, but if an external reference to Medication is used, the server SHALL support the _include parameter for searching this element.
    • The client application SHALL support both elements.
  • Source EHR identifiers SHOULD be included to support deduplication across MedicationRequest resources. Exposing the EHR identifiers helps client applications identify duplicates.

This resource conforms to USCDI V1 profile for MedicationRequest - refer to StructureDefinition US Core MedicationRequest. MedicationRequest response will be provided in JSON (refers to Capability Statement) format as per FHIR standard R4 version.

Must support elements, mandatory and optional search parameters

MedicationRequest must support these elements:

  • status
  • intent
  • reported[x]
  • medication[x]
  • subject
  • encounter
  • authoredOn
  • requester
  • dosageInstruction
    • text

The following search parameters and search parameter combinations SHALL be supported: SHALL support searching using the combination of the patient and intent search parameters:

  • including support for OR search on intent (e.g.intent={system|}[code],{system|}[code],...)
GET [base url]/MedicationRequest?patient={Type/}[id]&intent=order,plan&encounter={Type/}[encounter_id]

SHALL support searching using the combination of the patient and intent and status search parameters:

  • including support for OR search on intent (e.g.intent={system|}[code],{system|}[code],...)
  • including support for OR search on status (e.g.status={system|}[code],{system|}[code],...)
GET [base url]/MedicationRequest?patient={Type/}[id]&intent=order,plan&status={system|}[code]

The following search parameter combinations SHOULD be supported (optional):

SHOULD support searching using the combination of the patient and intent and encounter search parameters: including support for OR search on intent (e.g.intent={system|}[code],{system|}[code],...)

GET [base url]/MedicationRequest?patient={Type/}[id]&intent=order,plan&encounter={Type/}[encounter_id]

SHOULD support searching using the combination of the patient and intent and authoredon search parameters:

  • including support for OR search on intent (e.g.intent={system|}[code],{system|}[code],...)
  • including support for these authoredon comparators: gt,lt,ge,le
  • including optional support for AND search on authoredon (e.g.authoredon=[date]&authoredon=[date]&...)
GET [base url]/MedicationRequest?patient={Type/}[id]&intent=order,plan&authoredon={gt|lt|ge|le}[date]&authoredon={gt|lt|ge|le}[date]

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

MedicationRequest By Patient Id

Search for MedicationRequest by patient.

METHOD GET

[base url]/MedicationRequest?patient={Type/}[id]

PARAMS

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://demo.kodjin.com/fhir/MedicationRequest?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'

MedicationRequest By Id

Get MedicationRequest by ID.

METHOD GET

[base url]/MedicationRequest/{id}

or

[base url]/MedicationRequest?_id={id}

PARAMS

  • [base url] - FHIR base url
  • {id} - Id for MedicationRequest resource

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://demo.kodjin.com/fhir/MedicationRequest/c5137fa5-3216-b12a-cbbc-a0c6bef361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'

MedicationRequest by patient and intent search parameters

Get MedicationRequests using the combination of the patient and intent search parameters

METHOD GET

GET [base url]/MedicationRequest?patient={Type/}[id]&intent=order,plan&status={system|}[code]

PARAMS

  • [base url] - FHIR base url
  • {Type/} - Type for the Reference. Example: Patient
  • [id] - patient id
  • {system|} - terminology system used to identify medication request status
  • [code] - status of the medication request

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://demo.kodjin.com/fhir/MedicationRequest?patient=Patient/fe1cd986-1ac7-4c26-b8b3-d632a48408fd&intent=order,plan&status=active' \
--header 'Authorization: Bearer 1239b275-909e-4754-8f73-1e411fd6769e'

MedicationRequest by patient and intent and encounter search parameters:

Get MedicationRequests using the combination of the patient and intent and encounter search parameters

METHOD GET

GET [base url]/MedicationRequest?patient=Patient/[id]&intent=order,plan&encounter=[reference]

PARAMS

  • [base url] - FHIR base url
  • [id] - patient id
  • [reference] - reference to Encounter

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://demo.kodjin.com/fhir/MedicationRequest?patient=Patient/fe1cd986-1ac7-4c26-b8b3-d632a48408fd&target-date=ge2015-01-14&target-date=le2019-01-14 \
--header 'Authorization: Bearer 1239b275-909e-4754-8f73-1e411fd6769e'

MedicationRequest by patient and intent and authoredon search parameters

Get MedicationRequests using the combination of the patient and intent and authoredon search parameters METHOD GET

GET [base url]/MedicationRequest?patient=Patient/[id]&intent=order,plan&authoredon={gt|lt|ge|le}[date]

PARAMS

  • [base url] - FHIR base url
  • {Type/} - Type for the Reference. Example: Patient
  • [id] - patient id
  • [date] -date when medication request was authored on

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://demo.kodjin.com/fhir/MedicationRequest?patient=Patient/fe1cd986-1ac7-4c26-b8b3-d632a48408fd&patient=1137192&intent=order,plan&authoredon=ge2019-01-01T00:00:00Z \
--header 'Authorization: Bearer 1239b275-909e-4754-8f73-1e411fd6769e'