Skip to main content

Representing Prescriptions and Medication Orders

Prescriptions and medication orders are very common in healthcare settings and accuracy is vitally important. This guide will go over how to represent all aspects of a medication order, from the request to the administration instructions. Note that this is an operational counterpart to the Modeling A Formulary documentation.

The MedicationRequest Resource

Medical orders should be represented in FHIR using the MedicationRequest resource. This resource has two main use cases:

  1. Representing a prescription
  2. Representing a medication fulfillment order (e.g. a ordering a pharmacy to to fulfill an outstanding prescription)

In addition, it can contain contextual information such as instructions on administration of the medication.

ElementDescriptionExample
Dispense and Ingestion Information
medicationCodeableConcept

The medication being requested, coded as a concept. The details of the drug will be in the MedicationKnowledge resource with the same code.

42844 - Percocet
dosageInstructionsInstructions on how the medication should be used by the patient.See below
dispenseRequest

Provides details about how the medication should be dispensed or supplied, including quantity, refills, and more.

See below
substitution

A boolean value, indicating whether a substitution is allowed by the dispensing pharmacist. If it is blank, it implies that a substitution is allowed.

false
priorityHow quickly the request should be addressed.urgent
Tracking and Administration
subjectThe patient or group who the medication or prescription is for.Patient/homer-simpson
requesterThe practitioner who created the request or wrote the prescription.Practitioner/dr-alice-smith
reasonReferenceA reference to a Condition or Observation that indicates why the order was made.Condition/chronic-pain
encounterThe medical appointment at which the request was created.Encounter/homer-simpson-annual-physical
priorPrescriptionA reference to a previous prescription or order that this one is replacing or updating.MedicationRequest/homer-simpson-percocet-1
statusThe current state of the order (i.e. completed, active, etc.)completed

Detailed Medication Information

It is important to note that a MedicationRequest resource does not have detailed information on the drug that is being prescribed or ordered. Instead, this information will be in the related MedicationKnowledge resource with the same code. This code should be stored in the medicationCodeableConcept field of the MedicationRequest, establishing a link between the request and the details of the drug.

The MedicationKnowledge resource represents a type of medication that can be ordered. It contains details such as:

  • Relationship to other medications
  • Physical characteristics of the drug (color, imprint, etc.)
  • Physical form of the drug (pill, powder, etc.)
  • Description of the medication package (bottle, blister pack, etc.)
  • Method of ingestion (oral, intravenous, etc.)

For more details on the MedicationKnowledge resource and how to model medications, see the Modeling a Formulary docs.

Representing Dispense Instructions

The instructions to the pharmacy on how the order should be dispensed should be included on the MedicationRequest.dispenseRequest field.

ElementDescription
initialFillThe duration or quantity of the first dispense of the medication.
quantityThe amount of the medication that is to be dispensed for one fill after the initial fill.
dispenseIntervalThe minimum amount of time between refills of the medication.
validityPeriodThe period over which the prescription or order remains valid.
numberOfRepeatsAllowedThe number of times that the order may be refilled. Note that this does not include the initial dispense. If the value here is 3, the order can be refilled 3 times in addition to the initial dispense.
expectedSupplyDurationThe time period over which the medication is supposed to be used or which the prescription should last.
performerThe organization (i.e. Pharmacy) that should dispense the medication.
Example: Dispense Instructions
{
resourceType: 'MedicationRequest',
status: 'active',
intent: 'order',
subject: {
reference: 'Patient/homer-simpson',
},
medicationCodeableConcept: {
coding: [
{
system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
code: '1049221',
display: 'acetaminophen 325 MG / oxycodone hydrochloride 5 MG Oral Tablet [Percocet]',
},
],
},
requester: {
reference: 'Practitioner/dr-alice-smith',
},
dispenseRequest: {
initialFill: {
quantity: {
value: 30,
unit: 'tablets',
},
},
dispenseInterval: {
value: 30,
unit: 'days',
},
validityPeriod: {
start: '2023-09-04',
end: '2023-11-04',
},
numberOfRepeatsAllowed: 1,
quantity: {
value: 30,
unit: 'tablets',
},
expectedSupplyDuration: {
value: 30,
unit: 'days',
},
performer: {
reference: 'Organization/example-pharmacy',
},
},
};
Preferred Pharmacies

