<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="gecco-bundle-codex" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-category">
    <valueString value="Foundation.Other" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category">
    <valueCode value="not-classified" />
  </extension>
  <url value="https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/gecco-bundle-codex" />
  <version value="1.0.6" />
  <name value="GeccoBundleCodex" />
  <title value="GECCO Bundle NUM-CODEX" />
  <status value="active" />
  <experimental value="false" />
  <date value="2021-09-21" />
  <publisher value="Berlin Institute of Health at Charité (BIH)" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="https://www.bihealth.org/en/research/core-facilities/interoperability/" />
    </telecom>
  </contact>
  <description value="Bundle of type 'batch' used to collect the set of resources as part of the GECCO dataset into a single instance for the NUM-CODEX use case and requires that a Consent resource must always be included." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="cda" />
    <uri value="http://hl7.org/v3/cda" />
    <name value="CDA (R2)" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </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">
      <path value="Bundle" />
      <constraint>
        <key value="consent-num-codex-bundle" />
        <severity value="error" />
        <human value="NUM-CODEX bundle shall contain a Consent resource that is a Privacy policy acknowledgement Document (code=57016-8)." />
        <expression value="Bundle.entry.where(resource.is(Consent)).select(resource.category.coding.where(code='57016-8')).count() &gt; 0" />
        <source value="https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/gecco-bundle-codex" />
      </constraint>
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <fixedCode value="batch" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.timestamp">
      <path value="Bundle.timestamp" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="resource" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Consent">
      <path value="Bundle.entry" />
      <sliceName value="Consent" />
      <min value="1" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Consent.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Consent" />
        <profile value="http://fhir.de/ConsentManagement/StructureDefinition/Consent" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>