<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="aorta-subscriptionNotification-bundle" />
  <language value="nl-NL" />
  <url value="http://vzvz.nl/fhir/StructureDefinition/aorta-subscriptionNotification-bundle" />
  <version value="2.0.0-beta.2" />
  <name value="NLVZVZAortaSubscriptionNotificationBundle" />
  <status value="active" />
  <publisher value="VZVZ" />
  <contact>
    <name value="VZVZ" />
    <telecom>
      <system value="email" />
      <value value="standaardisatie@vzvz.nl" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="A notification bundle is a collection of a notification (SubscriptionStatus) and &#xA;the resource instance that triggered the notification.&#xA;Since the resource instance that triggered the notification is always an AORTA DataReference resource,&#xA;which contains no medical information, there is no privacy issue when the resource is included in&#xA;the notification." />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="NL" />
      <display value="Netherlands" />
    </coding>
  </jurisdiction>
  <copyright value="VZVZ" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle">
      <path value="Bundle" />
      <constraint>
        <key value="sn-1" />
        <severity value="error" />
        <human value="A notication bundle should have at least 1 entry" />
        <expression value="Bundle.entry.count() &gt;= 1" />
        <source value="http://vzvz.nl/fhir/StructureDefinition/aorta-subscriptionNotification-bundle" />
      </constraint>
      <constraint>
        <key value="sn-2" />
        <severity value="error" />
        <human value="A notification bundle should have at least a SubscriptionStatus as backported Parameters" />
        <expression value="Bundle.entry.resource.ofType(Parameters).exists()" />
        <source value="http://vzvz.nl/fhir/StructureDefinition/aorta-subscriptionNotification-bundle" />
      </constraint>
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <definition value="A notification bundle is a collection of a notification (SubscriptionStatus) and the resource instance that triggered the notification." />
      <comment value="Although FHIR R4B proposes to use the type `history` we at VZVZ believe that `collection` better fits the meaning of this bundle and it removes the necessity to add fake request elements in each entry, which makes generation and parsing easier." />
      <fixedCode value="collection" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="resource" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <comment value="__NOTE__: if this bundle is used to notify about the expiration of a Subscription, then it contains only a SubscriptionStatus Resource, nothing else." />
      <min value="1" />
    </element>
    <element id="Bundle.entry:subscriptionStatus">
      <path value="Bundle.entry" />
      <sliceName value="subscriptionStatus" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:subscriptionStatus.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Parameters" />
        <profile value="http://vzvz.nl/fhir/StructureDefinition/aorta-subscription-notification" />
      </type>
    </element>
    <element id="Bundle.entry:dataReference">
      <path value="Bundle.entry" />
      <sliceName value="dataReference" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:dataReference.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="List" />
        <profile value="http://vzvz.nl/fhir/StructureDefinition/aorta-DataReference" />
      </type>
    </element>
    <element id="Bundle.entry:auditevent">
      <path value="Bundle.entry" />
      <sliceName value="auditevent" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:auditevent.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="AuditEvent" />
        <profile value="http://vzvz.nl/fhir/StructureDefinition/aorta-AuditEvent" />
      </type>
    </element>
  </differential>
</StructureDefinition>