There is currently no community consensus on how to store a patient's preferred pharmacy in FHIR, but Medplum suggests one of two options:

  1. Add the information to a CareTeam resource associated with the Patient.
  2. Use a FHIR Extension to model a preferred pharmacy. The Patient Preferred Pharmacy offers a way to do this.

Representing Patient Instructions

The instructions for how the patient should take the medication should be included on the MedicationRequest.dosageInstruction field. This element includes fields to explain how, how often, and when the medication should be taken and is represented with a Dosage type.

ElementDescription
doseAndRateThe amount and frequency of medication to be administered.
timingWhen the medication should be administered, including how often it should be repeated.
asNeededBooleanWhether the medication should be taken as needed by the patient.
routeThe route that the body should enter the body (e.g. orally, intravenously, etc.).
methodThe technique that should be used to administer the medication (e.g. swallowed, injected, etc.).
siteThe body site the medication should be administered to.
patientInstructionReadable instructions that the patient is able to understand.
additionalInstructionAny additional directions to the patient for taking the medicine (e.g. with a meal, or before eating).
maxDosePerAdministrationThe limit to the amount of medication that should be taken in a single administration.
maxDosePerPeriodThe limit to the amount of medication that should be administered over a given period.
maxDosePerLifetimeThe limit to the amount of medication that should be taken by a patient in their lifetime.
sequenceThe specific step in which this dosage should be taken. It should start at 1 and increment from there.

Note that this field is stored as an array, so there can be multiple dosage instructions for each order. For example, the same medication may be taken multiple times throughout the day, but in different dosages each time. This is where the dosageInstruction.sequence field should be used to indicate which order the instructions are in.

Example: Dosage Instructions
{
resourceType: 'MedicationRequest',
status: 'active',
intent: 'order',
subject: {
reference: 'Patient/homer-simpson',
},
medicationCodeableConcept: {
coding: [
{
system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
code: '224917',
display: 'Ritalin',
},
],
},
dosageInstruction: [
{
sequence: 1,
patientInstruction: 'Take one tablet orally with water, each morning',
asNeededBoolean: false,
route: {
coding: [
{
system: 'http://snomed.info/sct',
code: '26643006',
display: 'Oral route',
},
],
},
method: {
coding: [
{
system: 'http://snomed.info.sct',
code: '738995006',
display: 'Swallow',
},
],
},
doseAndRate: [
{
doseQuantity: {
value: 1,
unit: 'tablet',
},
},
],
maxDosePerPeriod: {
numerator: {
value: 1,
unit: 'tablet',
},
denominator: {
value: 1,
unit: 'day',
},
},
maxDosePerAdministration: {
value: 1,
unit: 'tablet',
},
},
],
};

Distinguishing Between Prescriptions and Medication Orders

A MedicationRequest can represent both a prescription and a medication fulfillment order. A prescription is an order for medication in an outpatient context, while a medication fulfillment order represents medication that will be administered in an inpatient context.

These types of requests should be differentiated as outpatient vs. inpatient using the MedicationRequest.category field, which represents the type of medical request. The FHIR MedicationRequest Admin Location value set can be used for this. Note that the category field is an array, so it is possible to have multiple values if you wish to categorize your requests in other ways as well.

Example: A MedicationRequest categorized for a prescription
{
resourceType: 'MedicationRequest',
// ...
category: [
{
coding: [
{
system: 'https://www.hl7.org/fhir/valueset-medicationrequest-admin-location.html',
code: 'outpatient',
},
],
},
],
};
Example: A MedicationRequest categorized for a medication fulfillment order
{
resourceType: 'MedicationRequest',
// ...
category: [
{
coding: [
{
system: 'https://www.hl7.org/fhir/valueset-medicationrequest-admin-location.html',
code: 'inpatient',
},
],
},
],
};