<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://fhir.smart4health.eu/StructureDefinition/s4h-documentreference" />
  <name value="S4hDocumentReference" />
  <status value="draft" />
  <date value="2022-01-12T15:58:22.7244019+00:00" />
  <publisher value="D4L data4life gGmbh" />
  <description value="DocumentReference profile for use within the Smart4Health project." />
  <copyright value="2020 D4L data4life gGmbh" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="fhircomposition" />
    <uri value="http://hl7.org/fhir/composition" />
    <name value="FHIR Composition" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="cda" />
    <uri value="http://hl7.org/v3/cda" />
    <name value="CDA (R2)" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="xds" />
    <uri value="http://ihe.net/xds" />
    <name value="XDS metadata equivalent" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
  <derivation value="constraint" />
  <differential>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.status">
      <path value="DocumentReference.status" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.category">
      <path value="DocumentReference.category" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
        <targetProfile value="http://fhir.smart4health.eu/StructureDefinition/s4h-patient" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Practitioner-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.date">
      <path value="DocumentReference.date" />
      <requirements value="Within the Smart4Health project, the creation date needed to properly place the document within a complete patient record." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Practitioner-uv-ips" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/PractitionerRole-uv-ips" />
        <targetProfile value="http://fhir.smart4health.eu/StructureDefinition/s4h-patient" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Organization-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.custodian">
      <path value="DocumentReference.custodian" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Organization-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.relatesTo">
      <path value="DocumentReference.relatesTo" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.relatesTo.target">
      <path value="DocumentReference.relatesTo.target" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.smart4health.eu/StructureDefinition/s4h-documentreference" />
      </type>
    </element>
    <element id="DocumentReference.description">
      <path value="DocumentReference.description" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content">
      <path value="DocumentReference.content" />
      <requirements value="Smart4Health: The use and interpretation of multiple content elements is currently difficult and unclear. To avoid confusion and incorrect use, it is therefore restricted to a single element with the Smart4Health context." />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment">
      <path value="DocumentReference.content.attachment" />
      <type>
        <code value="Attachment" />
        <profile value="http://fhir.smart4health.eu/StructureDefinition/s4h-attachment" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context">
      <path value="DocumentReference.context" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.encounter">
      <path value="DocumentReference.context.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
        <targetProfile value="http://fhir.smart4health.eu/StructureDefinition/s4h-encounter" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>