Design Overview

This reference API uses the point-to-point RESTful messaging interoperability pattern, using the FHR R4 UKCore and International FHIR R4 standards. The UKCore MedicationRequest and MedicationDispense resources are used to share clinical information. The UKCore Patient and Organization resources are used to share patient and pharmacy data. The FHIR R4 Task resource is used for workflow. FHIR resources are Bundled within two FHIR Transactions; a Transaction posted from the spoke to the hub pharmacy, and a Transaction posted from the hub back to the spoke pharmacy.

Actors

The "spoke" pharmacy system is the Requestor.

The "hub" pharmacy system is the Provider.

Interactions

hub-spoke-interactions

  1. To outsource the dispensing of a prescription to a hub pharmacy, the requestor POSTs a FHIR Transaction to an endpoint implemented by the hub pharmacy. This FHIR Transaction is a Bundle containing a Task resource, and Organization resource, and any number of MedicationRequest and Patient resources.

  2. The performer accepts or rejects the Task for dispensing the medication and updates the Task resource through a PATCH operation.

  3. If the performer accepts the Task, the Task can be optionally PATCHed to inform the requestor of dispensing activities.

  4. When the medication assembly and labelling process is complete, and the medication is ready, or has been physically shipped to the spoke pharmacy, the performer POSTs a FHIR Transaction to an endpoint implemented by the spoke pharmacy. This FHIR Transaction is a Bundle containing a Task resource, an Organization resource, and any number of MedicationDispense resources.

Authentication

Authentication should be with an OAuth 2.0 signed JWT. Both hub and spoke pharmacy systems should implement an OAuth 2.0 Authorization Server to return an access token to include with each API endpoint.

Spoke Pharmacy Design and API Endpoints

A spoke pharmacy will be required to implement two API endpoints and POST data to the hub pharmacy endpoint.

Actor API Endpoint FHIR Definition Description
Performer (hub) PATCH [base]/fhir/Task/[id] Task Endpoint to allow a hub pharmacy to update a Task resource during the medicines assembly process.
Performer (hub) POST [base]/fhir PharmacyHubToSpoke Endpoint to allow a hub pharmacy to post dispensing data back to a spoke.

Endpoint Responses

HTTP Response Description
201 Transaction has been successfully received and persisted within the pharmacy system.
400 Invalid message. Details will be provided within an OperationOutcome resource
401 Missing or invalid authentication token
500 Unexpected internal server error

Hub Pharmacy Design and API Endpoints

A hub pharmacy will be required to implement one API endpoint and POST/PATCH data to the spoke pharmacy endpoints.

Actor API Endpoint FHIR Definition Description
Requestor (spoke) POST [base]/fhir PharmacySpokeToHub Endpoint to allow a spoke pharmacy to post prescription data to a hub.

Endpoint Responses

HTTP Response Description
201 Transaction has been successfully received and persisted within the pharmacy system.
400 Invalid message. Details will be provided within an OperationOutcome resource
401 Missing or invalid authentication token
500 Unexpected internal server error