Interactions
Reference Architectures
There is no implied order for the reference architectures described below. Each includes the same three systems;
Prescribing System, the creator of
MedicationRequest
resourcesDispensing System, the creator of
MedicationDispense
resourcesIntegrated Care System (ICS) or Shared Record system, that provides services to share medication records with clinicians across local, regional and national care settings.
Combinations of the architectures described below would also be feasible. For example, the first architecture listed below but with a persisted copy Shared Record architecture.
Dispensing system acts as the FHIR server, with a persisted copy Shared Record architecture
(1) The prescibing system creates the MedicationRequest
with a valid externally referencable identifer
and POSTs to the dispending system which adds the logical id
on receipt. The MedicationRequest
is only shared once ready for pharmacy processing so the status
will only deal with valid end-states.
(2) The prescribing system queries the dispending system via a GET using the unique identifer
from the MedicationRequest
, i.e. "get the dispensing record for this request". The dispensing system assigns the logical id
. The GET request may be sent at any time so the dispensing system may choose to expose status
values that represent both in-progress and end-states for the MedicationDispense
record.
(3) The prescibing system POSTs records to the shared record system. These are likely to be as MedicationStatement
s, which could reference the source data from MedicationRequest
and MedicationDispense
records. Alternatively MedicationRequest
and MedicationDispense
records could be shared which the shared record system amalgamates and exposes as MedicationStatement
s for other consuming systems.
Prescribing system acts as the FHIR server, with a persisted copy Shared Record architecture
(1) The prescribing system sends an event notification to the pharmacy system when a new MedicationRequest
is ready for processing. The notification must include the external externally referencable identifer
. The prescirbing system assigns the logical id
.
(2) The prescribing system GETs the MedicationRequest using the identifer
. The GET request may be sent at any time so the pharmacy system may choose to expose status
values that represent both in-progress and end-states for the MedicationRequest
record.
(3) The dispending system creates the MedicationDispense
with a valid externally referencable identifer
and POSTs to the presribing system which adds the logical id
on receipt. The MedicationDispense
is only shared once ready to share with the pharmacy system so the status
will only deal with valid end-states.
(4) The prescribing system POSTs records to the shared record system. These are likely to be as MedicationStatement
s, which could reference the source data from MedicationRequest
and MedicationDispense
records. Alternatively MedicationRequest
and MedicationDispense
records could be shared which the shared record system amalgamates and exposes as MedicationStatement
s for other consuming systems.
Specific FHIR data elements
There are a number of feasible application architectures that would support ePMA to Pharmacy interoperability, and wider interoperability with shared record platforms.
With regard to the use of the specific FHIR data elements, the architectures may change how and when the id
, identifer
and status
elements are used.
Use of identifier
The identifier
is the most important element of a FHIR resource for interoperability. It acts as the externally facing unique business identifier for the resource. A key phrase from the FHIR R4 standard is;
[for
identifier
] ...All resources that have an identifier element support searching by the identifier, so that records can be located by that method.
Use of id
By contrast, the resource id
is normally an internally facing unique logical identifier. Within the FHIR R4 standard is the key phrase related to the logical id
where it is:
[for
id
] ...assigned by the server responsible for storing it
Use of status
The different types of business status
for MedicationRequest
and MedicationDispense
resources made visible within systems may change depending the interoperability architecture. Within some architectures, only valid end-states may be exposed, e.g. active
MedicationRequest
s. Within other architectures, when systems query the system acting as the FHIR server, records or any state may be returned, including records that may be draft
or other values that denote the business process has not yet completed.
Recommended API patterns.
Adoption of a common POST query syntax would allow the same software to, for example, POST a FHIR resource point-to-point to a dispensing system, POST a FHIR resource to a service like the Electronic Prescription Service (EPS), or POST a FHIR resource to a shared records service. A service like the EPS may require some additional data elements, but the mechanism of posting can be the same, using a different base URL technical end-point.
Adoption of a common GET query syntax would allow the same software to, for example, GET FHIR resources from a GP system or GET FHIR resources from shared records service. The query syntax can be the same, using a different base URL technical end-point.
POST Interactions
When POSTing a FHIR resource using a RESTful API use;
POST {fhir_server_base_url}/{resource}
For example;
POST https://myfhirserver.net/medicationrequest
with a Body
containing a single FHIR resource. Other resources referenced must be referenced with valid identifer
values to allow the FHIR server to locate those resources.
{ "resourceType": "MedicationRequest", "identifier": "a54219b8-f741-4c47-b662-e4f8dfa49ab6" // etc. }
When POSTing a FHIR Message use;
POST {fhir_server_base_url}/$process-message
with a Body
containing a FHIR Bundle within which is a FHIR MessageHeader resources and multiple FHIR resources;
{ "resourceType": "Bundle", "id": "0A1FD9EF-A3D5-4E95-84CD-552070A03083", "identifier": { "system": "https://tools.ietf.org/html/rfc4122", "value": "34470bbf-07cb-4b49-bef9-f958114f821f" }, "type": "message", "entry": [ { "fullUrl": "urn:uuid:0A1FD9EF-A3D5-4E95-84CD-552070A03083", "resource": { "resourceType": "MessageHeader", "id": "0A1FD9EF-A3D5-4E95-84CD-552070A03086", "eventCoding": { }, // etc. "sender": { }, // etc. "source": { }, // etc. "destination": { } // etc. } }, { "fullUrl": "urn:uuid:a54219b8-f741-4c47-b662-e4f8dfa49ab6", "resource": { "resourceType": "MedicationRequest", "identifier": "a54219b8-f741-4c47-b662-e4f8dfa49ab6" // etc. }
GET Interactions
To query a FHIR server for a specific resource by identifier
;
GET https://{fhir_server_base_url}/{resource}?identifier={value}
For example;
GET https://myfhirserver.net/MedicationRequest?identifier=a54219b8-f741-4c47-b662-e4f8dfa49ab6
To query a FHIR server for a specific resources for a given patient;
GET https://{fhir_server_base_url}/{resource}?patient.identifier=https://fhir.nhs.uk/Id/nhs-number|{NHS_Number}
For example;
GET https://myfhirserver.net/MedicationRequest?patient.identifier=https://fhir.nhs.uk/Id/nhs-number|123543254