GP Connect (Patient Facing) Prescriptions - FHIR API

This guidance is under active development by NHS Digital and content may be added or updated on a regular basis.
Note: This is a deprecated version (draft) of the specification - please see the latest for the latest version.

FHIR Resources

Resource library

Action Resources Further information
Creating a prescription request UKCore-Task For this action, use a UKCore-Task that has a focus of a UKCore-MedicationRequest with intent of plan.
Cancelling a prescription request No resource is used To cancel a prescription request a JSON Patch is used.
Viewing medication FHIR R4 Bundle containing: UKCore-MedicationStatement where each is based on a: UKCore-MedicationRequest with intent of plan. When viewing a Medication the information will be returned in a Searchset bundle containing MedicationStatements where each must have a reference to a MedicationRequest in the basedOn element.
View prescription reorder requests FHIR R4 Bundle containing: UKCore-Task When viewing prescription reorder requests a bundle containing Task resource's are returned.



FHIR resources used when viewing medications

A patient must be able to view their current medication to see which medications are available to reorder.

Medications will be returned in a MedicationStatement resource.

Request body

  • no FHIR Resource will be sent in the request payload

Response

At this point the display within the BasedOn element of the MedicationStatement will show whether they are acute or repeat long term therapy. For example:

      "basedOn" : [ {
        "reference" : "MedicationRequest/0f450c33-67b2-4ca3-b0f9-fea75ccdcd44",
        "display" : "Acute prescription request for Amoxicillin 250mg capsules."
      } ]

At this point the basedOn reference of the MedicationRequest can be used to query the MedicationRequest endpoint in order to get further information on the patient's medication.

FHIR resources used when viewing a specific MedicationRequest

Once the MedicationStatement's have been returned each MedicationStatement will be basedOn a specific MedicationRequest with intent of plan.

These can be used to obtain further information about the patient's prescription.

For example:

  • confirming courseOfTherapyType

    • this will be under display in the basedOn element however the actual value can be found under courseOfTherapyType within the referenced MedicationRequest
  • obtaining medication review dates

    • medication review dates will be displayed in the Extension UK Core Medication Repeat Information within the referenced MedicationRequest under authorisationExpiryDate
    • this same extension will also display the number of issues under numberOfPrescriptionsIssued

Request body

  • no FHIR resource will be sent in the request payload

Response

FHIR resources when viewing previous prescription issue details

It is also possible to obtain previous prescription issue details in the form of MedicationRequests.

Request body

  • no FHIR resource will be sent in the request payload - instead within the path the NHS number must be used as a parameter

Response

This response will return all previous MedicationRequests related to a patient. An extra optional parameter of authoredon can also be used to provide a cut-off in terms of dates.

FHIR resources used in creating a prescription request

To create a new prescription, a Task must be used with a focus on a prior MedicationRequest.

Request body

The payload should hit the prescription request endpoint with this request body. An example of the payload can be found on the GP Connect Patient Facing Prescriptions FHIR API specification under the POST /FHIR/R4/Task/ endpoint.

FHIR resources used when viewing active prescription reorder requests

A patient could wish to view their active and previous prescription reorder requests in order to see the current status.

Request body

  • no FHIR resource is used in the request payload

Response

Within this, the patient will be able to see all of their prior requests and each status.

If a patient identifier is passed it will return more than one Task resources within the bundle and if just the id is used only one resource will be returned within the bundle.

The MedicationRequest reference returned in the focus can be used to obtain further information about the prescription.

For example:

  • obtaining information about the Medication itself

    • this will be under medicationCodeableConcept
  • confirming courseOfTherapyType

    • this will be under display in the basedOn element - however, the actual value can be found under courseOfTherapyType within the referenced MedicationRequest
  • obtaining medication review dates

    • medication review dates will be displayed in the Extension UK Core Medication Repeat Information within the referenced MedicationRequest under authorisationExpiryDate
    • this same extension will also display the number of issues under numberOfPrescriptionsIssued

FHIR resources used in cancelling a prescription request

A patient could send a cancellation to an unactioned prescription request. This means while the Task object has a status of requested and no further state.

Request body

  • to cancel a prescription no FHIR resource is sent within the request payload (instead a JSON Patch is sent)
The JSON patch must always look like:
  [{
    "op": "replace",
    "path": "/status",
    "value": "cancelled"
  }]

Response

  • the response will return the FHIR UK Core Task object which now displays the updated status of cancelled and the lastModified will no represent the current time

FHIR resources returned in error responses

If an error occurs during processing of the request in any of the above API interactions, then the provider system will return an HTTP error code along with an OperationOutcome resource in the response payload. See Errors and Issues.

Response

back to top