<?xml version="1.0" encoding="UTF-8"?>

<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="SDHRParticipationStatusOperation"/>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: OperationDefinition SDHRParticipationStatusOperation</b></p><a name="SDHRParticipationStatusOperation"> </a><a name="hcSDHRParticipationStatusOperation"> </a><p>URL: [base]/$participation-status</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>
</div></td></tr><tr><td>OUT</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>The patient reference resolved for the participation status lookup.</p>
</div></td></tr><tr><td>OUT</td><td>consentFound</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 whether a consent record was found for the patient in the Shared Digital Health Record service.</p>
</div></td></tr><tr><td>OUT</td><td>hnzParticipationIndicator</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 whether the patient is currently participating in the Shared Digital Health Record service.</p>
</div></td></tr><tr><td>OUT</td><td>hasActiveRecords</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 whether the patient has active records available in the service.</p>
</div></td></tr><tr><td>OUT</td><td>hasArchivedRecords</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 whether the patient has archived records in the service.</p>
</div></td></tr><tr><td>OUT</td><td>hasAnyRecords</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 whether the patient has any records, active or archived, in the service.</p>
</div></td></tr><tr><td>OUT</td><td>enrolmentInformationFound</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 whether enrolment information was found for the patient.</p>
</div></td></tr><tr><td>OUT</td><td>enrolmentOrgId</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 enrolment organisation identifier, when enrolment information is available for the patient.</p>
</div></td></tr><tr><td>OUT</td><td>enrolmentFacilityId</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 enrolment facility identifier, when enrolment information is available for the patient.</p>
</div></td></tr><tr><td>OUT</td><td>enrolmentNHI</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 enrolment NHI value, when enrolment information is available for the patient.</p>
</div></td></tr><tr><td>OUT</td><td>enrolmentFacilityParticipation</td><td/><td>0..*</td><td/><td/><td><div><p>The facility-level participation status for facilities associated with the patient's enrolment. Only present when enrolment information is found.</p>
</div></td></tr><tr><td>OUT</td><td>enrolmentFacilityParticipation.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 Location reference for the enrolled facility.</p>
</div></td></tr><tr><td>OUT</td><td>enrolmentFacilityParticipation.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>Whether the patient is participating at this enrolled facility.</p>
</div></td></tr><tr><td>OUT</td><td>facilityParticipation</td><td/><td>0..*</td><td/><td/><td><div><p>The facility-level participation status for all facilities where the patient has an explicit participation record.</p>
</div></td></tr><tr><td>OUT</td><td>facilityParticipation.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 Location reference for the facility.</p>
</div></td></tr><tr><td>OUT</td><td>facilityParticipation.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>Whether the patient is participating at this facility.</p>
</div></td></tr></table></div>
  </text>
  <url value="https://fhir-ig.digital.health.nz/sdhr/OperationDefinition/SDHRParticipationStatusOperation"/>
  <version value="1.0.2"/>
  <name value="ParticipationStatus"/>
  <status value="active"/>
  <kind value="operation"/>
  <date value="2026-06-30T04:46:48+00:00"/>
  <publisher value="Health New Zealand"/>
  <contact>
    <name value="Health New Zealand"/>
    <telecom>
      <system value="url"/>
      <value value="https://github.com/tewhatuora"/>
    </telecom>
  </contact>
  <contact>
    <name value="HNZ Integration Team"/>
    <telecom>
      <system value="email"/>
      <value value="integration@tewhatuora.govt.nz"/>
      <use value="work"/>
    </telecom>
  </contact>
  <description value="This operation retrieves a patient's Shared Digital Health Record participation status.&#xA;This 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.&#xA;It returns whether the patient is participating in the service, whether enrolment information was found, and whether the patient has active, archived, or any records available in the service. The scope of the status returned is the API consumer, for example an HPI Facility where patient data is held.&#xA;&#xA;For an example response payload for this operation see:&#xA;- [Parameters resource for participation status response - not participating](./Parameters-ParametersParticipationStatusResponse.html) : No consent, enrolment, or records found for the patient.&#xA;- [Parameters resource for participation status response - enrolment found, not participating](./Parameters-ParametersParticipationStatusEnrolmentResponse.html) : Enrolment information is found but the patient is not currently participating.&#xA;- [Parameters resource for participation status response - actively participating](./Parameters-ParametersParticipationStatusActiveResponse.html) : Patient is actively participating with active records at a facility.&#xA;- [Parameters resource for participation status response - actively participating with enrolment](./Parameters-ParametersParticipationStatusEnrolmentActiveResponse.html) : Patient is actively participating with enrolment information and facility-level participation details.&#xA;&#xA;To 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/$participation-status`).&#xA;&#xA;The operation is idempotent, meaning that multiple requests with the same parameters will have the same effect as a single request.&#xA;The operation is expected to be called by a healthcare provider on behalf of the patient, and the patient must be identified by their NHI.&#xA;The operation will return a `Parameters` resource containing the patient reference and participation status indicators."/>
  <code value="participation-status"/>
  <system value="true"/>
  <type value="false"/>
  <instance value="false"/>
  <parameter>
    <name value="patient"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Reference must be an NHI Patient URL with format https://api.hip.digital.health.nz/fhir/nhi/v1/Patient/ZZZ1111 or ZZZ11AA"/>
    <type value="Reference"/>
  </parameter>
  <parameter>
    <name value="patient"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="The patient reference resolved for the participation status lookup."/>
    <type value="Reference"/>
  </parameter>
  <parameter>
    <name value="consentFound"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Indicates whether a consent record was found for the patient in the Shared Digital Health Record service."/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="hnzParticipationIndicator"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Indicates whether the patient is currently participating in the Shared Digital Health Record service."/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="hasActiveRecords"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Indicates whether the patient has active records available in the service."/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="hasArchivedRecords"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Indicates whether the patient has archived records in the service."/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="hasAnyRecords"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Indicates whether the patient has any records, active or archived, in the service."/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="enrolmentInformationFound"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation value="Indicates whether enrolment information was found for the patient."/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="enrolmentOrgId"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="The enrolment organisation identifier, when enrolment information is available for the patient."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="enrolmentFacilityId"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="The enrolment facility identifier, when enrolment information is available for the patient."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="enrolmentNHI"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <documentation value="The enrolment NHI value, when enrolment information is available for the patient."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="enrolmentFacilityParticipation"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="The facility-level participation status for facilities associated with the patient's enrolment. Only present when enrolment information is found."/>
    <part>
      <name value="facilityId"/>
      <use value="out"/>
      <min value="1"/>
      <max value="1"/>
      <documentation value="The HPI Location reference for the enrolled facility."/>
      <type value="Reference"/>
    </part>
    <part>
      <name value="participationIndicator"/>
      <use value="out"/>
      <min value="1"/>
      <max value="1"/>
      <documentation value="Whether the patient is participating at this enrolled facility."/>
      <type value="boolean"/>
    </part>
  </parameter>
  <parameter>
    <name value="facilityParticipation"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <documentation value="The facility-level participation status for all facilities where the patient has an explicit participation record."/>
    <part>
      <name value="facilityId"/>
      <use value="out"/>
      <min value="1"/>
      <max value="1"/>
      <documentation value="The HPI Location reference for the facility."/>
      <type value="Reference"/>
    </part>
    <part>
      <name value="participationIndicator"/>
      <use value="out"/>
      <min value="1"/>
      <max value="1"/>
      <documentation value="Whether the patient is participating at this facility."/>
      <type value="boolean"/>
    </part>
  </parameter>
</OperationDefinition>