On this page

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](/content/docs/medications/formulary/index.html) documentation.

## The `MedicationRequest` Resource [​](/content/docs/medications/representing-prescriptions-and-medication-orders#the-medicationrequest-resource "Direct link to the-medicationrequest-resource"/index.html)

Medication prescriptions should be represented in FHIR using the [`MedicationRequest`](/content/docs/api/fhir/resources/medicationrequest/index.html) resource. In addition, it can contain contextual information such as instructions on administration of the medication.

|     |     |     |
| --- | --- | --- |
| **Element** | **Description** | **Example** |
| **_Dosage and Ingestion Information_** |
| medicationCodeableConcept | The medication being requested, coded as a concept. The details of the drug will be in the MedicationKnowledge<br>resource with the same code. | 42844 - Percocet |
| dosageInstructions | Instructions on how the medication should be used by the patient. | [See below](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-patient-instructions/index.html) |
| dispenseRequest | Provides details about how the medication should be dispensed or supplied, including quantity, total number of refills, and more. | [See below](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-dispense-instructions-and-fulfillment/index.html) |
| substitution | A boolean value, indicating whether a substitution is allowed by the dispensing pharmacist. If it is blank, it<br>implies that a substitution is allowed. | false |
| priority | How quickly the request should be addressed. | urgent |
| **_Administration_** |
| subject | The patient or group who the medication or prescription is for. | Patient/homer-simpson |
| requester | The practitioner who created the request or wrote the prescription. | Practitioner/dr-alice-smith |
| reasonReference | A reference to a Condition or Observation that indicates why the order was made. | Condition/chronic-pain |
| encounter | The medical appointment at which the request was created. | Encounter/homer-simpson-annual-physical |
| priorPrescription | A reference to a previous prescription or order that this one is replacing or updating. | MedicationRequest/homer-simpson-percocet-1 |
| status | The current state of the order (i.e. completed, active, etc.) | completed |

### Detailed Medication Information [​](/content/docs/medications/representing-prescriptions-and-medication-orders#detailed-medication-information "Direct link to Detailed Medication Information"/index.html)

It is important to note that a [`MedicationRequest`](/content/docs/api/fhir/resources/medicationrequest/index.html) resource does not have detailed information on the drug that is being prescribed or ordered. Instead, this information will be in the related [`MedicationKnowledge`](/content/docs/api/fhir/resources/medicationknowledge/index.html) 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`](/content/docs/api/fhir/resources/medicationknowledge/index.html) 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](/content/docs/medications/formulary/index.html).

## Representing Patient Instructions [​](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-patient-instructions "Direct link to Representing Patient Instructions"/index.html)

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`](/content/docs/api/fhir/datatypes/dosage/index.html) type.

| Element | Description |
| --- | --- |
| `doseAndRate` | The amount and frequency of medication to be administered. |
| `timing` | When the medication should be administered, including how often it should be repeated. |
| `asNeededBoolean` | Whether the medication should be taken as needed by the patient. |
| `route` | The route that the body should enter the body (e.g. orally, intravenously, etc.). |
| `method` | The technique that should be used to administer the medication (e.g. swallowed, injected, etc.). |
| `site` | The body site the medication should be administered to. |
| `patientInstruction` | Readable instructions that the patient is able to understand. |
| `additionalInstruction` | Any additional directions to the patient for taking the medicine (e.g. with a meal, or before eating). |
| `maxDosePerAdministration` | The limit to the amount of medication that should be taken in a single administration. |
| `maxDosePerPeriod` | The limit to the amount of medication that should be administered over a given period. |
| `maxDosePerLifetime` | The limit to the amount of medication that should be taken by a patient in their lifetime. |
| `sequence` | The 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

