NHS Digital FHIR Medicines

Pre## Prescription Management

EPS is an implementation of FHIR Workflow Management and implements those patterns. These are focused on the FHIR Task resource which is used to represent the 'prescription' within EPS.

Fulfilment

Prescription fulfilment is modelled using the FHIR NHSDigital-Task resource. This Task has links to both the MedicationRequest and MedicationDispense resources from prescription-order and dispense-notification messages. Prescription Managment acts on the Task resource only.

A summary of FHIR Task is below:

FHIR Task Description
status The current status of the prescription-order or dispense-notification, e.g. accepted, completed, in-progress, etc
code normally fulfil
reasonCode The Task reason, either 33633005 - Prescription of drug or 373784005 - Dispensing medication
for The NHS Number of the Patient the Task is for
requester Who is created the Request (prescription-order) or the Event (dispense-notification)
owner Who is responsible for actioning the request (normally the pharmacy for prescription-order)
input Pointers to the MedicationRequest which are accessed by EPSQueryAPI
output Pointers to the MedicationDispense which are accessed by EPSQueryAPI

This Task resource is becomes available on receipt of a PrescriptionOrder and is then updated by the other workflow messages. the Task will be given a status of 'requested', this is item 1 in the diagram below:

When the prescription is released by a pharmacy (item 2) the status changes to 'accepted'. When EPS receives a Prescription Dispense (item 3) the status will change to 'in-progress'. If all items in the Presciption Dispense state they are completed, the Task status will change to 'completed'.

The current status of the prescription can be viewed via the Prescription Tracker API


In a similar manner dispense-notification workflow events and the EPS generated prescription-order for continuous-repeat-dispensing, are also represented as sub Tasks.

The Task (code = prescription-order) interactions are:

The Task (code = dispense-notification) interactions are:


Prescription Token

The prescription token allows the patient to choose the pharmacy which will fulfill the prescription order.

The prescription token is used by the dispenser to retrieve a non-nominated prescription quickly and effectively without having to cross-reference different stand-alone systems.

The prescription may be in a variety of forms:

For EPS purposes they are both considered to be FHIR NHSDigital-Task

  1. The Prescription Release operation is used to retrieve the prescriptions using the prescription token id code as a parameter.

Nominated Pharmacy

For nominated or one off prescriptions EPS will assign the Task based on

  • one-off nomination in the Prescription Order
  • patients nomination recorded in PDS (the patient can change this via NHSApp)

  1. The Prescription Release operation is used to retrieve the prescriptions using the pharmacies ODS code as a parameter.

Fulfilment States

EPS has an internal state engine which is used to manage the processing of the prescription (FHIR Task).

Direct State Changes

The Task fulfilment state can be manipulated directly via

The updated Task received by EPS follows these rules:

Task.status Task.statusReason Description Resulting Task.status
failed 0004 Expired
cancelled 0005 Cancelled
rejected 0007 Not Dispensed ready

On release the Task in EPS is changed to:

Task.status Task.statusReason
accepted 0002 With Dispenser

Cancelling dispense-notifications can also result in a Task.status change.

Condition Task.status Task.statusReason
If no dispensing activity recorded accepted 0002 With Dispenser

Indirect State Changes

It indirectly manipulatd by Prescription Ordering Requests and Prescription Dispensing events.


MedicationRequest.status (Prescription Order)

MedicationRequest.status condition Task.status Notes
active if nominated requested Task is created in EPS
active if not nominated ready Task is created in EPS
cancelled if not with a dispenser cancelled
cancelled if with a dispenser (active or not) failed when the dispenser returns the prescription this will turn to cancelled

MedicationDispense.status and MedicationDispense.prescriptionStatus

The Task status is linked to the prescription status held in ExtensionEPSTaskBusinessStatus

MedicationDispense.prescriptionStatus Description Task.status MedicationRequest.status
0003 With Dispenser - Active in-progress
0006 Dispensed completed completed

back to top