<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="KBV-PR-Base-DocumentReference" />
  <url value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_DocumentReference" />
  <version value="1.8.0" />
  <name value="KBV_PR_Base_DocumentReference" />
  <status value="active" />
  <date value="2025-10-24" />
  <publisher value="Kassenärztliche Bundesvereinigung (KBV)" />
  <description value="Hier wird auf ein externes Dokument verwiesen und/oder ein Dokument angehängt." />
  <copyright value="Copyright © [2025], Kassenärztliche Bundesvereinigung (KBV). All rights reserved. Im folgenden Profil können Codes aus den Codesystemen Snomed, Loinc oder Ucum enthalten sein, die dem folgenden Urheberrecht unterliegen: This material includes SNOMED Clinical Terms® SNOMED CT® which is used by permission of SNOMED International. All rights reserved. SNOMED CT®, was originally created by The College of American Pathologists. SNOMED and SNOMED CT are registered trademarks of SNOMED International. Implementers of these artefacts must have the appropriate SNOMED CT Affiliate license. This material contains content from Loinc http://loinc.org. Loinc is copyright ©; 1995-2020, Regenstrief Institute, Inc. and the Logical Observation Identifiers Names and Codes Loinc Committee and is available at no cost under the license at http://loinc.org/license. Loinc® is a registered United States trademark of Regenstrief Institute, Inc. This product includes all or a portion of the UCUM table, UCUM codes, and UCUM definitions or is derived from it, subject to a license from Regenstrief Institute, Inc. and The UCUM Organization. Your use of the UCUM table, UCUM codes, UCUM definitions also is subject to this license, a copy of which is available at ​http://unitsofmeasure.org. The current complete UCUM table, UCUM Specification are available for download at ​http://unitsofmeasure.org. The UCUM table and UCUM codes are copyright ©; 1995-2009, Regenstrief Institute, Inc. and the Unified Codes for Units of Measures UCUM Organization. All rights reserved. THE UCUM TABLE IN ALL FORMATS, UCUM DEFINITIONS, AND SPECIFICATION ARE PROVIDED &amp;quot;AS IS.&amp;quot; ANY EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
  <derivation value="constraint" />
  <differential>
    <element id="DocumentReference">
      <path value="DocumentReference" />
      <definition value="Hier wird auf ein externes Dokument verwiesen und/oder ein Dokument angehängt." />
    </element>
    <element id="DocumentReference.status">
      <path value="DocumentReference.status" />
      <definition value="Hier wird der Status des Dokumentenverweises bzw. Anhanges angegeben." />
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <definition value="In diesem Element werden Angaben zum Typ des Dokuments gemacht. Diese werden als codierte Information und/oder als Freitext angegeben." />
    </element>
    <element id="DocumentReference.type.coding">
      <path value="DocumentReference.type.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="Hier wird ein Code aus einem geeigneten Code-System angegeben." />
    </element>
    <element id="DocumentReference.type.coding:xds">
      <path value="DocumentReference.type.coding" />
      <sliceName value="xds" />
      <definition value="Hier wird der Dokumenttyp gem. IHE-De-Terminologie in codierter Form angeben." />
      <min value="0" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ihe-d.de/ValueSets/IHEXDStypeCode" />
      </binding>
    </element>
    <element id="DocumentReference.type.coding:xds.system">
      <path value="DocumentReference.type.coding.system" />
      <min value="1" />
    </element>
    <element id="DocumentReference.type.coding:xds.code">
      <path value="DocumentReference.type.coding.code" />
      <min value="1" />
    </element>
    <element id="DocumentReference.type.coding:xds.display">
      <path value="DocumentReference.type.coding.display" />
      <min value="1" />
    </element>
    <element id="DocumentReference.type.coding:kbv">
      <path value="DocumentReference.type.coding" />
      <sliceName value="kbv" />
      <definition value="Hier wird ein Code aus einer vorgegebenen Werteliste angegeben, welcher es erlaubt ein spezifisches Dokument aus den Projekten der KBV und MIO direkt zu referenzieren." />
      <min value="0" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.kbv.de/ValueSet/KBV_VS_Base_Document_Type_KBV" />
      </binding>
    </element>
    <element id="DocumentReference.type.coding:kbv.system">
      <path value="DocumentReference.type.coding.system" />
      <min value="1" />
    </element>
    <element id="DocumentReference.type.coding:kbv.code">
      <path value="DocumentReference.type.coding.code" />
      <min value="1" />
    </element>
    <element id="DocumentReference.type.coding:kbv.display">
      <path value="DocumentReference.type.coding.display" />
      <min value="1" />
    </element>
    <element id="DocumentReference.type.text">
      <path value="DocumentReference.type.text" />
      <definition value="Hier wird ein Freitext eingetragen." />
    </element>
    <element id="DocumentReference.category">
      <path value="DocumentReference.category" />
      <definition value="In diesem Element werden Angaben zur Kategorie des Dokuments gemacht. Diese werden als codierte Information und/oder als Freitext angegeben." />
    </element>
    <element id="DocumentReference.category.coding">
      <path value="DocumentReference.category.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="Hier wird ein Code aus einem geeigneten Code-System angegeben." />
    </element>
    <element id="DocumentReference.category.coding:xds">
      <path value="DocumentReference.category.coding" />
      <sliceName value="xds" />
      <definition value="Hier wird die Kategorie des Dokuments gem. IHE-De-Terminologie in codierter Form angeben." />
      <min value="0" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ihe-d.de/ValueSets/IHEXDSclassCode" />
      </binding>
    </element>
    <element id="DocumentReference.category.coding:xds.system">
      <path value="DocumentReference.category.coding.system" />
      <min value="1" />
    </element>
    <element id="DocumentReference.category.coding:xds.code">
      <path value="DocumentReference.category.coding.code" />
      <min value="1" />
    </element>
    <element id="DocumentReference.category.coding:xds.display">
      <path value="DocumentReference.category.coding.display" />
      <min value="1" />
    </element>
    <element id="DocumentReference.category.text">
      <path value="DocumentReference.category.text" />
      <definition value="Hier wird ein Freitext eingetragen." />
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Patient|1.8.0" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Device|1.8.0" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Practitioner|1.8.0" />
      </type>
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <definition value="Hier werden Personen, Einrichtungen oder Geräte, die das Dokument erzeugt haben, referenziert." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_PractitionerRole|1.8.0" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Practitioner|1.8.0" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Organization|1.8.0" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Patient|1.8.0" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_RelatedPerson|1.8.0" />
        <targetProfile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Device|1.8.0" />
      </type>
    </element>
    <element id="DocumentReference.description">
      <path value="DocumentReference.description" />
      <definition value="Hier wird der Dokumentenverweis als Freitext erfasst, z. B. &quot;Arztbrief vom 28.04.2020&quot;." />
    </element>
    <element id="DocumentReference.content">
      <path value="DocumentReference.content" />
      <slicing>
        <discriminator>
          <type value="exists" />
          <path value="attachment.url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="In diesem Element wird eine strukturierte Referenz auf andere Inhalte gemacht, dies kann z. B. ein anderes Dokument in der ePA sein&#xD;&#xA;&#xD;&#xA;oder&#xD;&#xA;&#xD;&#xA;Hier wird das Dokument in Form eines formatierten Anhangs abgebildet." />
    </element>
    <element id="DocumentReference.content:verweis">
      <path value="DocumentReference.content" />
      <sliceName value="verweis" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="DocumentReference.content:verweis.attachment">
      <path value="DocumentReference.content.attachment" />
      <definition value="In diesem Element wird eine strukturierte Referenz auf andere Inhalte gemacht, dies kann z. B. ein anderes Dokument in der ePA sein." />
    </element>
    <element id="DocumentReference.content:verweis.attachment.url">
      <path value="DocumentReference.content.attachment.url" />
      <definition value="Hier wird die URI des Eintrags angegeben." />
      <min value="1" />
    </element>
    <element id="DocumentReference.content:verweis.attachment.title">
      <path value="DocumentReference.content.attachment.title" />
      <definition value="Hier findet sich der Name des referenzierten Dokumentes." />
      <min value="1" />
    </element>
    <element id="DocumentReference.content:verweis.attachment.creation">
      <path value="DocumentReference.content.attachment.creation" />
      <definition value="Hier wird der Zeitpunkt der Erstellung des referenzierten Dokumentes angegeben." />
    </element>
    <element id="DocumentReference.content:anhang">
      <path value="DocumentReference.content" />
      <sliceName value="anhang" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="DocumentReference.content:anhang.attachment">
      <path value="DocumentReference.content.attachment" />
      <definition value="Hier wird das Dokument in Form eines formatierten Anhangs abgebildet." />
    </element>
    <element id="DocumentReference.content:anhang.attachment.contentType">
      <path value="DocumentReference.content.attachment.contentType" />
      <definition value="Hier wird das Dateiformat ausgewählt.&#xD;&#xA;Es ist ein Code aus dem System urn:ietf:bcp:13 zu wählen" />
      <min value="1" />
    </element>
    <element id="DocumentReference.content:anhang.attachment.data">
      <path value="DocumentReference.content.attachment.data" />
      <definition value="Hier wird das Dokument als Datei angehängt." />
      <min value="1" />
    </element>
    <element id="DocumentReference.content:anhang.attachment.url">
      <path value="DocumentReference.content.attachment.url" />
      <max value="0" />
    </element>
    <element id="DocumentReference.content:anhang.attachment.title">
      <path value="DocumentReference.content.attachment.title" />
      <definition value="Hier wird ein Titel bzw. eine Bezeichnung für die angehängte Datei angegeben." />
      <min value="1" />
    </element>
    <element id="DocumentReference.content:anhang.attachment.creation">
      <path value="DocumentReference.content.attachment.creation" />
      <definition value="Hier wird der Zeitpunkt der Erstellung des Anhangs angegeben." />
    </element>
  </differential>
</StructureDefinition>