NHS Digital FHIR Medicines

Dispensing


The prescribed medication items on a prescription may not be fulfilled in one dispensing event. Each time medication is supplied to a patient, a dispense notification message must be submitted.

For items that are owing, the MedicationDispense is recorded without the following elements

  • performer
  • quantity
  • daysSupply
  • whenPrepared
  • dosageInstruction

as nothing as being supplied, and an item status of “Item not dispensed – owing” (0004).

For items that are partially dispensed, the MedicationDispense is recorded with the quantity of medication dispensed and an item status of “Item dispensed - partial” (0003).

When further medication items are dispensed in a separate dispensing event, another dispense notification message is submitted. This process is repeated until all medication items are dispensed.

Note. The coded medication information contained within the Dispense Notification should reflect the actual medication supplied to the patient. This information will, in time, form part of the patient’s national medication record but is not used by the NHS BSA as part of prescription reimbursement calculations.

epsPatientDispensingandOwings

The following table details how a prescription for the quantity of 100 Paracetamol tablets and single Salbutamol inhaler would be recorded in dispense notification messages if the tablets were dispensed over three separate dispensing events and the inhaler dispensed during the first dispensing event

Prescribing Event

process-message

This is the initial (GP) prescription sent by the prescriber using the FHIR Operation process-message with an example payload: Prescription Order GP with patient notes

Medication ID (SNOMED) Medication Name Prescribed Quantity Unit of Measure
322237000 Paracetamol 500mg soluble tablets 100 Tablet
35936511000001108 Salbutamol 100micrograms/dose inhaler 200 Dose

The notes consist of a list of repeat medications

Medication Name
Bendroflumethiazide 2.5 mg Tablets (3/6)
Salbutamol 100micrograms/dose inhaler CFC free 200 dose (2/6)

plus a note to the patient.

Patient Notes
Due to Coronavirus restrictions Church View Surgery is CLOSED until further notice

Download Prescription from EPS


nominatedreleaserequest

The prescription needs to be collected by the pharmacy, this is achieved by calling the FHIR Operation release with either to release all prescriptions for a pharmacy NominatedPharmacyReleaseRequest or to release a specified prescription PatientPrescriptionReleaseRequest

Example - Nominated Pharmacy

POST /Task/$release

Payload to download all uncollected prescriptions for pharmacy with ODS Code of VNE51.

{
    "resourceType": "Parameters",
    "parameter":  [
        {
            "name": "owner",
            "valueIdentifier": {
                "system": "https://fhir.nhs.uk/Id/ods-organization-code",
                "value": "VNE51"
            }
        },
        {
            "name": "status",
            "valueCode": "accepted"
        }
    ]
}

Example - Patient Prescription Release Request

POST /Task/$release

Payload to download a Patients prescription with token 82D996-C81010-11DB12

{
    "resourceType": "Parameters",
    "parameter":  [
        {
            "name": "owner",
            "valueIdentifier": {
                "system": "https://fhir.nhs.uk/Id/ods-organization-code",
                "value": "VNE51"
            }
        },
        {
            "name": "group-identifier",
            "valueIdentifier": {
                "system": "https://fhir.nhs.uk/Id/prescription-order-number",
                "value": "82D996-C81010-11DB12"
            }
        },
        {
            "name": "status",
            "valueCode": "accepted"
        }
    ]
}

Response Payload

The response from the $release will be a FHIR Bundle with a Http status code of 200 OK.

The total number of prescription-order messages returned will be in the total element. The identifier.value is the release reference number and is used for reference in dispense messages.

The prescription-order is carried in the entry[].resource array. If no prescription-orders are found total and the number of entries will be zero. The number of entries and the total will match, paging is not supported in this API.

The $release is not a stateless operation. The $release operation only returns prescriptions that have not been downloaded, when the operation $release is called, EPS marks the the prescriptions as downloaded. So when $release is called again, any remaining prescriptions not marked as downloaded will be returned. The downloaded status corresponds to a FHIR Task status of accepted and businessStatus of 0002 With Dispenser, prescriptions undownloaded are deemed to have status of requested and businessStatus of 0001 To be Dispensed.

prescription-order examples and documentation can be found here prescription-order

{
    "resourceType": "Bundle",
    "id": "E9DDBBC4-DA9A-C223-A2E3-909534332C69",
    "meta": {
        "lastUpdated": "2004-09-20T10:30:00.000+00:00"
    },
    "identifier": {
        "system": "https://tools.ietf.org/html/rfc4122",
        "value": "BBC4E9DD-DA9A-C223-A2E3-332C69909534"
    },
    "type": "searchset",
    "total": 0
}

Dispense - Owings and Partial Dispensing


dispense-notification

This message definition describes the rules for a Dispense Notification interactions used in a FHIR Messaging exchange.


Event Coding

System Code
Message Events dispense-notification
Category
notification

MessageHeader

The FHIR Message Bundle MUST contain one MessageHeader resource conforming to NHSDigital-MessageHeader


Focus

Profile Min Max Notes
NHSDigital-MedicationDispense 1 *
NHSDigital-Patient 0 1 A traced NHS Number identifier MUST be present, untraced NHS Numbers are not permitted. This can be conveyed in two ways, as identifier reference in the subject element of the MedicationDispense resource or as an identifier in a Patient resource. If a NHS Number identifier is referenced in the MedicationDispense resources then a Patient resource SHOULD NOT be present in the Bundle.
<MessageDefinition xmlns="http://hl7.org/fhir">
    <id value="bf729ea8-280b-4109-b2f5-02ce8e51d870" />
    <url value="https://fhir.nhs.uk/MessageDefinition/dispense-notification" />
    <identifier>
        <system value="https://tools.ietf.org/html/rfc4122" />
        <value value="bf729ea8-280b-4109-b2f5-02ce8e51d870" />
    </identifier>
    <version value="1.0.0" />
    <name value="NHSDigitalDispenseNotification" />
    <title value="Pharmacy/Treatment Dispense" />
    <status value="active" />
    <date value="2020-10-02" />
    <description value="Notification of dispensed medication" />
    <eventCoding>
        <system value="https://fhir.nhs.uk/CodeSystem/message-event" />
        <code value="dispense-notification" />
        <display value="Dispense Notification" />
    </eventCoding>
    <category value="notification" />
    <focus>
        <code value="MedicationDispense" />
        <profile value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense-Message" />
        <min value="1" />
        <max value="*" />
    </focus>
