<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="CA-eReC-Bundle" />
  <url value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Bundle" />
  <name value="Bundle" />
  <status value="draft" />
  <description value="The bundle resource is used to package a collection of resources into a single instance. This resource would be used for referral in the following contexts: &#xD;&#xA;- Sending a set of resources as part of a message exchange&#xD;&#xA;- Grouping a self-contained set of resources to act as an exchangeable and persistable collection with clinical integrity - e.g. a clinical document" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/bundle-ca-ps" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle.identifier">
      <path value="Bundle.identifier" />
      <mustSupport value="false" />
    </element>
    <element id="Bundle.identifier.system">
      <path value="Bundle.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.identifier.value">
      <path value="Bundle.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <patternCode value="message" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.timestamp">
      <path value="Bundle.timestamp" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="profile" />
          <path value="resource" />
        </discriminator>
        <description value="The specific bundle entries that are needed for an eReC Message Bundle." />
        <rules value="open" />
      </slicing>
      <min value="2" />
      <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.resource">
      <path value="Bundle.entry.resource" />
      <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:Message">
      <path value="Bundle.entry" />
      <sliceName value="Message" />
      <short value="Entry in the bundle - will have a resource or information" />
      <definition value="An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Message.resource">
      <path value="Bundle.entry.resource" />
      <short value="A resource that describes a message that is exchanged between systems" />
      <definition value="The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle." />
      <type>
        <code value="Resource" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-MessageHeader" />
      </type>
    </element>
    <element id="Bundle.entry:Focus">
      <path value="Bundle.entry" />
      <sliceName value="Focus" />
      <short value="Entry in the bundle - will have a resource or information" />
      <definition value="An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Focus.resource">
      <path value="Bundle.entry.resource" />
      <short value="A resource that describes a message that is exchanged between systems" />
      <definition value="The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle." />
      <type>
        <code value="Resource" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ServiceRequest" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Task" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Appointment" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Communication" />
      </type>
    </element>
  </differential>
</StructureDefinition>