NZ Shared Digital Health Record API
1.1.3 - release
NZ Shared Digital Health Record API - Local Development build (v1.1.3) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
The SDHR API comprises multiple FHIR resources. This page provides technical guidance for application developers integrating with the Shared Digital Health Record APIs.
The API Capability Statement defines supported FHIR interactions and request requirements. The FHIR artifacts provide the profiles, operation definitions, examples, and terminology used by the API, and the OpenAPI Specification provides a machine-readable interface description.
The SDHR API uses OAuth 2.0 client credentials. API consumers are authorised for approved interactions through the SDHR onboarding process.
The Request-Context header is required for API requests and supplies the user, organisation, facility, and other request context needed for authorisation and audit. X-Correlation-Id is optional and supports request tracing. The API Capability Statement and OpenAPI Specification define the technical header requirements.
The following tables summarise the interactions intended for external API consumers contributing information to or accessing information from SDHR. The linked profiles, operation definitions, and detailed sections remain authoritative for parameters, payloads, response behaviour, validation, and errors.
Allergy, condition, and observation information is contributed to the SDHR Primary Care Collection. These resources support the same interaction pattern.
| Resource | Interactions | HTTP verbs and relative URLs | Profile or definition | Detailed behaviour |
|---|---|---|---|---|
| AllergyIntolerance | search, create, read, update | GET /AllergyIntolerancePOST /AllergyIntoleranceGET /AllergyIntolerance/{id}PUT /AllergyIntolerance/{id} |
SDHR AllergyIntolerance | Search behaviour Update behaviour |
| Condition | search, create, read, update | GET /ConditionPOST /ConditionGET /Condition/{id}PUT /Condition/{id} |
SDHR Condition | Search behaviour Update behaviour |
| Observation | search, create, read, update | GET /ObservationPOST /ObservationGET /Observation/{id}PUT /Observation/{id} |
SDHR Observation | Search behaviour Update behaviour |
| Resource | Interaction | HTTP verb and relative URL | Profile or definition | Detailed behaviour |
|---|---|---|---|---|
| Bundle | batch | POST / |
SDHR Batch Bundle | The Bundle must use type = batch; transaction processing and participation operations within the Bundle are not supported. |
Medication and immunisation information is read-only through SDHR. It is sourced from national health information sources and cannot be created, updated, or deleted through the SDHR API.
| Resource | Interactions | HTTP verbs and relative URLs | Profile or definition | Detailed behaviour |
|---|---|---|---|---|
| MedicationRequest | search, read | GET /MedicationRequestGET /MedicationRequest/{id} |
SDHR MedicationRequest | Search behaviour |
| MedicationDispense | search, read | GET /MedicationDispenseGET /MedicationDispense/{id} |
SDHR MedicationDispense | Search behaviour |
| Immunization | search, read, vread | GET /ImmunizationGET /Immunization/{id}GET /Immunization/{id}/_history/{vid} |
SDHR Immunization | Search behaviour Confidential record behaviour |
| Operation | HTTP verb and relative URL | Definition | Status | Detailed behaviour |
|---|---|---|---|---|
$participate |
POST /$participate |
SDHR Participate Operation | Active | Technical contract Contribution workflow |
$participation-status |
POST /$participation-status |
SDHR Participation Status Operation | Active | Technical contract Access information workflow |
| Operation | HTTP verb and relative URL | Definition | Status | Detailed behaviour |
|---|---|---|---|---|
$verification-samples |
GET /AuditEvent/$verification-samples |
SDHR Verification Samples Operation | Draft | Access verification operations |
$verification-submissions |
POST /AuditEvent/$verification-submissions |
SDHR Verification Submissions Operation | Draft | Access verification operations |
The Shared Digital Health Record FHIR API supports the FHIR search pattern.
Supported search parameters are listed in the API Capability Statement.
See below for some example search queries.
This query returns all Condition resources for a given Patient and meta.source.
GET /Condition?patient=https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284&_source=https://api.hip.digital.health.nz/fhir/hpi/v1/Location/FZZ111-A
{
"resourceType": "Bundle",
"id": "92e3f5a6-2f8e-4e9d-a8f9-e5e6c578dd53",
"meta": {
"lastUpdated": "2025-05-01T21:23:04.818Z"
},
"type": "searchset",
"total": 2,
"link": [
{
"relation": "self",
"url": "https://server.url/Condition?_source=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2Fhpi%2Fv1%2FLocation%2FFZZ111-A&patient=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2Fnhi%2Fv1%2FPatient%2FZKC7284"
}
],
"entry": [
{
"search": {
"mode": "match"
},
"fullUrl": "https://server.url/Condition/635b2a1c-bdd1-4a20-8c2f-6d8348352f6a",
"resource": {
"identifier": [
{
"system": "https://standards.digital.health.nz/ns/health-record-key-id",
"value": "ef5b3aad-14c2-4904-aa25-7411dcb21327"
}
],
"extension": [
{
"url": "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/hnz-sdhr-client-last-updated-extension",
"valueDateTime": "2025-03-20T09:14:00+13:00"
},
{
"valueBoolean": true,
"url": "http://hl7.org.nz/fhir/StructureDefinition/long-term-condition"
}
],
"recorder": {
"reference": "https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/99ZZZZ",
"display": "Dottie McStuffins",
"type": "Practitioner"
},
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "38341003",
"display": "HT - Hypertension"
}
],
"text": "Hypertension"
},
"verificationStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
"code": "confirmed"
}
]
},
"subject": {
"reference": "https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284",
"display": "Carrey Carrington",
"type": "Patient"
},
"recordedDate": "2023-11-26T10:02:45+13:00",
"clinicalStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code": "active"
}
]
},
"onsetDateTime": "2011-02-05T00:00:00+13:00",
"asserter": {
"reference": "https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/91ZZXN",
"display": "DR Julian Subatoi Bashir",
"type": "Practitioner"
},
"meta": {
"lastUpdated": "2025-03-21T00:34:52.819Z",
"versionId": "1",
"profile": [
"https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRCondition"
],
"source": "https://api.hip.digital.health.nz/fhir/hpi/v1/Location/FZZ111-A"
},
"id": "635b2a1c-bdd1-4a20-8c2f-6d8348352f6a",
"resourceType": "Condition"
}
},
{
"search": {
"mode": "match"
},
"fullUrl": "https://server.url/Condition/c3605e85-6785-4fa9-94a5-6d8015416c53",
"resource": {
"extension": [
{
"url": "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/hnz-sdhr-client-last-updated-extension",
"valueDateTime": "2025-03-20T09:17:00+13:00"
},
{
"valueBoolean": true,
"url": "http://hl7.org.nz/fhir/StructureDefinition/long-term-condition"
}
],
"recorder": {
"reference": "https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/99ZZZZ",
"display": "Dottie McStuffins",
"type": "Practitioner"
},
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "13645005",
"display": "Chronic obstructive pulmonary disease"
}
],
"text": "Hypertension"
},
"verificationStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
"code": "confirmed"
}
]
},
"subject": {
"reference": "https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284",
"display": "Carrey Carrington",
"type": "Patient"
},
"recordedDate": "2023-11-26T10:02:45+13:00",
"clinicalStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code": "active"
}
]
},
"onsetDateTime": "2011-02-05T00:00:00+13:00",
"asserter": {
"reference": "https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/91ZZXN",
"display": "DR Julian Subatoi Bashir",
"type": "Practitioner"
},
"meta": {
"lastUpdated": "2025-03-21T00:41:35.416Z",
"versionId": "1",
"profile": [
"https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRCondition"
],
"source": "https://api.hip.digital.health.nz/fhir/hpi/v1/Location/FZZ111-A"
},
"id": "c3605e85-6785-4fa9-94a5-6d8015416c53",
"resourceType": "Condition"
}
}
]
}
The identifier search parameter can be used with unique source-system identifiers. This enables systems such as PMS products to locate resources using identifiers they assigned and retained. A resource can contain multiple identifiers.
Request
Conditionresources for a specific identifierGET Condition?patient=https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284&identifier=38cb6f26-9534-46e5-b659-536992faf0cc
Request
Conditionresources for a specific identifier AND system,GET /Condition?patient=https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284&identifier=https://some.local.system/ehr-key%7Cd2ed3bc7-da4a-45b8-ae3f-82176f5c64a4
{
"resourceType": "Bundle",
"id": "4c3cf2a4-4424-46f4-b4af-00c46812ec7e",
"meta": {
"lastUpdated": "2025-05-01T22:23:57.904Z"
},
"type": "searchset",
"total": 1,
"link": [
{
"relation": "self",
"url": "https://server.url/Condition?identifier=38cb6f26-9534-46e5-b659-536992faf0cc&patient=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2Fnhi%2Fv1%2FPatient%2FZKC7284"
}
],
"entry": [
{
"search": {
"mode": "match"
},
"fullUrl": "https://server.url/Condition/72ca633a-23cc-4848-a512-5111750508fb",
"resource": {
"identifier": [
{
"system": "https://some.local.system/ehr-key",
"value": "38cb6f26-9534-46e5-b659-536992faf0cc"
}
],
"extension": [
{
"url": "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/hnz-sdhr-client-last-updated-extension",
"valueDateTime": "2025-05-01T09:02:00+13:00"
},
{
"valueBoolean": true,
"url": "http://hl7.org.nz/fhir/StructureDefinition/long-term-condition"
}
],
"recorder": {
"reference": "https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/99ZZZZ",
"display": "Dottie McStuffins",
"type": "Practitioner"
},
"code": {
"coding": [
{
"system": "http://health.govt.nz/read-codes",
"code": "SN3..",
"display": "Local pressure"
}
],
"text": "Hypertension"
},
"verificationStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
"code": "confirmed"
}
]
},
"subject": {
"reference": "https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284",
"display": "Carrey Carrington",
"type": "Patient"
},
"recordedDate": "2023-11-26T10:02:45+13:00",
"clinicalStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code": "active"
}
]
},
"onsetDateTime": "2011-02-05T00:00:00+13:00",
"asserter": {
"reference": "https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/91ZZXN",
"display": "DR Julian Subatoi Bashir",
"type": "Practitioner"
},
"meta": {
"lastUpdated": "2025-05-01T22:23:37.587Z",
"versionId": "1",
"profile": [
"https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRCondition"
],
"source": "https://api.hip.digital.health.nz/fhir/hpi/v1/Location/FZZ111-A"
},
"id": "72ca633a-23cc-4848-a512-5111750508fb",
"resourceType": "Condition"
}
}
]
}
This section describes how an API consumer interacts with the SDHR FHIR server to update existing resources.
To maintain data integrity, API consumers authorised to update resources must use a "GET before PUT" approach. Fetching the current resource before updating it ensures that changes are based on the latest state and do not overwrite updates made by another API consumer.
The API Capability Statement documents the supported FHIR search parameters and direct read interactions.
Retrieve the resource directly using GET /Condition/{serverResourceId}.
After applying the required changes, update the resource using PUT /Condition/{serverResourceId}.
Use a FHIR search with parameters available to the API consumer to locate the resource before updating it.
Option 1: FHIR Search by local PMS identifier, stored as a FHIR Identifier
API consumers that create or update records may include a source-system identifier in the shared resource. When this identifier is retained locally, the API consumer can use the identifier search parameter to locate the resource.
Option 2: FHIR Search using resource search parameters
When a source-system identifier is unavailable, use the resource-specific parameters documented in the API Capability Statement. The search returns a FHIR Bundle that may contain multiple matches, which the API consumer must handle safely.
The SDHR service includes the following FHIR custom operations.
Draft: These verification operations and examples are currently draft and should be treated as draft interface content.
SEHR systems need to periodically retrieve sampled access events from SDHR, review whether those accesses were valid, and submit the verification decisions. Samples are represented as FHIR AuditEvent resources that conform to the SDHR AuditEvent profile.
This workflow is performed on an ongoing basis so that newly sampled access events continue to be reviewed and verified over time.
The end-to-end sequence and corresponding processing steps are documented in the audit access records workflow.
The SEHR calls GET /AuditEvent/$verification-samples to retrieve a Bundle of sampled AuditEvent resources that require verification. The operation supports _count and _offset query parameters for paging, for example:
GET /AuditEvent/$verification-samples?_count=1&_offset=0
See SDHRVerificationSamplesOperation.
{
"resourceType" : "Bundle",
"id" : "BundleVerificationSamplesResponseExample",
"type" : "collection",
"timestamp" : "2026-07-03T10:00:00+12:00",
"total" : 2,
"link" : [
{
"relation" : "self",
"url" : "https://api.uat.sdhr.digital.health.nz/s2s/AuditEvent/$verification-samples"
}
],
"entry" : [
{
"fullUrl" : "https://api.uat.sdhr.digital.health.nz/s2s/AuditEvent/b3f9de58-2da4-427c-a39c-07147eac3615",
"resource" : {
"resourceType" : "AuditEvent",
"id" : "b3f9de58-2da4-427c-a39c-07147eac3615",
"meta" : {
"profile" : [
🔗 "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRAuditEvent"
]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"AuditEvent_b3f9de58-2da4-427c-a39c-07147eac3615\"> </a><p class=\"res-header-id\"><b>Generated Narrative: AuditEvent b3f9de58-2da4-427c-a39c-07147eac3615</b></p><a name=\"b3f9de58-2da4-427c-a39c-07147eac3615\"> </a><a name=\"hcb3f9de58-2da4-427c-a39c-07147eac3615\"> </a><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\"/><p style=\"margin-bottom: 0px\">Profile: <a href=\"StructureDefinition-SDHRAuditEvent.html\">SDHRAuditEvent</a></p></div><p><b>type</b>: <a href=\"http://terminology.hl7.org/7.3.0/CodeSystem-audit-event-type.html#audit-event-type-rest\">Audit Event ID: rest</a> (Restful Operation)</p><p><b>subtype</b>: <a href=\"http://hl7.org/fhir/R4/codesystem-restful-interaction.html#restful-interaction-read\">FHIR Restful Interactions: read</a> (read)</p><p><b>action</b>: Read/View/Print</p><p><b>recorded</b>: 2026-07-03 09:15:00+1200</p><p><b>outcome</b>: Success</p><p><b>outcomeDesc</b>: Successful access sample returned for verification workflow.</p><h3>Agents</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Who</b></td><td><b>Requestor</b></td></tr><tr><td style=\"display: none\">*</td><td>Identifier: HPIProvider/1234</td><td>true</td></tr></table><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Observer</b></td></tr><tr><td style=\"display: none\">*</td><td>HNZ API Gateway</td></tr></table><blockquote><p><b>entity</b></p><p><b>what</b>: Identifier: <code>https://standards.digital.health.nz/ns/nhi</code>/ZKC7284</p></blockquote><blockquote><p><b>entity</b></p><p><b>what</b>: <a href=\"https://simplifier.net/resolve?scope=fhir.org.nz.ig.base@3.0.0&canonical=http://fhir.org.nz/ig/base/Condition/ConditionRespiratoryExample\">Condition/ConditionRespiratoryExample</a></p><h3>Details</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>correlationId</td><td>c500dae6-ac65-4e4f-a4c1-5aa222a6a807</td></tr></table></blockquote></div>"
},
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code" : "rest",
"display" : "Restful Operation"
},
"subtype" : [
{
"system" : "http://hl7.org/fhir/restful-interaction",
"code" : "read",
"display" : "read"
}
],
"action" : "R",
"recorded" : "2026-07-03T09:15:00+12:00",
"outcome" : "0",
"outcomeDesc" : "Successful access sample returned for verification workflow.",
"agent" : [
{
"who" : {
"identifier" : {
"system" : "https://standards.digital.health.nz/ns/hpi-person-id",
"value" : "1234"
}
},
"requestor" : true
}
],
"source" : {
"observer" : {
"display" : "HNZ API Gateway"
}
},
"entity" : [
{
"what" : {
"identifier" : {
"system" : "https://standards.digital.health.nz/ns/nhi",
"value" : "ZKC7284"
}
}
},
{
"what" : {
"reference" : "Condition/ConditionRespiratoryExample"
},
"detail" : [
{
"type" : "correlationId",
"valueString" : "c500dae6-ac65-4e4f-a4c1-5aa222a6a807"
}
]
}
]
}
},
{
"fullUrl" : "https://api.uat.sdhr.digital.health.nz/s2s/AuditEvent/6ebffb1a-61a1-4646-857e-51d4153b698d",
"resource" : {
"resourceType" : "AuditEvent",
"id" : "6ebffb1a-61a1-4646-857e-51d4153b698d",
"meta" : {
"profile" : [
🔗 "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRAuditEvent"
]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"AuditEvent_6ebffb1a-61a1-4646-857e-51d4153b698d\"> </a><p class=\"res-header-id\"><b>Generated Narrative: AuditEvent 6ebffb1a-61a1-4646-857e-51d4153b698d</b></p><a name=\"6ebffb1a-61a1-4646-857e-51d4153b698d\"> </a><a name=\"hc6ebffb1a-61a1-4646-857e-51d4153b698d\"> </a><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\"/><p style=\"margin-bottom: 0px\">Profile: <a href=\"StructureDefinition-SDHRAuditEvent.html\">SDHRAuditEvent</a></p></div><p><b>type</b>: <a href=\"http://terminology.hl7.org/7.3.0/CodeSystem-audit-event-type.html#audit-event-type-rest\">Audit Event ID: rest</a> (Restful Operation)</p><p><b>subtype</b>: <a href=\"http://hl7.org/fhir/R4/codesystem-restful-interaction.html#restful-interaction-search-type\">FHIR Restful Interactions: search-type</a> (search-type)</p><p><b>action</b>: Execute</p><p><b>recorded</b>: 2026-07-03 09:20:00+1200</p><p><b>outcome</b>: Success</p><p><b>outcomeDesc</b>: Successful search access sample returned for verification workflow.</p><h3>Agents</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Who</b></td><td><b>Requestor</b></td></tr><tr><td style=\"display: none\">*</td><td>Identifier: HPIProvider/1234</td><td>true</td></tr></table><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Observer</b></td></tr><tr><td style=\"display: none\">*</td><td>HNZ API Gateway</td></tr></table><blockquote><p><b>entity</b></p><p><b>what</b>: Identifier: <code>https://standards.digital.health.nz/ns/nhi</code>/ZKC7284</p></blockquote><blockquote><p><b>entity</b></p><p><b>what</b>: <a href=\"AllergyIntolerance-AllergyIntoleranceExample.html\">AllergyIntolerance Allergy to penicillin (finding)</a></p><h3>Details</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>correlationId</td><td>c500dae6-ac65-4e4f-a4c1-5aa222a6a807</td></tr></table></blockquote></div>"
},
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code" : "rest",
"display" : "Restful Operation"
},
"subtype" : [
{
"system" : "http://hl7.org/fhir/restful-interaction",
"code" : "search-type",
"display" : "search-type"
}
],
"action" : "E",
"recorded" : "2026-07-03T09:20:00+12:00",
"outcome" : "0",
"outcomeDesc" : "Successful search access sample returned for verification workflow.",
"agent" : [
{
"who" : {
"identifier" : {
"system" : "https://standards.digital.health.nz/ns/hpi-person-id",
"value" : "1234"
}
},
"requestor" : true
}
],
"source" : {
"observer" : {
"display" : "HNZ API Gateway"
}
},
"entity" : [
{
"what" : {
"identifier" : {
"system" : "https://standards.digital.health.nz/ns/nhi",
"value" : "ZKC7284"
}
}
},
{
"what" : {
🔗 "reference" : "AllergyIntolerance/AllergyIntoleranceExample"
},
"detail" : [
{
"type" : "correlationId",
"valueString" : "c500dae6-ac65-4e4f-a4c1-5aa222a6a807"
}
]
}
]
}
}
]
}
The SEHR reviews the returned AuditEvent resources using either an automated process or a manual workflow to determine whether each recorded access was valid.
The SEHR calls POST /AuditEvent/$verification-submissions with the defined Parameters payload to submit one or more verification decisions.
See SDHRVerificationSubmissionsOperation, the SDHRVerificationSubmissionParameters profile, and the SDHRVerificationSubmissionResponseParameters profile.
{
"resourceType" : "Parameters",
"id" : "ParametersVerificationSubmissionRequestExample",
"meta" : {
"profile" : [
🔗 "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRVerificationSubmissionParameters"
]
},
"parameter" : [
{
"name" : "verification",
"part" : [
{
"name" : "auditEvent",
"valueReference" : {
"reference" : "https://api.uat.sdhr.digital.health.nz/s2s/AuditEvent/b3f9de58-2da4-427c-a39c-07147eac3615"
}
},
{
"name" : "result",
"valueCode" : "validated"
}
]
},
{
"name" : "verification",
"part" : [
{
"name" : "auditEvent",
"valueReference" : {
"reference" : "https://api.uat.sdhr.digital.health.nz/s2s/AuditEvent/6ebffb1a-61a1-4646-857e-51d4153b698d"
}
},
{
"name" : "result",
"valueCode" : "validation-failed"
}
]
}
]
}
{
"resourceType" : "Parameters",
"id" : "ParametersVerificationSubmissionResponseExample",
"meta" : {
"profile" : [
🔗 "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRVerificationSubmissionResponseParameters"
]
},
"parameter" : [
{
"name" : "verificationSubmissionResult",
"part" : [
{
"name" : "auditEvent",
"valueReference" : {
"reference" : "AuditEvent/AuditEventVerificationSampleOne"
}
},
{
"name" : "status",
"valueCode" : "processed"
}
]
},
{
"name" : "verificationSubmissionResult",
"part" : [
{
"name" : "auditEvent",
"valueReference" : {
"reference" : "AuditEvent/AuditEventVerificationSampleTwo"
}
},
{
"name" : "status",
"valueCode" : "processed"
}
]
}
]
}
The $participate operation enables API consumers, such as PMS products, to record a patient's facility participation preference and record-level withholding or release.
| Contract element | Requirement |
|---|---|
| Interaction | System-level custom operation |
| HTTP request | POST /$participate |
| Definition | SDHR Participate Operation |
| Request body | FHIR Parameters conforming to the operation definition |
| Response body | OperationOutcome indicating success or failure |
| Behaviour | Idempotent for repeated requests with the same parameters |
The operation supports facility opt-out and opt-back-in, technical initialisation of the default facility preference, withholding a local Condition or Observation, and releasing a previously withheld record. Parameter cardinalities, conditional requirements, bindings, and response definitions are authoritative in the OperationDefinition.
Request examples:
Response examples:
{
"resourceType" : "Parameters",
"id" : "ParametersParticipateRecordReleased",
"parameter" : [
{
"name" : "patient",
"valueReference" : {
"reference" : "https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284",
"type" : "Patient",
"display" : "Susan Westbrook"
}
},
{
"name" : "facilityId",
"valueReference" : {
"reference" : "https://api.hip.digital.health.nz/fhir/hpi/v1/Location/FZZ111-A"
}
},
{
"name" : "resourceType",
"valueString" : "Condition"
},
{
"name" : "localResourceId",
"valueString" : "12345AAABBBccc"
},
{
"name" : "reasonCode",
"valueCodeableConcept" : {
"coding" : [
{
"system" : "https://fhir-ig.digital.health.nz/sdhr/CodeSystem/sdhr-participation-reason",
"code" : "sdhr-record-released",
"display" : "Record released"
}
]
}
}
]
}
See Manage participation for the end-to-end facility, Health NZ, confidentiality, and historical-reload workflows. UAT identities and expected deny or lock outcomes are documented under Test Data.
The $participation-status operation allows an SEHR system to check whether a patient is globally participating in SDHR before requesting health information. It returns the patient's NHI reference and the hnzParticipationIndicator boolean. The operation does not change the patient's participation preference and does not return clinical information.
| Contract element | Requirement |
|---|---|
| Interaction | System-level custom operation |
| HTTP request | POST /$participation-status |
| Definition | SDHR Participation Status Operation |
| Request body | FHIR Parameters containing one NHI patient reference |
| Response body | FHIR Parameters containing the patient reference and hnzParticipationIndicator |
hnzParticipationIndicator |
true indicates global participation; false indicates that the patient has opted out globally |
The operation is intended to be called by a healthcare provider on behalf of the patient. The patient must be identified by an NHI. The status returned is global; it does not represent a facility-level participation preference.
Request example:
{
"resourceType": "Parameters",
"parameter": [
{
"name": "patient",
"valueReference": {
"reference": "https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZXK9000",
"type": "Patient"
}
}
]
}
Response examples:
SEHR systems should use the result to determine whether to continue with an information request. If hnzParticipationIndicator is false, the patient is globally opted out of SDHR and no information will be available for that patient.
SDHR represents two distinct confidentiality cases: an SDHR resource carrying a restrictive FHIR security label, and a source record registered as withheld through $participate where the clinical resource is not stored in SDHR. Their API responses differ.
Confidentiality labels are applied to an SDHR resource through its meta.security array using the http://terminology.hl7.org/CodeSystem/v3-Confidentiality code system.
The behaviours below apply to resources labelled R (Restricted) or V (Very Restricted). SDHR resources without either confidentiality label are not subject to these behaviours.
{
"resourceType" : "AllergyIntolerance",
"id" : "AllergyIntoleranceExample",
"meta" : {
"lastUpdated" : "2024-01-26T10:03:26+13:00",
"source" : "https://api.hip.digital.health.nz/fhir/hpi/v1/Location/F38006-B",
"profile" : [
🔗 "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRAllergyIntolerance"
],
"security" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/v3-Confidentiality",
"code" : "R",
"display" : "Restricted"
}
]
},
"text" : {
"status" : "extensions",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: AllergyIntolerance AllergyIntoleranceExample</b></p><a name=\"AllergyIntoleranceExample\"> </a><a name=\"hcAllergyIntoleranceExample\"> </a><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Last updated: 2024-01-26 10:03:26+1300; </p><p style=\"margin-bottom: 0px\">Information Source: <a href=\"https://simplifier.net/resolve?scope=fhir.org.nz.ig.base@3.0.0&canonical=https://api.hip.digital.health.nz/fhir/hpi/v1/Location/F38006-B\">https://api.hip.digital.health.nz/fhir/hpi/v1/Location/F38006-B</a></p><p style=\"margin-bottom: 0px\">Profile: <a href=\"StructureDefinition-SDHRAllergyIntolerance.html\">SDHRAllergyIntolerance</a></p><p style=\"margin-bottom: 0px\">Security Label: <a href=\"http://terminology.hl7.org/7.3.0/CodeSystem-v3-Confidentiality.html\">Restricted (Details: Confidentiality code R = 'Restricted')</a></p></div><p><b>Client Last Updated</b>: 2023-11-26 10:02:45+1300</p><p><b>identifier</b>: <code>https://fhir.examplepms.co.nz</code>/ec2d6cad-1e19-46ee-accf-dc460a680710\u00a0(use:\u00a0secondary,\u00a0)</p><p><b>clinicalStatus</b>: <span title=\"Codes:{http://snomed.info/sct 443601000210103}\">Active Phase</span></p><p><b>verificationStatus</b>: <span title=\"Codes:{http://snomed.info/sct 410605003}\">Confirmed present</span></p><p><b>type</b>: Allergy</p><p><b>category</b>: 62014003</p><p><b>code</b>: <span title=\"Codes:{http://snomed.info/sct 91936005}\">Allergy to penicillin (finding)</span></p><p><b>patient</b>: <a href=\"https://simplifier.net/resolve?scope=fhir.org.nz.ig.base@3.0.0&canonical=https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284\">Sage Westbrook</a></p><p><b>recorder</b>: <a href=\"https://simplifier.net/resolve?scope=fhir.org.nz.ig.base@3.0.0&canonical=https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/91ZZXN\">DR Julian Subatoi Bashir</a></p></div>"
},
"extension" : [
{
"url" : "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/hnz-sdhr-client-last-updated-extension",
"valueDateTime" : "2023-11-26T10:02:45+13:00"
}
],
"identifier" : [
{
"use" : "secondary",
"system" : "https://fhir.examplepms.co.nz",
"value" : "ec2d6cad-1e19-46ee-accf-dc460a680710"
}
],
"clinicalStatus" : {
"coding" : [
{
"system" : "http://snomed.info/sct",
"code" : "443601000210103",
"display" : "Active Phase"
}
]
},
"verificationStatus" : {
"coding" : [
{
"system" : "http://snomed.info/sct",
"code" : "410605003",
"display" : "Confirmed present"
}
]
},
"type" : "allergy",
"category" : [
"62014003"
],
"code" : {
"coding" : [
{
"system" : "http://snomed.info/sct",
"code" : "91936005",
"display" : "Allergy to penicillin (finding)",
"userSelected" : true
}
]
},
"patient" : {
"reference" : "https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284",
"type" : "Patient",
"display" : "Sage Westbrook"
},
"recorder" : {
"reference" : "https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/91ZZXN",
"type" : "Practitioner",
"display" : "DR Julian Subatoi Bashir"
}
}
GET /AllergyIntolerance?patient=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2Fnhi%2Fv1%2FPatient%2FZKC7284
Response status: 200
Response body:
{
"resourceType" : "Bundle",
"id" : "SearchConfidentialRecordsResponseExample",
"meta" : {
"lastUpdated" : "2025-04-29T23:35:29.795Z",
"security" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
"code" : "redacted",
"display" : "REDACTED"
}
]
},
"type" : "searchset",
"total" : 2,
"link" : [
{
"relation" : "self",
"url" : "https://api.mock.sdhr.digital.health.nz/s2s/AllergyIntolerance?patient=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2Fnhi%2Fv1%2FPatient%2FZKC7284"
}
],
"entry" : [
{
"fullUrl" : "https://api.mock.sdhr.digital.health.nz/s2s/AllergyIntolerance/AllergyIntoleranceExample2",
"resource" : {
"resourceType" : "AllergyIntolerance",
"id" : "AllergyIntoleranceExample2",
"meta" : {
"lastUpdated" : "2024-01-26T10:03:26+13:00",
"source" : "https://api.hip.digital.health.nz/fhir/hpi/v1/Location/F38006-B",
"profile" : [
🔗 "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/SDHRAllergyIntolerance"
]
},
"text" : {
"status" : "extensions",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: AllergyIntolerance AllergyIntoleranceExample2</b></p><a name=\"AllergyIntoleranceExample2\"> </a><a name=\"hcAllergyIntoleranceExample2\"> </a><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Last updated: 2024-01-26 10:03:26+1300; </p><p style=\"margin-bottom: 0px\">Information Source: <a href=\"https://simplifier.net/resolve?scope=fhir.org.nz.ig.base@3.0.0&canonical=https://api.hip.digital.health.nz/fhir/hpi/v1/Location/F38006-B\">https://api.hip.digital.health.nz/fhir/hpi/v1/Location/F38006-B</a></p><p style=\"margin-bottom: 0px\">Profile: <a href=\"StructureDefinition-SDHRAllergyIntolerance.html\">SDHRAllergyIntolerance</a></p></div><p><b>Client Last Updated</b>: 2024-02-14 11:15:00+1300</p><p><b>identifier</b>: <code>https://fhir.examplepms.co.nz</code>/ec2d6cad-1e19-46ee-accf-dc460a680710\u00a0(use:\u00a0secondary,\u00a0)</p><p><b>clinicalStatus</b>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical active}\">Active</span></p><p><b>verificationStatus</b>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/allergyintolerance-verification confirmed}\">Confirmed</span></p><p><b>type</b>: Allergy</p><p><b>category</b>: 370540009</p><p><b>code</b>: <span title=\"Codes:{http://snomed.info/sct 227493005}\">Cashew nuts</span></p><p><b>patient</b>: <a href=\"https://simplifier.net/resolve?scope=fhir.org.nz.ig.base@3.0.0&canonical=https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284\">Sage Westbrook</a></p><p><b>recorder</b>: <a href=\"https://simplifier.net/resolve?scope=fhir.org.nz.ig.base@3.0.0&canonical=https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/91ZZXN\">DR Julian Subatoi Bashir</a></p></div>"
},
"extension" : [
{
"url" : "https://fhir-ig.digital.health.nz/sdhr/StructureDefinition/hnz-sdhr-client-last-updated-extension",
"valueDateTime" : "2024-02-14T11:15:00+13:00"
}
],
"identifier" : [
{
"use" : "secondary",
"system" : "https://fhir.examplepms.co.nz",
"value" : "ec2d6cad-1e19-46ee-accf-dc460a680710"
}
],
"clinicalStatus" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
"code" : "active",
"display" : "Active"
}
]
},
"verificationStatus" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
"code" : "confirmed",
"display" : "Confirmed"
}
]
},
"type" : "allergy",
"category" : [
"370540009"
],
"code" : {
"coding" : [
{
"system" : "http://snomed.info/sct",
"code" : "227493005",
"display" : "Cashew nuts",
"userSelected" : true
}
]
},
"patient" : {
"reference" : "https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC7284",
"type" : "Patient",
"display" : "Sage Westbrook"
},
"recorder" : {
"reference" : "https://api.hip.digital.health.nz/fhir/hpi/v1/Practitioner/91ZZXN",
"type" : "Practitioner",
"display" : "DR Julian Subatoi Bashir"
}
},
"search" : {
"mode" : "match"
}
}
]
}
This search requests AllergyIntolerance resources for a patient. Because the search matches a confidential resource, that resource is omitted and the server adds a REDACTED tag to Bundle.meta.security. The tag tells the API consumer that the result set has been filtered. Bundle.total reports the number of matches before confidentiality filtering.
GET /AllergyIntolerance/{id}
Response status: 403
Response body:
{
"resourceType" : "OperationOutcome",
"id" : "APIError-Confidential",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationOutcome APIError-Confidential</b></p><a name=\"APIError-Confidential\"> </a><a name=\"hcAPIError-Confidential\"> </a><h3>Issues</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Severity</b></td><td><b>Code</b></td><td><b>Diagnostics</b></td></tr><tr><td style=\"display: none\">*</td><td>Error</td><td>Security Problem</td><td>Resource access is forbidden</td></tr></table></div>"
},
"issue" : [
{
"severity" : "error",
"code" : "security",
"diagnostics" : "Resource access is forbidden"
}
]
}
In this example, a request for a single confidential resource receives an HTTP 403 response.
The following search supplies these parameters:
patient |
https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZKC4633 |
source |
https://api.hip.digital.health.nz/fhir/hpi/v1/Location/F38006-B |
identifier |
6b8a6cc1-612f-456e-89df-9fbcd753acb2 |
GET /Condition?patient=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2Fnhi%2Fv1%2FPatient%2FZKC4633&_source=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2Fhpi%2Fv1%2FLocation%2FF38006-B&identifier=6b8a6cc1-612f-456e-89df-9fbcd753acb2
In this example, the supplied parameters exactly match a single record that the source system has marked as withheld. The server does not hold the clinical record, but it can uniquely match the search to the withheld record registered through the $participate operation.
The search response contains an OperationOutcome entry with "mode":"outcome":
{
"resourceType" : "Bundle",
"id" : "SearchExactMatchRecordWithheldExample",
"meta" : {
"lastUpdated" : "2025-04-29T23:35:29.795Z"
},
"type" : "searchset",
"total" : 0,
"link" : [
{
"relation" : "self",
"url" : "https://api.mock.sdhr.digital.health.nz/s2s/Condition?patient=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2Fnhi%2Fv1%2FPatient%2FZKC4633&_source=https%3A%2F%2Fapi.hip.digital.health.nz%2Ffhir%2FLocation%2FF38006-B&identifier=6b8a6cc1-612f-456e-89df-9fbcd753acb2"
}
],
"entry" : [
{
"resource" : {
"resourceType" : "OperationOutcome",
"id" : "OperationOutcomeRecordsWithheldAtSource",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"OperationOutcome_OperationOutcomeRecordsWithheldAtSource\"> </a><p class=\"res-header-id\"><b>Generated Narrative: OperationOutcome OperationOutcomeRecordsWithheldAtSource</b></p><a name=\"OperationOutcomeRecordsWithheldAtSource\"> </a><a name=\"hcOperationOutcomeRecordsWithheldAtSource\"> </a><h3>Issues</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Severity</b></td><td><b>Code</b></td><td><b>Details</b></td></tr><tr><td style=\"display: none\">*</td><td>Information</td><td>Informational Note</td><td><span title=\"Codes:{https://fhir-ig.digital.health.nz/sdhr/CodeSystem/sdhr-outcome-codes sdhr-records-withheld-at-source}\">Patient has withheld records at source. The operation was successful, but some records were not included in the response due to confidentiality settings.</span></td></tr></table></div>"
},
"issue" : [
{
"severity" : "information",
"code" : "informational",
"details" : {
"coding" : [
{
"system" : "https://fhir-ig.digital.health.nz/sdhr/CodeSystem/sdhr-outcome-codes",
"code" : "sdhr-records-withheld-at-source",
"display" : "Records withheld at source"
}
],
"text" : "Patient has withheld records at source. The operation was successful, but some records were not included in the response due to confidentiality settings."
}
}
]
},
"search" : {
"mode" : "outcome"
}
}
]
}
The $hnz-participate and $hnz-participation-status operations are restricted to authorised Health NZ internal channels and are not available to external API consumers.