</MessageDefinition>
{
    "resourceType": "MessageDefinition",
    "id": "bf729ea8-280b-4109-b2f5-02ce8e51d870",
    "url": "https://fhir.nhs.uk/MessageDefinition/dispense-notification",
    "identifier":  [
        {
            "system": "https://tools.ietf.org/html/rfc4122",
            "value": "bf729ea8-280b-4109-b2f5-02ce8e51d870"
        }
    ],
    "version": "1.0.0",
    "name": "NHSDigitalDispenseNotification",
    "title": "Pharmacy/Treatment Dispense",
    "status": "active",
    "date": "2020-10-02",
    "description": "Notification of dispensed medication",
    "eventCoding": {
        "system": "https://fhir.nhs.uk/CodeSystem/message-event",
        "code": "dispense-notification",
        "display": "Dispense Notification"
    },
    "category": "notification",
    "focus":  [
        {
            "code": "MedicationDispense",
            "profile": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense-Message",
            "min": 1,
            "max": "*"
        }
    ]
}

1st Dispensing Event – Prescription Status: “With Dispenser – Active”

This is the first dispense notification sent by the dispenser using the FHIR Operation process-message (POST /$process-message)

1st dispense event - partial

Medication ID (SNOMED) Medication Name Dispensed Quantity Item Status
1858411000001101 Paracetamol 500mg soluble tablets (Unichem Plc) 60 t ablets 60 0003 (Partial)
3416211000001106 Salbutamol 100micrograms/dose inhaler (Sandoz Ltd) 200 dose 200 0001 (Dispensed)

2nd Dispensing Event – Prescription Status: “With Dispenser – Active”

This is the second dispense notification sent by the dispenser using the FHIR Operation process-message

The second drug has not been dispensed but it currently a requirement that empty MedicationDispense is included in the dispense-notification message. This empty uses the prescribed drug dm+d code and the following elements are not present

  • performer
  • quantity
  • daysSupply
  • whenPrepared
  • dosageInstruction

2nd dispense event - partial

Medication ID (SNOMED) Medication Name Dispensed Quantity Item Status
915611000001105 Paracetamol 500mg soluble tablets (AAH Pharmaceuticals Ltd) 24 tablets 24 0003 (Partial)
35936511000001108 Salbutamol 100micrograms/dose inhaler 0 0001 (Dispensed)

3rd Dispensing Event – Prescription Status: “Dispensed”

This is the final dispense notification sent by the dispenser using the FHIR Operation process-message

3rd dispense event - completed

Medication ID (SNOMED) Medication Name Dispensed Quantity Item Status
2274211000001101 Paracetamol 500mg soluble tablets (Kent Pharmaceuticals) 16 tablets 16 0001 (Dispensed)
35936511000001108 Salbutamol 100micrograms/dose inhaler 0 0001 (Dispensed)

Different Packs/Flavours

A dispenser may choose a mix of packs and flavours to satisfy a prescription and dispense them at the same time.

For example a prescriber may order.

Medication ID (SNOMED) Medication Name Ordered Quantity
3542011000001100 Generic Dioralyte Relief oral powder sachets sugar free 40 sachet

The dispenser chooses to issue

Medication ID (SNOMED) Medication Name Dispensed Quantity
3267611000001108 Dioralyte Relief oral powder sachets apricot (Sanofi) 20 sachet 20 sachet
19826711000001103 Dioralyte Relief oral powder sachets blackcurrant (Sanofi) 20 sachet 20 sachet

A MedicationDispense resource will be created for each medication dispensed and they will both be sent within the same dispense-notification.

Returning Prescriptions to EPS

A prescription may be downloaded, but never dispensed by the pharmacy, for example if the pharmacy cannot supply the prescribed medication items.

To allow the patient to visit a different dispenser the prescription must be returned to the Spine using the PUT /Task interaction. Once returned, the prescription should be removed from the local System.

See Returning Prescriptions to EPS for examples and explanation of the payload.

Non Dispensed Items

Any medication item that cannot, and will not in the future, be dispensed must be set to the item status “Item not dispensed” (0002) with a reason code from the “Not Dispensed Reason” list defined within DM-MedicationDispense-Type. This includes prescribed items that have expired.

If all prescribed items on a prescription are not dispensed then the MedicationDispense resources still need to be populated to declare the non-dispensing reason for each item.

Note. Within the DM-MedicationDispense-status-reason, the reason code 0003 “Owings note issued to patient” must not be implemented.

When an owings note is issued to a patient and no medication has been dispensed for any of the prescribed medication items on the prescription then no EPS messaging is required as no dispensing event has occurred. If other prescribed items have been dispensed then a Dispense Notification message must be submitted. This will indicate the quantity of medication dispensed and an item status code of 0004 “Item not dispensed owing” for the owing item.

When an owings note is issued to a patient where a partial quantity of medication has been dispensed then a dispense-notification message must be submitted. This will indicate the quantity of medication dispensed and an item status code of 0003 “Item dispensed – partial”.

back to top