Health NZ | Te Whatu Ora FHIR Screening Implementation Guide
1.0.0 - normative+trial-use New Zealand flag

Health NZ | Te Whatu Ora FHIR Screening Implementation Guide - Local Development build (v1.0.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

API consumption sequence diagrams

FHIR API authentication and authorization checks

Cervical screening API data access - API request prerequisite checksHNZ digital services hubHNZ FHIR APIshealth practitioner (screening)health practitioner (screening)practitioner's APP/PMSpractitioner's APP/PMSAPI authn. serverAPI authn. serverAPI gatewayAPI gatewayscreening summary FHIR APIscreening summary FHIR APINHI/HPI APINHI/HPI APIAPI consumer OAUTH authentication at PMS initialisation[01]OAUTH2.0 Client Credentials Flow(client creds, scopes, audiences)[02]OAUTH token"scope": [   "system/DocumentReference.rs",  "system/Patient.r" ]"aud": "https://fhir-ig.digital.health.nz/screening/StructureDefinition/nz-screening-summary"DSH "Connector Plane" and FHIR API authorization checks[03]request a screening summaryPMS/APP must set upRequest-Contextcustom header correctly:  "userIdentifier" - user Id as known/authenticated by the PMS/APP  "userRole" - the role of the user as defined by the PMS/APP  "secondaryIdentifier" - the user's health organisation as an HPI organisation identifier.[04]GET/DocumentReference?[05]validate OAUTH token(issuer,token,scopes,sig)break[Bad/missing access token][06]HTTP 401 error: Unauthorized[07]GET /DocumentReference?..[08]validate OAUTH token(issuer,token,scope,audience)break[Bad/missing access token][09]HTTP 401 error: UnauthorizedValidateRequest-Contextcustom header[10]check Request-Context required attributesbreak[Bad Request-Context][11]HTTP 400 error: Bad Requestalt[If HPI Practitioner Id in secondary identifiers][12]check HPI practitioner idbreak[Practitioner Id not found in HPI][13]HTTP 400 error "invalid HPI Practitioner Id"alt[If HPI Organisation Id supplied as secondary identifier][14]check HPI org idbreak[Organisation Id not found in HPI][15]HTTP 400 error "invalid HPI Organisation Id"API request processing can now proceed - see Typical Operation diagram


User/practitioner special data access terms acceptance sequence

Cervical screening API data access - special terms practitioner acceptance flowHNZ FHIR APIshealth practitioner (screening)health practitioner (screening)practitioner's APP/PMSpractitioner's APP/PMSscreening summary APIscreening summary APINHI/HPI APINHI/HPI APIFHIR forms servicesFHIR forms servicesinitialisation and prequisite API checksRefer to authorization sequence diagramfirst time API use by new practitioner/user[01]request screening summary for a patientPMS/APP must set upRequest-Context:  "userIdentifier" - user Id as known/authenticated by the PMS/APP  "userRole" - the role of the user as defined by the PMS/APP  "secondaryIdentifier" - the user's health organisation as an HPI organisation identifier.[02]GET /DocumentReference?<params>[03]check for existing terms acceptanceNo current terms-acceptance for this practitioner/user[04]Prepare Terms Acceptance FormForm is prepared as a FHIR Questionnaire for thecurrent Practitioner and Org (fromRequest-Context)[05]Form Url ("magic link")[06]Prepare OperationOutcome 403 responsebreak[Practitioner terms acceptance sub flow][07]HTTP 403 Forbidden error with magic linkOn receipt of a 403 response, the PMS/APP must check for a link in the FHIROperationOutcome.diagnosticsproperty.The PMS/APP shall redirect the user's browser to that link to dispay the prepared Terms Acceptance form.[08]Display form via browser redirect[09]Read form and accept special terms[10]POST /QuestionnaireResponse (withRequest-Context header)Request-Contextcustom header must set  "userIdentifier" - user Id as known/authenticated by the PMS/APP  "userRole" - the role of the user as defined by the PMS/APP  "secondaryIdentifier" - the user's health organisation as an HPI organisation identifier.[11]Extract and recordacceptance submission[12]Practitioner terms acceptance complete The practitioner/user can now resume the request for screening summaries in the PMS.API request processing can now proceed - see Typical Operation diagram


FHIR screening summary API typical operation

Cervical screening summary - Typical API OperationHNZ FHIR APIshealth practitioner (screening)health practitioner (screening)practitioner's APP/PMSpractitioner's APP/PMSscreening summary FHIR APIscreening summary FHIR APINHI FHIR APINHI FHIR APIinitialisation and prequisite API checksRefer to authorization sequence diagramnormal API usage[01]enter patient name, NHI[02]NHI search[03]present NHI matches[04]request screening summaries for selected NHI and programme typeRequest-Contextcustom header must be setup by PMS/APP  "userIdentifier" - user Id as known/authenticated by the PMS/APP  "userRole" - the role of the user as defined by the PMS/APP  "secondaryIdentifier" - the user's health organisation as an HPI organisation identifier.[05]GET /DocumentReference?<params>search request query parameters:? subject:identifier= <NHI>& category= <screening service type SNOMED>& contenttype=application/pdf& _include=DocumentReference:subject[06]validate OAUTH token(issuer,token,scope,audience)[07]validate Request-Context custom headeralt[normal report generation][08]get data from backend APIs[09]generate screening summary content asHTML and PDF[10]include participant data as Patient instance[11]200 OK, FHIR searchset BundleIn normal search response is a FHIR searchset Bundle. EachBundle entry comprises aDocumentReference (mode:#match)containingthe formatted screening summary, AND aPatient (mode:#include) instance for the patient demographic detail[No screening summary is available][12]200 OK, Bundle of mode: #outcomeWhen screening history not available for specified subject, the Bundle contains oneor moreOperationOutcomes (mode: #outcome) describing the reason(s).[technical error][13]HTTP 4xx|5xx error codeIn technical error scenarios, the responseis just a FHIROperationOutcome[14]process results and display to user[15]present screening summary / search result