{
  "resourceType": "StructureDefinition",
  "url": "http://digen.nublar.de/fhir/StructureDefinition/StructureDefinition/DigenEncounter",
  "name": "DigenEncounter",
  "status": "draft",
  "description": "This profile is used for a DiGeN encounter as being imported by the KKIS system. An encounter can be an inpatient/outpatient stay in a hospital or rehabilitation care.",
  "fhirVersion": "3.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/w5",
      "name": "W5 Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Encounter",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Encounter",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Encounter.meta.id",
        "path": "Encounter.meta.id",
        "max": "0"
      },
      {
        "id": "Encounter.meta.security.id",
        "path": "Encounter.meta.security.id",
        "max": "0"
      },
      {
        "id": "Encounter.meta.security.userSelected",
        "path": "Encounter.meta.security.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.meta.tag",
        "path": "Encounter.meta.tag",
        "max": "0"
      },
      {
        "id": "Encounter.implicitRules",
        "path": "Encounter.implicitRules",
        "max": "0"
      },
      {
        "id": "Encounter.contained",
        "path": "Encounter.contained",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "short": "Über-/Einweisung für den Aufenthalt",
        "definition": "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. In DiGeN used for the requester of a rehabilation stay.",
        "max": "1",
        "type": [
          {
            "code": "ReferralRequest",
            "profile": "http://digen.nublar.de/fhir/StructureDefinition/DigenReferralRequest"
          }
        ]
      },
      {
        "id": "Encounter.contained.requester.agent.identifier",
        "path": "Encounter.contained.requester.agent.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.contained.requester.onBehalfOf.identifier",
        "path": "Encounter.contained.requester.onBehalfOf.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.contained:referralRequest",
        "path": "Encounter.contained",
        "sliceName": "referralRequest",
        "short": "Verordnung zur Reha",
        "max": "1",
        "type": [
          {
            "code": "ReferralRequest",
            "profile": "http://digen.nublar.de/fhir/StructureDefinition/DigenReferralRequest"
          }
        ]
      },
      {
        "id": "Encounter.contained:referralRequest.requester.agent.identifier",
        "path": "Encounter.contained.requester.agent.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.contained:referralRequest.requester.onBehalfOf.identifier",
        "path": "Encounter.contained.requester.onBehalfOf.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.identifier",
        "path": "Encounter.identifier",
        "short": "KKIS Schlüssel",
        "definition": "Identifier(s) by which this encounter is known. In DiGeN the identifier is built using the identifiers from the KKIS system.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.identifier.id",
        "path": "Encounter.identifier.id",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.use",
        "path": "Encounter.identifier.use",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.type",
        "path": "Encounter.identifier.type",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.system",
        "path": "Encounter.identifier.system",
        "short": "DiGeN-spezifische KrankenkassenKIS -Fallidentifikation",
        "definition": "Establishes the namespace for the value - that is, a URL that describes a set values that are unique.\r\nThe namespace OID depends on and is specific for the AOK, the patient is insuree of.",
        "comment": "Use the following OIDs:\r\n1.2.276.0.76.3.1.321.1.1.6.15  for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Hessen)\r\n1.2.276.0.76.3.1.321.1.1.6.17 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Baden-Württemberg)\r\n1.2.276.0.76.3.1.321.1.1.6.18 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Bayern)\r\n1.2.276.0.76.3.1.321.1.1.6.19 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Bremen/Bremerhaven)\r\n1.2.276.0.76.3.1.321.1.1.6.20 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Niedersachsen)\r\n1.2.276.0.76.3.1.321.1.1.6.21 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Nordost)\r\n1.2.276.0.76.3.1.321.1.1.6.22 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK NORDWEST)\r\n1.2.276.0.76.3.1.321.1.1.6.23 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Sachsen-Anhalt)\r\n1.2.276.0.76.3.1.321.1.1.6.24 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK PLUS - Sachsen und Thüringen)\r\n1.2.276.0.76.3.1.321.1.1.6.25 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Rheinland/Hamburg)\r\n1.2.276.0.76.3.1.321.1.1.6.26 for DiGeN-spezifische Krankenkassenkis -Fallidentifikation (AOK Rheinland-Pfalz/Saarland)",
        "min": 1
      },
      {
        "id": "Encounter.identifier.value",
        "path": "Encounter.identifier.value",
        "min": 1
      },
      {
        "id": "Encounter.identifier.period",
        "path": "Encounter.identifier.period",
        "max": "0"
      },
      {
        "id": "Encounter.identifier.assigner",
        "path": "Encounter.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Encounter.status",
        "path": "Encounter.status",
        "fixedCode": "finished"
      },
      {
        "id": "Encounter.statusHistory",
        "path": "Encounter.statusHistory",
        "max": "0"
      },
      {
        "id": "Encounter.class",
        "path": "Encounter.class",
        "short": "Art des Aufenthalts",
        "definition": "In DiGeN the following values are possible:\r\nAMB (code) / ambulant (display); IMP (code) / stationär (display); PRENC (code) / vorstationär (display); SS (code) / teilstationär (display)  and for rehabilitation stays: MOB / mobil; KOMB / Kombinationsbehandlung; GAMB / ganztägig ambulant.",
        "min": 1,
        "binding": {
          "strength": "required",
          "description": "DiGeN ActEncounterCodes",
          "valueSetReference": {
            "reference": "http://digen.nublar.de/fhir/ValueSet/ActEncounterCodes"
          }
        }
      },
      {
        "id": "Encounter.class.id",
        "path": "Encounter.class.id",
        "max": "0"
      },
      {
        "id": "Encounter.class.system",
        "path": "Encounter.class.system",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSetUri": "http://digen.nublar.de/fhir/ValueSet/ActEncounterCodes"
        }
      },
      {
        "id": "Encounter.class.version",
        "path": "Encounter.class.version",
        "max": "0"
      },
      {
        "id": "Encounter.class.code",
        "path": "Encounter.class.code",
        "min": 1
      },
      {
        "id": "Encounter.class.userSelected",
        "path": "Encounter.class.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.classHistory",
        "path": "Encounter.classHistory",
        "max": "0"
      },
      {
        "id": "Encounter.type",
        "path": "Encounter.type",
        "short": "DiGeN Typ des Encounters",
        "definition": "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). In DiGeN used for differentiating between KH and REHA encounters. For REHA encounters this field is also used for providing information about the \"Reha-Kostenträger\".",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.type.id",
        "path": "Encounter.type.id",
        "max": "0"
      },
      {
        "id": "Encounter.type.coding",
        "path": "Encounter.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.type.coding.id",
        "path": "Encounter.type.coding.id",
        "max": "0"
      },
      {
        "id": "Encounter.type.coding.system",
        "path": "Encounter.type.coding.system",
        "min": 1,
        "fixedUri": "http://digen.nublar.de/fhir/CodeSystem/1.2.276.0.76.3.1.321.1.1.5.15",
        "binding": {
          "strength": "required",
          "valueSetUri": "http://digen.nublar.de/fhir/ValueSet/EncounterType"
        }
      },
      {
        "id": "Encounter.type.coding.version",
        "path": "Encounter.type.coding.version",
        "max": "0"
      },
      {
        "id": "Encounter.type.coding.code",
        "path": "Encounter.type.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.type.coding.userSelected",
        "path": "Encounter.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.type.text",
        "path": "Encounter.type.text",
        "max": "0"
      },
      {
        "id": "Encounter.priority",
        "path": "Encounter.priority",
        "max": "0"
      },
      {
        "id": "Encounter.subject",
        "path": "Encounter.subject",
        "short": "Referenz zum Patienten",
        "definition": "The patient present at the encounter.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.subject.id",
        "path": "Encounter.subject.id",
        "max": "0"
      },
      {
        "id": "Encounter.subject.reference",
        "path": "Encounter.subject.reference",
        "min": 1
      },
      {
        "id": "Encounter.subject.identifier",
        "path": "Encounter.subject.identifier",
        "max": "0"
      },
      {
        "id": "Encounter.subject.display",
        "path": "Encounter.subject.display",
        "max": "0"
      },
      {
        "id": "Encounter.episodeOfCare",
        "path": "Encounter.episodeOfCare",
        "max": "0"
      },
      {
        "id": "Encounter.incomingReferral",
        "path": "Encounter.incomingReferral",
        "short": "Über-/Einweisung zum Aufenthalt",
        "definition": "The referral request this encounter satisfies (incoming referral). In DiGeN used for the requester of a rehabilitation stay.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://digen.nublar.de/fhir/StructureDefinition/DigenReferralRequest",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Encounter.incomingReferral.id",
        "path": "Encounter.incomingReferral.id",
        "max": "0"
      },
      {
        "id": "Encounter.incomingReferral.reference",
        "path": "Encounter.incomingReferral.reference",
        "min": 1
      },
      {
        "id": "Encounter.incomingReferral.identifier",
        "path": "Encounter.incomingReferral.identifier",
        "max": "0"
      },
      {
        "id": "Encounter.incomingReferral.display",
        "path": "Encounter.incomingReferral.display",
        "max": "0"
      },
      {
        "id": "Encounter.participant",
        "path": "Encounter.participant",
        "max": "0"
      },
      {
        "id": "Encounter.appointment",
        "path": "Encounter.appointment",
        "max": "0"
      },
      {
        "id": "Encounter.period",
        "path": "Encounter.period",
        "short": "Beginn/Ende des Aufenthalts",
        "min": 1
      },
      {
        "id": "Encounter.period.id",
        "path": "Encounter.period.id",
        "max": "0"
      },
      {
        "id": "Encounter.period.start",
        "path": "Encounter.period.start",
        "min": 1
      },
      {
        "id": "Encounter.period.end",
        "path": "Encounter.period.end",
        "min": 1
      },
      {
        "id": "Encounter.length",
        "path": "Encounter.length",
        "max": "0"
      },
      {
        "id": "Encounter.reason",
        "path": "Encounter.reason",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis",
        "path": "Encounter.diagnosis",
        "short": "Diagnosen und Prozeduren zum Aufenthalt",
        "definition": "The list of diagnosis relevant to this encounter. This can be conditions and/or prcedures."
      },
      {
        "id": "Encounter.diagnosis.id",
        "path": "Encounter.diagnosis.id",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.condition",
        "path": "Encounter.diagnosis.condition",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://digen.nublar.de/fhir/StructureDefinition/DigenConditionAbrechnung",
            "aggregation": [
              "referenced"
            ]
          },
          {
            "code": "Reference",
            "targetProfile": "http://digen.nublar.de/fhir/StructureDefinition/DigenAbrechnungsProcedureHeilm",
            "aggregation": [
              "referenced"
            ]
          },
          {
            "code": "Reference",
            "targetProfile": "http://digen.nublar.de/fhir/StructureDefinition/DigenAbrechnungsProcedureOPS",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.diagnosis.condition.id",
        "path": "Encounter.diagnosis.condition.id",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.condition.reference",
        "path": "Encounter.diagnosis.condition.reference",
        "min": 1
      },
      {
        "id": "Encounter.diagnosis.condition.identifier",
        "path": "Encounter.diagnosis.condition.identifier",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.condition.display",
        "path": "Encounter.diagnosis.condition.display",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.role.id",
        "path": "Encounter.diagnosis.role.id",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.role.coding",
        "path": "Encounter.diagnosis.role.coding",
        "short": "DiGeN-spezifischer Diagnosen-Fallkontext",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.diagnosis.role.coding.id",
        "path": "Encounter.diagnosis.role.coding.id",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.role.coding.system",
        "path": "Encounter.diagnosis.role.coding.system",
        "min": 1,
        "fixedUri": "http://digen.nublar.de/fhir/CodeSystem/1.2.276.0.76.3.1.321.1.1.5.14"
      },
      {
        "id": "Encounter.diagnosis.role.coding.version",
        "path": "Encounter.diagnosis.role.coding.version",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.role.coding.code",
        "path": "Encounter.diagnosis.role.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.diagnosis.role.coding.userSelected",
        "path": "Encounter.diagnosis.role.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.role.text",
        "path": "Encounter.diagnosis.role.text",
        "max": "0"
      },
      {
        "id": "Encounter.diagnosis.rank",
        "path": "Encounter.diagnosis.rank",
        "max": "0"
      },
      {
        "id": "Encounter.account",
        "path": "Encounter.account",
        "max": "0"
      },
      {
        "id": "Encounter.hospitalization",
        "path": "Encounter.hospitalization",
        "max": "0"
      },
      {
        "id": "Encounter.location",
        "path": "Encounter.location",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider",
        "path": "Encounter.serviceProvider",
        "short": "Aufenthalt ServiceProvider",
        "definition": "An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization. In DiGeN the service provider is transmitted from the KKIS as \"healthServiceProviderIk\"."
      },
      {
        "id": "Encounter.serviceProvider.id",
        "path": "Encounter.serviceProvider.id",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider.reference",
        "path": "Encounter.serviceProvider.reference",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider.identifier",
        "path": "Encounter.serviceProvider.identifier",
        "short": "IK Nummer des ServiceProviders",
        "min": 1
      },
      {
        "id": "Encounter.serviceProvider.identifier.id",
        "path": "Encounter.serviceProvider.identifier.id",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider.identifier.use",
        "path": "Encounter.serviceProvider.identifier.use",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider.identifier.type",
        "path": "Encounter.serviceProvider.identifier.type",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider.identifier.system",
        "path": "Encounter.serviceProvider.identifier.system",
        "short": "IK Nummer Namensraum",
        "definition": "Establishes the namespace for the value - that is, a URL that describes a set values that are unique.\r\n(http://fhir.de/NamingSystem/arge-ik/iknr)",
        "min": 1,
        "fixedUri": "urn:oid:1.2.276.0.76.4.5"
      },
      {
        "id": "Encounter.serviceProvider.identifier.value",
        "path": "Encounter.serviceProvider.identifier.value",
        "min": 1
      },
      {
        "id": "Encounter.serviceProvider.identifier.period",
        "path": "Encounter.serviceProvider.identifier.period",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider.identifier.assigner",
        "path": "Encounter.serviceProvider.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Encounter.serviceProvider.display",
        "path": "Encounter.serviceProvider.display",
        "max": "0"
      },
      {
        "id": "Encounter.partOf",
        "path": "Encounter.partOf",
        "max": "0"
      }
    ]
  }
}