```ts
{
  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 [​](/content/docs/medications/representing-prescriptions-and-medication-orders#distinguishing-between-prescriptions-and-medication-orders "Direct link to Distinguishing Between Prescriptions and Medication Orders"/index.html)

A [`MedicationRequest`](/content/docs/api/fhir/resources/medicationrequest/index.html) 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](https://www.hl7.org/fhir/valueset-medicationrequest-admin-location.html) 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

```ts
{
  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

```ts
{
  resourceType: 'MedicationRequest',
  // ...
  category: [
    {
      coding: [
        {
          system: 'https://www.hl7.org/fhir/valueset-medicationrequest-admin-location.html',
          code: 'inpatient',
        },
      ],
    },
  ],
};
```

## Representing Dispense Instructions and Fulfillment [​](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-dispense-instructions-and-fulfillment "Direct link to Representing Dispense Instructions and Fulfillment"/index.html)

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

| Element | Description |
| --- | --- |
| `authoredOn` | The date on which this order was made. |
| `extension` | The related MedicationDispense resources (see [Representing Dispense Fulfillments](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-dispense-fulfillments/index.html)) |
| `initialFill` | The duration or quantity of the first dispense of the medication. |
| `quantity` | The amount of the medication that is to be dispensed for one fill after the initial fill. |
| `dispenseInterval` | The minimum amount of time between refills of the medication. |
| `validityPeriod` | The period over which the prescription or order remains valid. |
| `numberOfRepeatsAllowed` | The 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. |
| `expectedSupplyDuration` | The time period over which the medication is supposed to be used or which the prescription should last. |

Example: Dispense Instructions

```ts
{
  resourceType: 'MedicationRequest',
  status: 'active',
  intent: 'order',
  subject: {
    reference: 'Patient/homer-simpson',
  },
  authoredOn: '2023-09-04',
  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',
    },
  },
};
```

### Representing Dispense Fulfillments [​](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-dispense-fulfillments "Direct link to Representing Dispense Fulfillments"/index.html)

The information related to fulfillment of a `MedicationRequest` should be stored on the [`MedicationDispense`](/content/docs/api/fhir/resources/medicationdispense/index.html) resource. If a `MedicationRequest` is refilled, there should be one `MedicationDispense` resource associated with the initial fill, and a MedicationDispense associated per each refill.

| Element | Description |
| --- | --- |
| `status` | The current status of this dispense. This can be used to help track shipping progress. |
| `statusReason` | The information related to the status of the dispense. An extension here can be used to record shipment tracking information (i.e. shipping company and tracking number). |
| `whenPrepared` | The date on which the pharmacy prepares the dispense. |
| `whenHandedOver` | The date on which the patient receives the dispense. |
| `performer` | The organization (i.e. Pharmacy) that dispenses the medication. |

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`](/content/docs/api/fhir/resources/careteam/index.html) resource associated with the [`Patient`](/content/docs/api/fhir/resources/patient/index.html).
2. Use a FHIR [`Extension`](/content/docs/api/fhir/datatypes/extension/index.html) to model a preferred pharmacy. The [Patient Preferred Pharmacy](https://build.fhir.org/ig/HL7/fhir-extensions/StructureDefinition-patient-preferredPharmacy.html) offers a way to do this.

- [The `MedicationRequest` Resource](/content/docs/medications/representing-prescriptions-and-medication-orders#the-medicationrequest-resource/index.html)
  - [Detailed Medication Information](/content/docs/medications/representing-prescriptions-and-medication-orders#detailed-medication-information/index.html)
- [Representing Patient Instructions](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-patient-instructions/index.html)
- [Distinguishing Between Prescriptions and Medication Orders](/content/docs/medications/representing-prescriptions-and-medication-orders#distinguishing-between-prescriptions-and-medication-orders/index.html)
- [Representing Dispense Instructions and Fulfillment](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-dispense-instructions-and-fulfillment/index.html)
  - [Representing Dispense Fulfillments](/content/docs/medications/representing-prescriptions-and-medication-orders#representing-dispense-fulfillments/index.html)
