<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://electronichealth.se/fhir/StructureDefinition/NLLTransactionBundle" />
  <version value="1.0.0" />
  <name value="NLLTransactionBundle" />
  <status value="active" />
  <date value="2024-12-20" />
  <publisher value="Swedish eHealth Agency" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="EHM" />
    <name value="E-hälsomyndigheten concept" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle.identifier">
      <path value="Bundle.identifier" />
      <comment value="Persistent identity generally only matters for batches of type Document, Message, and Collection. It would not normally be populated for search and history results and servers ignore Bundle.identifier when processing batches and transactions. For Documents  the .identifier SHALL be populated such that the .identifier is globally unique." />
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <short value="transaction | transaction-response" />
      <definition value="The purpose of this bundle is to update all resources in one transaction." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/transaction-bundle-types" />
      </binding>
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <short value="URI for resource, UUID" />
      <definition value="The National Medication List uses fullUrl in the form of the urn:uuid of the resource.&#xD;&#xA;The fullUrl element SHALL have a value except that: &#xA;* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)&#xA;* Results from operations might involve resources that are not identified." />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.resource">
      <path value="Bundle.entry.resource" />
      <short value="A resource for the entry." />
      <definition value="The resource in the bundle, of one of the supported resource types." />
      <min value="1" />
      <type>
        <code value="Resource" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLMedicationDispense" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLDispensePaperPrescription" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispensingBasis" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispConsent" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLDataLock" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry.request">
      <path value="Bundle.entry.request" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.request.extension">
      <path value="Bundle.entry.request.extension" />
      <min value="1" />
    </element>
    <element id="Bundle.entry.request.extension:nLLProvenanceDetails">
      <path value="Bundle.entry.request.extension" />
      <sliceName value="nLLProvenanceDetails" />
      <short value="Provenance details for MedicationRequest" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLProvenanceDetails" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Bundle.entry.request.extension:nLLProvenanceDetails.extension:reason">
      <path value="Bundle.entry.request.extension.extension" />
      <sliceName value="reason" />
      <definition value="NB! Only used for MedicationRequest.&#xD;&#xA;The Provenance reason for the MedicationRequest." />
    </element>
    <element id="Bundle.entry.request.method">
      <path value="Bundle.entry.request.method" />
      <short value="POST | PUT" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/transaction-operations" />
      </binding>
    </element>
    <element id="Bundle.entry.request.url">
      <path value="Bundle.entry.request.url" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.response">
      <path value="Bundle.entry.response" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.response.status">
      <path value="Bundle.entry.response.status" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.response.location">
      <path value="Bundle.entry.response.location" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.response.outcome">
      <path value="Bundle.entry.response.outcome" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>