Electronic Prescription Service (EPS) Implementation Guide

Prescription Release (Download)

FHIR Exchange API endpoint FHIR Definition
FHIR Operation POST /Task/$release release

Prescriptions submitted are held within the EPS until processed by a dispensing system. There are two methods the dispensing system will use to request the release (download) of prescriptions. Both methods use a common release operation that uses a Parameters resource and returns a FHIR Bundle consisting of 0..* prescription-order messages.

Release Method 1: Nominated Pharmacy Release Request

Download prescriptions nominated to a dispensing site, identified by the site's ODS code.

Here is an incomplete Parameters resource to download nominated prescriptions for the 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"
        }
    ]
}

Release Method 2: Patient Release Request

Download an individual prescriptions using the unique prescription identifier that the patient will present as a barcode on a printed prescription token or displayed within the phone app such as the NHS App.

Here is an incomplete Parameters resource to download a patient's prescription with prescription identifier "82D996-C81010-11DB12" by the pharmacy with ODS Code of VNE51.

{
    "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"
        }
    ]
}

Release Response

An HTTP 200 response will be a Parameters resource. Successfully downloaded prescriptions will be in a Parameter named "passedPrescriptions". This contains a Bundle containing one or more prescription-order messages carried in the entry[] array. The total number of prescription-order messages returned will be in the total element. EPS is currently configured to download up to 25 prescriptions per request. The request can be repeated until all available prescriptions have been downloaded.

A successful response may also contain a Parameter named "failedPrescriptions". For each failed prescription there will be two entries in the entry[] array. One entry will contain an OperationOutcome resource with the reason for failure, using codes from the DM-Prescription-Release-Rejection-Reason valueset. The other entry will contain the failed prescription-order message. This is made available so the prescribed medication and patient details are known, allowing the user to speak to the patient and/or the prescriber.

An HTTP 4XX response will be an OperationOutcome resource for technical failures.

image-dispenser-release

Here is an incomplete example of a release response containing comments to aid readability.

{
  "resourceType": "Parameters",
  "id": "a5d77265-8ba5-4c74-b8ce-ea0dbaafbdb8",
  "parameter": [
    {
      "name": "passedPrescriptions",
      "resource": {
        "resourceType": "Bundle",
        "id": "155e1102-9e71-4f19-9453-b905c0bbc494",
        "meta": {
          "lastUpdated": "2022-11-21T14:00:00+00:00"
        },
        "identifier": {
          "system": "https://tools.ietf.org/html/rfc4122",
          "value": "155e1102-9e71-4f19-9453-b905c0bbc494"
        },
        "type": "searchset",
        "link": [
          {
            "relation": "self",
            "url": "https://sandbox.api.service.nhs.uk/electronic-prescriptions/Task/$release"
          }
        ],
        "total": 18, ... 18 prescriptions in this response
        "entry": [ ... array of 18 prescription-order messages ]
      }
    },
    {
      "name": "failedPrescriptions",
      "resource": {
        "resourceType": "Bundle",
        "id": "914298fd-bc64-4c00-8d8d-bf88709db470",
        "meta": {
          "lastUpdated": "2023-02-15T15:14:47+00:00"
        },
        "identifier": {
          "system": "https://tools.ietf.org/html/rfc4122",
          "value": "57674b6e-c6c9-42de-943d-f2ed90f36862"
        },
        "type": "searchset",
        "total": 2, ... a single prescription as failed
        "entry": [
          {
... an OperationOutcome resource
          },
          {
... failed prescription-order message
          }
        ]
      }
    }
  ]
}


back to top