<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="recare-bundle" />
  <url value="http://fhir.recaresolutions.com/StructureDefinition/recare-bundle" />
  <version value="0.1.0" />
  <name value="RecareBundle" />
  <title value="Recare Bundle" />
  <status value="active" />
  <experimental value="false" />
  <publisher value="Recare Deutschland GmbH" />
  <description value="Common constraints shared by Recare event bundles emitted by matching external integrations." />
  <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.identifier">
      <path value="Bundle.identifier" />
      <min value="1" />
    </element>
    <element id="Bundle.identifier.system">
      <path value="Bundle.identifier.system" />
      <min value="1" />
      <fixedUri value="http://fhir.recaresolutions.com/CodeSystem/event_type" />
    </element>
    <element id="Bundle.identifier.value">
      <path value="Bundle.identifier.value" />
      <min value="1" />
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <patternCode value="collection" />
    </element>
    <element id="Bundle.timestamp">
      <path value="Bundle.timestamp" />
      <min value="1" />
    </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" />
    </element>
    <element id="Bundle.entry.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
    </element>
    <element id="Bundle.entry:serviceRequest">
      <path value="Bundle.entry" />
      <sliceName value="serviceRequest" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:serviceRequest.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="ServiceRequest" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-search" />
      </type>
    </element>
    <element id="Bundle.entry:patient">
      <path value="Bundle.entry" />
      <sliceName value="patient" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:patient.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Patient" />
      </type>
    </element>
    <element id="Bundle.entry:encounter">
      <path value="Bundle.entry" />
      <sliceName value="encounter" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:encounter.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Encounter" />
      </type>
    </element>
    <element id="Bundle.entry:organization">
      <path value="Bundle.entry" />
      <sliceName value="organization" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:organization.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Organization" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-careseeker" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-careprovider" />
      </type>
    </element>
    <element id="Bundle.entry:coverage">
      <path value="Bundle.entry" />
      <sliceName value="coverage" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:coverage.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Coverage" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-statutory-health-insurance" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-private-health-insurance" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-pension-insurance" />
      </type>
    </element>
    <element id="Bundle.entry:condition">
      <path value="Bundle.entry" />
      <sliceName value="condition" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:condition.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Condition" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-diagnosis" />
      </type>
    </element>
    <element id="Bundle.entry:observation">
      <path value="Bundle.entry" />
      <sliceName value="observation" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:observation.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Observation" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-weight" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-height" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-care-level" />
      </type>
    </element>
    <element id="Bundle.entry:immunization">
      <path value="Bundle.entry" />
      <sliceName value="immunization" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:immunization.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Immunization" />
      </type>
    </element>
    <element id="Bundle.entry:practitioner">
      <path value="Bundle.entry" />
      <sliceName value="practitioner" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:practitioner.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Practitioner" />
      </type>
    </element>
    <element id="Bundle.entry:documentReference">
      <path value="Bundle.entry" />
      <sliceName value="documentReference" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:documentReference.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="DocumentReference" />
        <profile value="http://fhir.recaresolutions.com/StructureDefinition/recare-document" />
      </type>
    </element>
    <element id="Bundle.entry:task">
      <path value="Bundle.entry" />
      <sliceName value="task" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:task.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Task" />
      </type>
    </element>
    <element id="Bundle.entry:binary">
      <path value="Bundle.entry" />
      <sliceName value="binary" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Bundle.entry:binary.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Binary" />
      </type>
    </element>
  </differential>
</StructureDefinition>