Te Whatu Ora, Central Region Integration Hub
1.0.12-rc1 - ci-build New Zealand flag

Te Whatu Ora, Central Region Integration Hub, published by Te Whatu Ora, Te Pae Hauora o Ruahine o Tararua, MidCentral. This guide is not an authorized publication; it is the continuous build for version 1.0.12-rc1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/tewhatuora/centralRegion-integrationHub-ig/ and changes regularly. See the Directory of published versions

Use Case: Refer Patient

1. Refer PatientClinicianWebPasPatient AdminHL7 v2Hub & SpokeFHIR APIIntegration HubAPI Client(ConnectedCare, Scope, etc)Preconditions:1. Have OAuth AccessToken2. ServiceRequest Subscription   Payload Options- PUT - callback/ServiceRequest - single resource payload- POST - callback - multi-resource bundle includingPatient Referral[1]Create Patient Referral to Medical Speciality[2]HL7 REF I12[3]HL7 REF I12[4]mapToServiceRequest()[5]saveResource(ServiceRequest)[6]ack/nakmilliseconds later[7]PUT or POST /fhir/callback[8]ack/nak for PUT ServiceRequest payloadRetrieve Patient Details[9]GET /fhir/Patient/{id}[10]retrieveResource({patientId})[11]Patient({id}) Callback Payload Options1. PUT - callback/Patient/{id} - single resource payload2. POST - callback - multi-resource bundleSubscribe Patient Updates[12]POST /fhir/Subscription[13]validateSubscription[14]saveResource()[15]ack/nak[16]Acts on Referral

Subscriptions

Full discussion of Subscription payload options is in the Developer's Guide. Two subscriptions are required at various stages of this use case:

  1. The second pre-requisite of this use-case requires a subscription on the ServiceRequest resource be put in place prior to referrals being created.
  2. Step 12 places a subscription on the relevant Patient resource.

For both these subscriptions the client needs to decide if they want to receive a single resource notification, or a bundle resource notification.

Single Resource Notification Subscription

The second pre-requisite of this use-case is that a suitable subscription be put in place prior to referrals being created. A sample subscription, returning the triggered ServiceRequest resource that targets referrals to a particular Hospital Clinic e.g. Mental Health and Addiction Services, would look like this:

{
    "resourceType": "Subscription",
    "status": "active",
    "criteria": "ServiceRequest?clinicType=MMA",
    "channel": {
        "type": "rest-hook",
        "endpoint": "http://localhost:3000/fhir/callback/ServiceRequest",
        "payload": "application/json"
    },
}

Notes

  • The use of clinicType search parameter, to target the subscription to the particular hospital clinic.
  • The rest-hook callback will use an HTTP PUT call to the endpoint URL; You may require separate callback addresses, one for each resource type you expect to receive.

Bundle Resource Notification Subscription (ServiceRequest)

Steps 9, 10 & 11, the retrieve patient details steps, can be removed from the above diagram by requesting a suitable bundle resource notification when placing the subscription:

{
    "resourceType": "Subscription",
    "status": "active",
    "criteria": "ServiceRequest?_clinicType=MMA",
    "channel": {
        "type": "rest-hook",
        "endpoint": "http://localhost:3000/fhir/callback",
        "payload": "application/json"
    },
    "extension": [ {
        "url": "http://hapifhir.io/fhir/StructureDefinition/subscription-payload-search-criteria",
        "valueString": "ServiceRequest?_id=${1}&_include=Patient:*&_revinclude:iterate=AllergyIntolerance:*&_revinclude:iterate=Flag:*&_revinclude:iterate=ClinicalImpression:*"
    } ]
}

Notes:

  • Notifications from this subscription will return:
    1. The triggering referral as a ServiceRequest resource
    2. The Patient resource
    3. The Patient's Flag, Allergy and ClinicalImpression resources.
  • The use of payload-search-criteria extension to include multiple resources, related to the triggering ServiceRequest, in the bundle.
  • The rest-hook callback will use an HTTP POST call to the endpoint URL

Bundle Resource Notification Subscription (Patient)

Step 12 in this use case places a subscription on the relevant Patient resource, to receive notifications on all subsequent updates of patient records. It is most likely that you will want to place another bundle resource notification subscription, like this:

{
    "resourceType": "Subscription",
    "id": "325",
    "status": "active",
    "criteria": "Patient?identifier=ZKG3868",
    "channel": {
        "type": "rest-hook",
        "endpoint": "http://localhost:3000/fhir/callback",
        "payload": "application/json"
    },
    "extension": [ {
        "url": "http://hapifhir.io/fhir/StructureDefinition/subscription-payload-search-criteria",
        "valueString": "Patient?_id=${matched_resource_id}&_include=*&_revinclude=Flag:*&_revinclude=AllergyIntolerance:*&_revinclude=ClinicalImpression:*&_revinclude=ServiceRequest:*"
      } ]
}