<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="adtbasedencounter-profile" />
  <url value="http://fhir.xt.dev/StructureDefinition/AdtBasedEncounter" />
  <version value="1.2.0" />
  <name value="AdtBasedEncounter" />
  <status value="active" />
  <date value="2026-03-24T00:00:00+00:00" />
  <publisher value="x-tention Informationstechnologie GmbH" />
  <contact>
    <telecom>
      <system value="email" />
      <value value="fhir.profiling@x-tention.com" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="An encounter with this profile has been generated based on an incoming HL7v2 ADT message. The encounter's scope is determined by what the sending system tracks as belonging to this encounter identifier. This might entail several hospital visits or movements." />
  <copyright value="x-tention Informationstechnologie GmbH" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Encounter" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Encounter" />
  <derivation value="constraint" />
  <differential>
    <element id="Encounter.extension:extensionAufnahmegrund">
      <path value="Encounter.extension" />
      <sliceName value="extensionAufnahmegrund" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.de/StructureDefinition/Aufnahmegrund" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Encounter.extension:plannedStartDate">
      <path value="Encounter.extension" />
      <sliceName value="plannedStartDate" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/5.0/StructureDefinition/extension-Encounter.plannedStartDate" />
      </type>
      <mustSupport value="false" />
    </element>
    <element id="Encounter.extension:plannedEndDate">
      <path value="Encounter.extension" />
      <sliceName value="plannedEndDate" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/5.0/StructureDefinition/extension-Encounter.plannedEndDate" />
      </type>
      <mustSupport value="false" />
    </element>
    <element id="Encounter.extension:replacesEncounter">
      <path value="Encounter.extension" />
      <sliceName value="replacesEncounter" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.xt.dev/StructureDefinition/ReplacesEncounter" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Encounter.extension:consentLabel">
      <path value="Encounter.extension" />
      <sliceName value="consentLabel" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.xt.dev/StructureDefinition/ConsentLabel" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Encounter.identifier">
      <path value="Encounter.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="type.coding" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Encounter.identifier:visitNumber">
      <path value="Encounter.identifier" />
      <sliceName value="visitNumber" />
      <short value="Main Identifier by which this encounter is known" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Encounter.identifier:visitNumber.type">
      <path value="Encounter.identifier.type" />
      <min value="1" />
    </element>
    <element id="Encounter.identifier:visitNumber.type.coding">
      <path value="Encounter.identifier.type.coding" />
      <min value="1" />
      <max value="1" />
      <patternCoding>
        <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
        <code value="VN" />
      </patternCoding>
    </element>
    <element id="Encounter.identifier:visitNumber.type.coding.system">
      <path value="Encounter.identifier.type.coding.system" />
      <min value="1" />
    </element>
    <element id="Encounter.identifier:visitNumber.type.coding.code">
      <path value="Encounter.identifier.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Encounter.identifier:visitNumber.system">
      <path value="Encounter.identifier.system" />
      <min value="1" />
    </element>
    <element id="Encounter.identifier:visitNumber.value">
      <path value="Encounter.identifier.value" />
      <min value="1" />
    </element>
    <element id="Encounter.type">
      <path value="Encounter.type" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Encounter.type:Kontaktebene">
      <path value="Encounter.type" />
      <sliceName value="Kontaktebene" />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://fhir.de/CodeSystem/Kontaktebene" />
          <code value="einrichtungskontakt" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Encounter.type:Kontaktebene.coding">
      <path value="Encounter.type.coding" />
      <patternCoding>
        <system value="http://fhir.de/CodeSystem/Kontaktebene" />
        <code value="einrichtungskontakt" />
      </patternCoding>
    </element>
    <element id="Encounter.type:Kontaktebene.coding.system">
      <path value="Encounter.type.coding.system" />
      <min value="1" />
      <fixedUri value="http://fhir.de/CodeSystem/Kontaktebene" />
    </element>
    <element id="Encounter.type:Kontaktebene.coding.code">
      <path value="Encounter.type.coding.code" />
      <min value="1" />
      <fixedCode value="einrichtungskontakt" />
    </element>
    <element id="Encounter.type:KontaktArt">
      <path value="Encounter.type" />
      <sliceName value="KontaktArt" />
      <patternCodeableConcept>
        <coding>
          <system value="http://fhir.de/CodeSystem/kontaktart-de" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Encounter.type:KontaktArt.coding">
      <path value="Encounter.type.coding" />
      <patternCoding>
        <system value="http://fhir.de/CodeSystem/kontaktart-de" />
      </patternCoding>
    </element>
    <element id="Encounter.type:KontaktArt.coding.system">
      <path value="Encounter.type.coding.system" />
      <min value="1" />
      <fixedUri value="http://fhir.de/CodeSystem/kontaktart-de" />
    </element>
    <element id="Encounter.type:KontaktArt.coding.code">
      <path value="Encounter.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Encounter.serviceType.coding">
      <path value="Encounter.serviceType.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Encounter.serviceType.coding:Fachabteilungsschluessel">
      <path value="Encounter.serviceType.coding" />
      <sliceName value="Fachabteilungsschluessel" />
      <patternCoding>
        <system value="http://fhir.de/CodeSystem/dkgev/Fachabteilungsschluessel" />
      </patternCoding>
    </element>
    <element id="Encounter.serviceType.coding:Fachabteilungsschluessel.system">
      <path value="Encounter.serviceType.coding.system" />
      <min value="1" />
      <fixedUri value="http://fhir.de/CodeSystem/dkgev/Fachabteilungsschluessel" />
    </element>
    <element id="Encounter.serviceType.coding:Fachabteilungsschluessel.code">
      <path value="Encounter.serviceType.coding.code" />
      <min value="1" />
    </element>
    <element id="Encounter.serviceType.coding:ErweiterterFachabteilungsschluessel">
      <path value="Encounter.serviceType.coding" />
      <sliceName value="ErweiterterFachabteilungsschluessel" />
      <patternCoding>
        <system value="http://fhir.de/CodeSystem/dkgev/Fachabteilungsschluessel-erweitert" />
      </patternCoding>
    </element>
    <element id="Encounter.serviceType.coding:ErweiterterFachabteilungsschluessel.system">
      <path value="Encounter.serviceType.coding.system" />
      <min value="1" />
      <fixedUri value="http://fhir.de/CodeSystem/dkgev/Fachabteilungsschluessel-erweitert" />
    </element>
    <element id="Encounter.serviceType.coding:ErweiterterFachabteilungsschluessel.code">
      <path value="Encounter.serviceType.coding.code" />
      <min value="1" />
    </element>
    <element id="Encounter.subject">
      <path value="Encounter.subject" />
      <min value="1" />
    </element>
    <element id="Encounter.subject.reference">
      <path value="Encounter.subject.reference" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>