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

<Provenance xmlns="http://hl7.org/fhir">
  <meta>
    <source value="https://standards.digital.health.nz/ns/hpi-facility-id/F04066-D"/>
    <profile value="https://fhir-ig.digital.health.nz/shared-care/StructureDefinition/OutpatientProvenance"/>
    <tag>
      <system value="https://hub.services.digital.health.nz/ns/correlation-id"/>
      <code value="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"/>
    </tag>
  </meta>
  <text>
    <status value="generated"/><div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: Provenance DHOProvenanceNhiMergeExample</b></p><a name="DHOProvenanceNhiMergeExample"> </a><a name="hcDHOProvenanceNhiMergeExample"> </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">Information Source: <a href="https://standards.digital.health.nz/ns/hpi-facility-id/F04066-D">https://standards.digital.health.nz/ns/hpi-facility-id/F04066-D</a></p><p style="margin-bottom: 0px">Profile: <a href="StructureDefinition-OutpatientProvenance.html">DHO Provenance Profile</a></p><p style="margin-bottom: 0px">Tag: </p></div><p>Provenance for <a href="Encounter-dho-outpatient-encounter-instance.html">Encounter: status = arrived; class = Ambulatory (ActCode#AMB); serviceType = Outpatients; period = 2025-09-03 02:30:35+0000 --&gt; (ongoing)</a></p><p>Summary</p><table class="grid"><tr><td>Recorded</td><td>2026-06-25 16:55:00+0000</td></tr><tr><td>Activity</td><td><span title="Codes:{http://terminology.hl7.org/CodeSystem/v3-DataOperation UPDATE}">revise</span></td></tr></table><p><b>Agents</b></p><table class="grid"><tr><td><b>Type</b></td><td><b>who</b></td></tr><tr><td><span title="Codes:{http://terminology.hl7.org/CodeSystem/provenance-participant-type transmitter}">transmitter</span></td><td>Dunedin Hospital (Identifier: <a href="http://fhir.org.nz/ig/base/NamingSystem-hpiFacility.html" title="HPI facilities">HPIFacility</a>/F04066-D)</td></tr></table></div>
  </text>
  <target>
    <reference value="Encounter/dho-outpatient-encounter-instance"/>
  </target>
  <recorded value="2026-06-25T16:55:00Z"/>
  <reason>
    <coding>
      <system value="https://fhir-ig.digital.health.nz/shared-care/CodeSystem/provenance-reason-type-cs"/>
      <code value="nhi-merge"/>
      <display value="NHI Merge"/>
    </coding>
  </reason>
  <activity>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/v3-DataOperation"/>
      <code value="UPDATE"/>
      <display value="revise"/>
    </coding>
  </activity>
  <agent>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/provenance-participant-type"/>
        <code value="transmitter"/>
      </coding>
    </type>
    <who>
      <identifier>
        <system value="https://standards.digital.health.nz/ns/hpi-facility-id"/>
        <value value="F04066-D"/>
      </identifier>
      <display value="Dunedin Hospital"/>
    </who>
  </agent>
  <entity>
    <role value="removal"/>
    <what>
      <type value="Patient"/>
      <identifier>
        <use value="official"/>
        <system value="https://standards.digital.health.nz/ns/nhi-id"/>
        <value value="ZAC7823"/>
      </identifier>
      <display value="John Smith"/>
    </what>
  </entity>
  <entity>
    <role value="derivation"/>
    <what>
      <type value="Patient"/>
      <identifier>
        <use value="official"/>
        <system value="https://standards.digital.health.nz/ns/nhi-id"/>
        <value value="XYZ6789"/>
      </identifier>
      <display value="John Smith"/>
    </what>
  </entity>
</Provenance>