<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="bundle-ca-ps" />
  <url value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/bundle-ca-ps" />
  <name value="BundlePSCA" />
  <title value="Bundle (PS-CA)" />
  <status value="draft" />
  <experimental value="false" />
  <date value="2022-01-17T01:23:00-08:00" />
  <description value="This profile represents the constraints applied to the Bundle resource by the PS-CA project." />
  <copyright value="Copyright © 2021,2022 Canada Health Infoway. All rights reserved. [Terms of Use and License Agreements](https://ic.infoway-inforoute.ca/en/about/tou). [Privacy Policy](https://www.infoway-inforoute.ca/en/legal/privacy-policy)." />
  <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" />
      <short value="PS-CA Bundle" />
      <definition value="PS-CA Bundle. &#xD;&#xA;A container for a collection of resources in the patient summary." />
      <constraint>
        <key value="bdl-ps-1" />
        <severity value="error" />
        <human value="A PS document must have no additional Composition (including Composition subclass) resources besides the first" />
        <expression value="entry.tail().where(resource is Composition).empty()" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.identifier">
      <path value="Bundle.identifier" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <fixedCode value="document" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.timestamp">
      <path value="Bundle.timestamp" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.link">
      <path value="Bundle.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="profile" />
          <path value="resource" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="Entry resource in the patient summary bundle" />
      <definition value="An entry resource included in the patient summary bundle resource." />
      <comment value="Must contain at a minimum the PS-CA Composition as the first entry (only a single Composition resource may be included). Additional constraints that determine what is included in the bundle are specified in the PS-CA Composition profile." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <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" />
      <max value="0" />
    </element>
    <element id="Bundle.entry.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:composition">
      <path value="Bundle.entry" />
      <sliceName value="composition" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:composition.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Composition" />
        <profile value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/composition-ca-ps" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>