<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="gap-bundle-profile" />
  <url value="http://akinox.com/fhir/StructureDefinition/gap-bundle-profile" />
  <version value="1.0.0" />
  <name value="GapBundle" />
  <title value="GAP Bundle Profile" />
  <status value="draft" />
  <description value="Bundle profile for GAP transaction submissions." />
  <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.type">
      <path value="Bundle.type" />
      <min value="1" />
      <fixedCode value="transaction" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="resource" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Bundle.entry:patient">
      <path value="Bundle.entry" />
      <sliceName value="patient" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Bundle.entry:patient.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Patient" />
        <profile value="http://akinox.com/fhir/StructureDefinition/gap-patient-profile" />
      </type>
    </element>
    <element id="Bundle.entry:task">
      <path value="Bundle.entry" />
      <sliceName value="task" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Bundle.entry:task.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Task" />
        <profile value="http://akinox.com/fhir/StructureDefinition/gap-task-profile" />
      </type>
    </element>
    <element id="Bundle.entry:relatedPerson">
      <path value="Bundle.entry" />
      <sliceName value="relatedPerson" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:relatedPerson.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="RelatedPerson" />
        <profile value="http://akinox.com/fhir/StructureDefinition/gap-related-person-profile" />
      </type>
    </element>
    <element id="Bundle.entry:provenance">
      <path value="Bundle.entry" />
      <sliceName value="provenance" />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Bundle.entry:provenance.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Provenance" />
        <profile value="http://akinox.com/fhir/StructureDefinition/gap-provenance-profile" />
      </type>
    </element>
  </differential>
</StructureDefinition>