<Bundle xmlns="http://hl7.org/fhir">
  <id value="example-digidot-transaction-conditional-create" />
  <meta>
    <profile value="https://novari.no/fhir/digidot/StructureDefinition/digidot-TransactionBundle-no|0.2.0" />
    <tag>
      <display value="Draft alternative to linked creation: each POST uses a stable source identifier. One match reuses the existing record without updating it; multiple matches fail. The identifier policy and resource workflows must be supported by DENT." />
    </tag>
  </meta>
  <type value="transaction" />
  <entry>
    <fullUrl value="urn:uuid:11111111-1111-4111-8111-111111111111" />
    <resource>
      <Encounter>
        <meta>
          <profile value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Encounter-no|0.6.10" />
        </meta>
        <text>
          <status value="generated" />
          <div xmlns="http://www.w3.org/1999/xhtml">
            <p>Synthetic completed dental contact, 19 November 2026, 09:00 to 09:40.</p>
          </div>
        </text>
        <identifier>
          <system value="https://ehr.example.org/identifiers/Encounter" />
          <value value="bundle-example-encounter-001" />
        </identifier>
        <status value="finished" />
        <class>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
          <code value="AMB" />
        </class>
        <subject>
          <reference value="https://mpi.example.org/fhir/Patient/example-patient" />
          <type value="Patient" />
        </subject>
        <participant>
          <type>
            <coding>
              <system value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType" />
              <code value="PPRF" />
            </coding>
          </type>
          <individual>
            <reference value="https://dent.example.org/fhir/Practitioner/example-dentist" />
            <type value="Practitioner" />
          </individual>
        </participant>
        <period>
          <start value="2026-11-19T09:00:00+01:00" />
          <end value="2026-11-19T09:40:00+01:00" />
        </period>
        <location>
          <location>
            <reference value="https://dent.example.org/fhir/Location/example-clinic" />
          </location>
        </location>
        <serviceProvider>
          <reference value="https://dent.example.org/fhir/Organization/example-county" />
        </serviceProvider>
      </Encounter>
    </resource>
    <request>
      <method value="POST" />
      <url value="Encounter" />
      <ifNoneExist value="identifier=https://ehr.example.org/identifiers/Encounter|bundle-example-encounter-001" />
    </request>
  </entry>
  <entry>
    <fullUrl value="urn:uuid:22222222-2222-4222-8222-222222222222" />
    <resource>
      <Condition>
        <meta>
          <profile value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Condition-no|0.7.0" />
        </meta>
        <text>
          <status value="generated" />
          <div xmlns="http://www.w3.org/1999/xhtml">
            <p>Synthetic dental caries finding treated and recorded as resolved during the linked contact. This example focuses on transaction references.</p>
          </div>
        </text>
        <identifier>
          <system value="https://ehr.example.org/identifiers/Condition" />
          <value value="bundle-example-condition-001" />
        </identifier>
        <clinicalStatus>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/condition-clinical" />
            <code value="resolved" />
          </coding>
        </clinicalStatus>
        <verificationStatus>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/condition-ver-status" />
            <code value="confirmed" />
          </coding>
        </verificationStatus>
        <category>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/condition-category" />
            <code value="encounter-diagnosis" />
          </coding>
        </category>
        <code>
          <coding id="SCTextended">
            <system value="http://snomed.info/sct" />
            <version value="http://snomed.info/sct/51000202101/version/20260715" />
            <code value="80967001" />
            <display value="Dental caries" />
          </coding>
        </code>
        <subject>
          <reference value="https://mpi.example.org/fhir/Patient/example-patient" />
          <type value="Patient" />
        </subject>
        <encounter>
          <reference value="urn:uuid:11111111-1111-4111-8111-111111111111" />
          <type value="Encounter" />
        </encounter>
        <onsetDateTime value="2026-11-19" />
        <abatementDateTime value="2026-11-19" />
        <recorder>
          <reference value="https://dent.example.org/fhir/Practitioner/example-dentist" />
          <type value="Practitioner" />
        </recorder>
      </Condition>
    </resource>
    <request>
      <method value="POST" />
      <url value="Condition" />
      <ifNoneExist value="identifier=https://ehr.example.org/identifiers/Condition|bundle-example-condition-001" />
    </request>
  </entry>
  <entry>
    <fullUrl value="urn:uuid:33333333-3333-4333-8333-333333333333" />
    <resource>
      <Procedure>
        <meta>
          <profile value="https://novari.no/fhir/digidot/StructureDefinition/digidot-Procedure-no|0.6.13" />
        </meta>
        <text>
          <status value="generated" />
          <div xmlns="http://www.w3.org/1999/xhtml">
            <p>Synthetic composite restoration linked to its contact and caries finding. This example focuses on transaction references.</p>
          </div>
        </text>
        <identifier>
          <system value="https://ehr.example.org/identifiers/Procedure" />
          <value value="bundle-example-procedure-001" />
        </identifier>
        <status value="completed" />
        <category>
          <coding>
            <system value="https://novari.no/fhir/digidot/CodeSystem/digidot-procedure-category" />
            <code value="dental-procedure" />
          </coding>
        </category>
        <code>
          <coding id="SCTextended">
            <system value="http://snomed.info/sct" />
            <version value="http://snomed.info/sct/51000202101/version/20260715" />
            <code value="234789004" />
            <display value="Dental restoration using composite material" />
          </coding>
        </code>
        <subject>
          <reference value="https://mpi.example.org/fhir/Patient/example-patient" />
          <type value="Patient" />
        </subject>
        <encounter>
          <reference value="urn:uuid:11111111-1111-4111-8111-111111111111" />
          <type value="Encounter" />
        </encounter>
        <performedDateTime value="2026-11-19T09:20:00+01:00" />
        <performer>
          <actor>
            <reference value="https://dent.example.org/fhir/Practitioner/example-dentist" />
            <type value="Practitioner" />
          </actor>
        </performer>
        <reasonReference>
          <reference value="urn:uuid:22222222-2222-4222-8222-222222222222" />
          <type value="Condition" />
        </reasonReference>
      </Procedure>
    </resource>
    <request>
      <method value="POST" />
      <url value="Procedure" />
      <ifNoneExist value="identifier=https://ehr.example.org/identifiers/Procedure|bundle-example-procedure-001" />
    </request>
  </entry>
</Bundle>