{
  "resourceType": "StructureDefinition",
  "id": "recare-bundle",
  "url": "http://fhir.recaresolutions.com/StructureDefinition/recare-bundle",
  "version": "0.1.0",
  "name": "RecareBundle",
  "title": "Recare Bundle",
  "status": "active",
  "experimental": false,
  "publisher": "Recare Deutschland GmbH",
  "description": "Common constraints shared by Recare event bundles emitted by matching external integrations.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Bundle",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle.identifier",
        "path": "Bundle.identifier",
        "min": 1
      },
      {
        "id": "Bundle.identifier.system",
        "path": "Bundle.identifier.system",
        "min": 1,
        "fixedUri": "http://fhir.recaresolutions.com/CodeSystem/event_type"
      },
      {
        "id": "Bundle.identifier.value",
        "path": "Bundle.identifier.value",
        "min": 1
      },
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "patternCode": "collection"
      },
      {
        "id": "Bundle.timestamp",
        "path": "Bundle.timestamp",
        "min": 1
      },
      {
        "id": "Bundle.entry",
        "path": "Bundle.entry",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "resource"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Bundle.entry.resource",
        "path": "Bundle.entry.resource",
        "min": 1
      },
      {
        "id": "Bundle.entry:serviceRequest",
        "path": "Bundle.entry",
        "sliceName": "serviceRequest",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:serviceRequest.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "ServiceRequest",
            "profile": [
              "http://fhir.recaresolutions.com/StructureDefinition/recare-search"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:patient",
        "path": "Bundle.entry",
        "sliceName": "patient",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:patient.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Patient"
          }
        ]
      },
      {
        "id": "Bundle.entry:encounter",
        "path": "Bundle.entry",
        "sliceName": "encounter",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:encounter.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Encounter"
          }
        ]
      },
      {
        "id": "Bundle.entry:organization",
        "path": "Bundle.entry",
        "sliceName": "organization",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:organization.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Organization",
            "profile": [
              "http://fhir.recaresolutions.com/StructureDefinition/recare-careseeker",
              "http://fhir.recaresolutions.com/StructureDefinition/recare-careprovider"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:coverage",
        "path": "Bundle.entry",
        "sliceName": "coverage",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:coverage.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Coverage",
            "profile": [
              "http://fhir.recaresolutions.com/StructureDefinition/recare-statutory-health-insurance",
              "http://fhir.recaresolutions.com/StructureDefinition/recare-private-health-insurance",
              "http://fhir.recaresolutions.com/StructureDefinition/recare-pension-insurance"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:condition",
        "path": "Bundle.entry",
        "sliceName": "condition",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:condition.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Condition",
            "profile": [
              "http://fhir.recaresolutions.com/StructureDefinition/recare-diagnosis"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:observation",
        "path": "Bundle.entry",
        "sliceName": "observation",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:observation.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Observation",
            "profile": [
              "http://fhir.recaresolutions.com/StructureDefinition/recare-weight",
              "http://fhir.recaresolutions.com/StructureDefinition/recare-height",
              "http://fhir.recaresolutions.com/StructureDefinition/recare-care-level"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:immunization",
        "path": "Bundle.entry",
        "sliceName": "immunization",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:immunization.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Immunization"
          }
        ]
      },
      {
        "id": "Bundle.entry:practitioner",
        "path": "Bundle.entry",
        "sliceName": "practitioner",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:practitioner.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Practitioner"
          }
        ]
      },
      {
        "id": "Bundle.entry:documentReference",
        "path": "Bundle.entry",
        "sliceName": "documentReference",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:documentReference.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "DocumentReference",
            "profile": [
              "http://fhir.recaresolutions.com/StructureDefinition/recare-document"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:task",
        "path": "Bundle.entry",
        "sliceName": "task",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:task.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Task"
          }
        ]
      },
      {
        "id": "Bundle.entry:binary",
        "path": "Bundle.entry",
        "sliceName": "binary",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:binary.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Binary"
          }
        ]
      }
    ]
  }
}