NZ Shared Digital Health Record API
1.0.1 - release

NZ Shared Digital Health Record API, published by Health New Zealand. This guide is not an authorized publication; it is the continuous build for version 1.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/tewhatuora/fhir-sdhr/ and changes regularly. See the Directory of published versions

## : SDHRParticipateOperation - TTL Representation

Active as of 2026-06-05

Raw ttl | Download

    @prefix fhir: <http://hl7.org/fhir/> .
    @prefix owl: <http://www.w3.org/2002/07/owl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

    # - resource -------------------------------------------------------------------

     a fhir:OperationDefinition ;
      fhir:nodeRole fhir:treeRoot ;
      fhir:id [ fhir:v "SDHRParticipateOperation"] ; #
      fhir:text [
    fhir:status [ fhir:v "generated" ] ;
    fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition SDHRParticipateOperation</b></p><a name=\"SDHRParticipateOperation\"> </a><a name=\"hcSDHRParticipateOperation\"> </a><p>URL: [base]/$participate</p><h3>Parameters</h3><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>patient</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/references.html#Reference\">Reference</a></td><td/><td><div><p>Reference must be an NHI Patient URL with format https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZZZ1111 or ZZZ11AA</p>\n</div></td></tr><tr><td>IN</td><td>participationIndicator</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#boolean\">boolean</a></td><td/><td><div><p>Indicates global participation in the Shared Digital Health Record service (true/false)\nIf false, the patient does not wish to participate in the service and their resources will not be shared.\nThis parameter is mandatory when indicating global participation but is not required when indicating partial participation with withheld records (see <code>resourceType</code> and <code>localResourceId</code> parameters).\nIf an API consumer attempts to POST a record for a patient that has not opted in, the API will return an OperationOutcome with an error message indicating that the patient has not indicated their participation preferences.</p>\n</div></td></tr><tr><td>IN</td><td>resourceType</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#string\">string</a></td><td/><td><div><p>The resource type that is being withheld. Must be a valid FHIR resource type supported by the SDHR service, such as <code>Condition</code>, <code>Observation</code> etc. Note that <code>AllergyIntolerance</code> resources MUST NOT be withheld.\nThis parameter is optional and should only be used to specify the type of resource that is withheld from the Shared Digital Health Record service.\nWhen this paramter is used the request MUST contain a <code>reasonCode</code> parameter and a <code>localResourceId</code> parameter.</p>\n</div></td></tr><tr><td>IN</td><td>facilityId</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/references.html#Reference\">Reference</a></td><td/><td><div><p>The HPI Facility ID of the healthcare provider that is withholding the resource.\nThis parameter is mandatory and must be provided to indicate the healthcare provider that is withholding the resource from the Shared Digital Health Record service.\nThe HPI Facility ID must be a valid HPI Facility ID in the format <code>https://api.hip.digital.health.nz/fhir/hpi/v1/Location/{hpi-facility-id}</code>.</p>\n</div></td></tr><tr><td>IN</td><td>localResourceId</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#string\">string</a></td><td/><td><div><p>The local resource ID that is withheld from the Shared Digital Health Record service.\nThis parameter is optional and should only be used to specify the local ID of the resource that is withheld.\nWhen this paramter is used the request MUST contain a <code>reasonCode</code> parameter and a <code>resourceType</code> parameter.</p>\n</div></td></tr><tr><td>IN</td><td>reasonCode</td><td/><td>0..1</td><td><a href=\"http://hl7.org/fhir/R4/datatypes.html#Coding\">Coding</a></td><td><a href=\"ValueSet-sdhr-participation-reason-valueset.html\">ValueSet for SDHR Participation Reason</a> (Required)</td><td><div><p>The reason code for participation. This <strong>MUST</strong> be provided when the intent is to indicate a withheld record or when releasing a record.\nValid codes include:</p>\n<ul>\n<li><code>sdhr-record-withheld</code>: Records withheld from the patient for privacy or confidentiality reasons.</li>\n<li><code>sdhr-record-released</code>: Record that was previously withheld has been released (is no longer confidential or restricted) to the service by the patient.</li>\n</ul>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R4/operationoutcome.html\">OperationOutcome</a></td><td/><td><div><p>The result of the operation.\nThis parameter will contain an OperationOutcome resource indicating the success or failure of the operation.\nIf the operation is successful, the OperationOutcome will contain a success message.\nIf the operation fails, the OperationOutcome will contain an error message indicating the reason for the failure.\nThe OperationOutcome resource will be returned in the response body of the operation request.\nSee the following examples for possible OperationOutcome responses:</p>\n<ul>\n<li><a href=\"./OperationOutcome-OperationOutcomeParticipateInvalidPatient.html\">OperationOutcome for invalid patient reference</a></li>\n<li><a href=\"./OperationOutcome-OperationOutcomeParticipateMissingReason.html\">OperationOutcome for missing reason code</a></li>\n<li><a href=\"./OperationOutcome-OperationOutcomeParticipateSuccess.html\">OperationOutcome for successful participation</a>\nNote that the following <code>OperationOutcome</code> would be returned when an API Consumer attempts to POST a record for a patient that has not provided their participation preferences:</li>\n<li><a href=\"./OperationOutcome-OperationOutcomeParticipatePreferencesNotKnown.html\">OperationOutcome for participation preferences not known</a></li>\n</ul>\n</div></td></tr></table></div>"^^rdf:XMLLiteral ]
      ] ; #
      fhir:url [
    fhir:v "https://fhir-ig.digital.health.nz/sdhr/OperationDefinition/SDHRParticipateOperation"^^xsd:anyURI ;
    fhir:l <https://fhir-ig.digital.health.nz/sdhr/OperationDefinition/SDHRParticipateOperation>
      ] ; #
      fhir:version [ fhir:v "1.0.1"] ; #
      fhir:name [ fhir:v "Participate"] ; #
      fhir:status [ fhir:v "active"] ; #
      fhir:kind [ fhir:v "operation"] ; #
      fhir:date [ fhir:v "2026-06-05T02:07:34+00:00"^^xsd:dateTime] ; #
      fhir:publisher [ fhir:v "Health New Zealand"] ; #
      fhir:contact ( [
    fhir:name [ fhir:v "Health New Zealand" ] ;
        ( fhir:telecom [
    fhir:system [ fhir:v "url" ] ;
    fhir:value [ fhir:v "https://github.com/tewhatuora" ]     ] )
      ] [
    fhir:name [ fhir:v "HNZ Integration Team" ] ;
        ( fhir:telecom [
    fhir:system [ fhir:v "email" ] ;
    fhir:value [ fhir:v "integration@tewhatuora.govt.nz" ] ;
    fhir:use [ fhir:v "work" ]     ] )
      ] ) ; #
      fhir:description [ fhir:v "This operation allows a patient to choose to participate in the Shared Digital Health Record service.\nThis operation should be used by data providers in the Shared Digital Health Record ecosystem such as Patient Management Systems (PMS) or Electronic Health Record (EHR) systems.\nIt can be used to indicate whether the patient wishes to participate, whether any resources are withheld, and the reason for participation. The scope of this operation is the API consumer - e.g. an HPI Facility where patient data is held.\n\nScenarios where this operation might be used include:\n- A patient has opted in to the Shared Digital Health Record service and appropriate data will be shared from the data holder to the service.\n- A patient chooses not to participate in the Shared Digital Health Record service and informs their healthcare provider of this choice.\n- A patient has one or more confidential records, held at their healthcare provider, that are withheld from the service.\n- A patient has previously withheld records but has now released them to the Shared Digital Health Record service.\n\nFor example payloads that might be used with this operation see:\n- [Parameters resource for total non-participation](./Parameters-ParametersDoNotParticipate.html) : This example shows how to indicate that a patient does not wish to participate in the Shared Digital Health Record service (has opted out).\n- [Parameters resource for participation](./Parameters-ParametersParticipate.html) : This example shows how to indicate that a patient wishes to participate in the Shared Digital Health Record service, where previously opted out (opt-in).\n- [Parameters resource for partial participation with withheld records](./Parameters-ParametersParticipateRecordWithheld.html) : This example shows how to indicate that a patient has some confidential records that are withheld from the Shared Digital Health Record service.\n- [Parameters resource for releasing withheld records](./Parameters-ParametersParticipateRecordReleased.html) : This example shows how to indicate that a patient has previously withheld records but has now released them to the Shared Digital Health Record service.\n\nTo make a request to this operation the API Consumer must POST a `Parameters` payload to the operation URL (e.g. `POST https://api.sdhr.digital.health.nz/s2s/$participate`).\n\nThe operation is idempotent, meaning that multiple requests with the same parameters will have the same effect as a single request.\nThe operation is expected to be called by a healthcare provider on behalf of the patient, and the patient must be identified by their NHI.\nThe operation will return an OperationOutcome resource indicating the result of the operation."] ; #
      fhir:code [ fhir:v "participate"] ; #
      fhir:system [ fhir:v true] ; #
      fhir:type [ fhir:v false] ; #
      fhir:instance [ fhir:v false] ; #
      fhir:parameter ( [
    fhir:name [ fhir:v "patient" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 1 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:documentation [ fhir:v "Reference must be an NHI Patient URL with format https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZZZ1111 or ZZZ11AA" ] ;
    fhir:type [ fhir:v "Reference" ]
      ] [
    fhir:name [ fhir:v "participationIndicator" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 1 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:documentation [ fhir:v "Indicates global participation in the Shared Digital Health Record service (true/false)\nIf false, the patient does not wish to participate in the service and their resources will not be shared.\nThis parameter is mandatory when indicating global participation but is not required when indicating partial participation with withheld records (see `resourceType` and `localResourceId` parameters).\nIf an API consumer attempts to POST a record for a patient that has not opted in, the API will return an OperationOutcome with an error message indicating that the patient has not indicated their participation preferences." ] ;
    fhir:type [ fhir:v "boolean" ]
      ] [
    fhir:name [ fhir:v "resourceType" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:documentation [ fhir:v "The resource type that is being withheld. Must be a valid FHIR resource type supported by the SDHR service, such as `Condition`, `Observation` etc. Note that `AllergyIntolerance` resources MUST NOT be withheld.\n    This parameter is optional and should only be used to specify the type of resource that is withheld from the Shared Digital Health Record service.\n    When this paramter is used the request MUST contain a `reasonCode` parameter and a `localResourceId` parameter." ] ;
    fhir:type [ fhir:v "string" ]
      ] [
    fhir:name [ fhir:v "facilityId" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 1 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:documentation [ fhir:v "The HPI Facility ID of the healthcare provider that is withholding the resource.\n    This parameter is mandatory and must be provided to indicate the healthcare provider that is withholding the resource from the Shared Digital Health Record service.\n    The HPI Facility ID must be a valid HPI Facility ID in the format `https://api.hip.digital.health.nz/fhir/hpi/v1/Location/{hpi-facility-id}`." ] ;
    fhir:type [ fhir:v "Reference" ]
      ] [
    fhir:name [ fhir:v "localResourceId" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:documentation [ fhir:v "The local resource ID that is withheld from the Shared Digital Health Record service.\n    This parameter is optional and should only be used to specify the local ID of the resource that is withheld.\n    When this paramter is used the request MUST contain a `reasonCode` parameter and a `resourceType` parameter." ] ;
    fhir:type [ fhir:v "string" ]
      ] [
    fhir:name [ fhir:v "reasonCode" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:documentation [ fhir:v "The reason code for participation. This **MUST** be provided when the intent is to indicate a withheld record or when releasing a record.\nValid codes include:\n- `sdhr-record-withheld`: Records withheld from the patient for privacy or confidentiality reasons.\n- `sdhr-record-released`: Record that was previously withheld has been released (is no longer confidential or restricted) to the service by the patient." ] ;
    fhir:type [ fhir:v "Coding" ] ;
    fhir:binding [
    fhir:strength [ fhir:v "required" ] ;
    fhir:valueSet [
    fhir:v "https://fhir-ig.digital.health.nz/sdhr/ValueSet/sdhr-participation-reason-valueset"^^xsd:anyURI ;
    fhir:l <https://fhir-ig.digital.health.nz/sdhr/ValueSet/sdhr-participation-reason-valueset>       ]     ]
      ] [
    fhir:name [ fhir:v "return" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 1 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:documentation [ fhir:v "The result of the operation. \nThis parameter will contain an OperationOutcome resource indicating the success or failure of the operation.\nIf the operation is successful, the OperationOutcome will contain a success message.\nIf the operation fails, the OperationOutcome will contain an error message indicating the reason for the failure.\nThe OperationOutcome resource will be returned in the response body of the operation request.\nSee the following examples for possible OperationOutcome responses:\n- [OperationOutcome for invalid patient reference](./OperationOutcome-OperationOutcomeParticipateInvalidPatient.html)\n- [OperationOutcome for missing reason code](./OperationOutcome-OperationOutcomeParticipateMissingReason.html)\n- [OperationOutcome for successful participation](./OperationOutcome-OperationOutcomeParticipateSuccess.html)\nNote that the following `OperationOutcome` would be returned when an API Consumer attempts to POST a record for a patient that has not provided their participation preferences:\n- [OperationOutcome for participation preferences not known](./OperationOutcome-OperationOutcomeParticipatePreferencesNotKnown.html)" ] ;
    fhir:type [ fhir:v "OperationOutcome" ]
      ] ) . #