Skip to content

Instantly share code, notes, and snippets.

@elementechemlyn
Last active January 13, 2021 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elementechemlyn/90b82cebfdcd12eeb2afab650f2afb49 to your computer and use it in GitHub Desktop.
Save elementechemlyn/90b82cebfdcd12eeb2afab650f2afb49 to your computer and use it in GitHub Desktop.

Pointer Resolution Notes

A set of examples of retrieving the contents of a fully contained NEMS message from a pointer passed in a lightweight NEMS message. These examples all use search functionality as described in the base HL7 FHIR spec:

https://www.hl7.org/fhir/STU3/search.html

Examples Setup

To setup these examples, the transactional bundle found here:

https://gist.github.com/elementechemlyn/1f3cf7b81f9636aa5e01c67805de29d6

can be posted to the base url of a FHIR server that supports transactions. The bundle sets up the resources that match the "New Given (inc Imms)" example here:

https://nems-nhsx-draft.netlify.app/vaccinations_2.html

At the time of writing, this set of resources exists at http://hapi.fhir.org/baseDstu3. If you post the resources again (perhaps because the public server has been purged) you'll need to adjust the resource identifiers used below.

Pointer format/resolution examples

Individual Focus Resource

The pointer to an individual focus resource would look like this:

http://hapi.fhir.org/baseDstu3/Immunization/2800446

This is the simplest option for a publisher but requires the subscriber to make multiple calls to resolve references to other "context" resources that would have been recieve in the contained NEMS message.

Publisher Requirements

Subscriber Requirements

  • The Subscriber must make seperate calls to retrieve each reference in the resource

Individual Focus Resource with references

The HL7 Specification details search functionality to have the server automatically resolve references in a resource and return them in the search bundle. This style puts most requirements on the publisher of the pointer but allows a subscriber to retrieve all resources in a single call.

http://hapi.fhir.org/baseDstu3/Immunization?_id=2800446&_include:recurse=*

Publisher Requirements

  • The focus resource must be stored with references to each element expected in the contained NEMS message
  • The server must support the Care Connect immunization resource as detailed here https://nhsconnect.github.io/CareConnectAPI/api_medication_immunization.html
  • The server must support each contained element as a SearchInclude parameter
  • The server must support the :recurse modifier on _include to also include references to references (e.g the organisation for an Encounter)

Subscriber Requirements

  • The Subscriber must make seperate calls to retrieve each reference in the resource that the publishing server does not support as a SearchInclude parameter

All Immunisations for patient (i.e ."catch-up")

The HL7 FHIR Search spec details the use of chaining search parameters to retrive all the resources that reference another specific resource. This allows a client to catch-up on all the resources a publisher holds related to a patient with a specific NHS Number 9912003888 without having to search for the patient in a seperate call.

http://hapi.fhir.org/baseDstu3/Immunization?patient.identifier=https://fhir.nhs.uk/Id/nhs-number|9912003888

Publisher Requirements

Subscriber Requirements

  • The Subscriber must make seperate calls to retrieve each reference in the resources

All Immunisations for patient with references (i.e ."catch-up")

The chanined search parameter can be combined with the include parameter to allow a client to retrieve all of the resources they would get in a fully contained messages for a patient with a specific NHS Number (i.e. They can catch-up on all events from a single pointer/call to the API)

http://hapi.fhir.org/baseDstu3/Immunization?patient.identifier=https://fhir.nhs.uk/Id/nhs-number|9912003888&_include:recurse=*

Publisher Requirements

  • The focus resource must be stored with references to each element expected in the contained NEMS message
  • The server must support the Care Connect immunization resource as detailed here https://nhsconnect.github.io/CareConnectAPI/api_medication_immunization.html
  • The server must support each contained element as a SearchInclude parameter
  • The server must support the :recurse modifier on _include to also include references to references (e.g the organisation for an Encounter)
  • The server must support chained searches with the patient.identifier parameter

Subscriber Requirements

  • The Subscriber must make seperate calls to retrieve each reference in the resources that the publishing server does not support as a SearchInclude parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment