{
  "resourceType": "StructureDefinition",
  "id": "KBV-PR-AW-Bundle-Termin",
  "url": "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Bundle_Termin",
  "version": "1.3.0",
  "name": "KBV_PR_AW_Bundle_Termin",
  "status": "draft",
  "copyright": "Copyright © [2022], Kassenärztliche Bundesvereinigung (KBV). All rights reserved.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "cda",
      "uri": "http://hl7.org/v3/cda",
      "name": "CDA (R2)"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Bundle",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle",
        "path": "Bundle",
        "short": "Bundle_Patientenakte",
        "definition": "Das Bundle fasst alle Inhalte des Terminkalenders zusammen. In dem Element entry wurde nur die erste Ebene der Ressourcen angegeben, d.h. es wurden nur die Ressourcen explizit aufgeführt, die auf andere Ressourcen verweisen und auf die, im Sinne dieses Bundles, selbst nicht referenziert werden. Alle Ressourcen, die von Diesen und ihren Kindern referenziert werden, müssen ebenfalls integriert werden. Folgende Profile sind erlaubt:     https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Termin|1.3.0  https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Behandelnder|1.3.0  https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_BehandelnderFunktion|1.3.0  https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Patient|1.3.0  https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Betriebsstaette|1.3.0  https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Betriebsstaette_Ort|1.3.0  https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Organisation|1.3.0  https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Provenienz|1.3.0  https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Mitarbeiter|1.3.0",
        "constraint": [
          {
            "key": "Allowed2",
            "severity": "error",
            "human": "Ressourcen, die nicht mit https://fhir.kbv.de/StructureDefinition/KBV_PR_AW oder https://fhir.kbv.de/StructureDefinition/KBV_PR_Base beginnen dürfen nicht vorhanden sein",
            "expression": "entry.where((resource.meta.profile.startsWith('https://fhir.kbv.de/StructureDefinition/KBV_PR_AW') or resource.meta.profile.startsWith('https://fhir.kbv.de/StructureDefinition/KBV_PR_Base')).not()).count()=0"
          }
        ]
      },
      {
        "id": "Bundle.id",
        "path": "Bundle.id",
        "min": 1
      },
      {
        "id": "Bundle.meta",
        "path": "Bundle.meta",
        "min": 1
      },
      {
        "id": "Bundle.meta.versionId",
        "path": "Bundle.meta.versionId",
        "min": 1
      },
      {
        "id": "Bundle.meta.lastUpdated",
        "path": "Bundle.meta.lastUpdated",
        "min": 1
      },
      {
        "id": "Bundle.meta.profile",
        "path": "Bundle.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Bundle_Termin|1.3.0"
      },
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "short": "history",
        "definition": "Der Typ der Ressource wird als history-Bundle definiert.",
        "fixedCode": "history",
        "mustSupport": true
      },
      {
        "id": "Bundle.total",
        "path": "Bundle.total",
        "max": "0"
      },
      {
        "id": "Bundle.link",
        "path": "Bundle.link",
        "max": "0"
      },
      {
        "id": "Bundle.entry",
        "path": "Bundle.entry",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "resource"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.link",
        "path": "Bundle.entry.link",
        "contentReference": "http://hl7.org/fhir/StructureDefinition/Bundle#Bundle.link"
      },
      {
        "id": "Bundle.entry.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.resource",
        "path": "Bundle.entry.resource",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.request",
        "path": "Bundle.entry.request",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.request.method",
        "path": "Bundle.entry.request.method",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.request.url",
        "path": "Bundle.entry.request.url",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.response",
        "path": "Bundle.entry.response",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry.response.lastModified",
        "path": "Bundle.entry.response.lastModified",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Termin",
        "path": "Bundle.entry",
        "sliceName": "Termin",
        "min": 1
      },
      {
        "id": "Bundle.entry:Termin.link",
        "path": "Bundle.entry.link",
        "contentReference": "http://hl7.org/fhir/StructureDefinition/Bundle#Bundle.link"
      },
      {
        "id": "Bundle.entry:Termin.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Termin.resource",
        "path": "Bundle.entry.resource",
        "min": 1,
        "type": [
          {
            "code": "Resource",
            "profile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Termin|1.3.0"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Termin.request",
        "path": "Bundle.entry.request",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Termin.request.method",
        "path": "Bundle.entry.request.method",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Termin.request.url",
        "path": "Bundle.entry.request.url",
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Termin.response",
        "path": "Bundle.entry.response",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.entry:Termin.response.lastModified",
        "path": "Bundle.entry.response.lastModified",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Bundle.signature.who",
        "path": "Bundle.signature.who",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Mitarbeiter|1.3.0",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_BehandelnderFunktion|1.3.0"
            ]
          }
        ]
      },
      {
        "id": "Bundle.signature.who.reference",
        "path": "Bundle.signature.who.reference",
        "min": 1
      },
      {
        "id": "Bundle.signature.who.type",
        "path": "Bundle.signature.who.type",
        "max": "0"
      },
      {
        "id": "Bundle.signature.who.identifier",
        "path": "Bundle.signature.who.identifier",
        "max": "0"
      },
      {
        "id": "Bundle.signature.who.display",
        "path": "Bundle.signature.who.display",
        "max": "0"
      },
      {
        "id": "Bundle.signature.onBehalfOf",
        "path": "Bundle.signature.onBehalfOf",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_AW_Betriebsstaette|1.3.0"
            ]
          }
        ]
      },
      {
        "id": "Bundle.signature.sigFormat",
        "path": "Bundle.signature.sigFormat",
        "min": 1
      },
      {
        "id": "Bundle.signature.data",
        "path": "Bundle.signature.data",
        "min": 1
      }
    ]
  }
}