<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-consent-management-consent" />
  <url value="http://fhir.de/ConsentManagement/StructureDefinition/Consent" />
  <version value="2.0.3" />
  <name value="ConsentManagementConsent" />
  <title value="Consent Management: Consent" />
  <status value="active" />
  <experimental value="false" />
  <date value="2026-03-02" />
  <publisher value="AG Einwilligungsmanagement des Interoperabilitätsforums" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="https://wiki.hl7.de/index.php?title=Einwilligungsmanagement_(Projekt)" />
    </telecom>
  </contact>
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Consent" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Consent" />
  <derivation value="constraint" />
  <differential>
    <element id="Consent.extension">
      <path value="Consent.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Consent.extension:domainReference">
      <path value="Consent.extension" />
      <sliceName value="domainReference" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.de/ConsentManagement/StructureDefinition/DomainReference" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.extension:domainReference.extension">
      <path value="Consent.extension.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Consent.extension:domainReference.extension:domain">
      <path value="Consent.extension.extension" />
      <sliceName value="domain" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.status">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Consent.status" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.scope">
      <path value="Consent.scope" />
      <comment value="Wird im Kontext des Einwilligungsmanagment-Leitfadens nicht näher definiert.&#xD;&#xA;Bei Bedarf kann das ValueSet erweitert oder ggf. ein NullFlavor-Code eingetragen werden." />
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:consentCategory">
      <path value="Consent.category" />
      <sliceName value="consentCategory" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:consentCategory.coding">
      <path value="Consent.category.coding" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:consentCategory.coding.system">
      <path value="Consent.category.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:consentCategory.coding.code">
      <path value="Consent.category.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:resultType">
      <path value="Consent.category" />
      <sliceName value="resultType" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.de/ConsentManagement/ValueSet/ResultType" />
      </binding>
    </element>
    <element id="Consent.category:resultType.coding">
      <path value="Consent.category.coding" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:resultType.coding.system">
      <path value="Consent.category.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:resultType.coding.code">
      <path value="Consent.category.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:templateType">
      <path value="Consent.category" />
      <sliceName value="templateType" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.de/ConsentManagement/ValueSet/TemplateType" />
      </binding>
    </element>
    <element id="Consent.category:templateType.coding">
      <path value="Consent.category.coding" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:templateType.coding.system">
      <path value="Consent.category.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:templateType.coding.code">
      <path value="Consent.category.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.de/ConsentManagement/StructureDefinition/Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.patient.reference">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Consent.patient.reference" />
    </element>
    <element id="Consent.dateTime">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Consent.dateTime" />
      <short value="Erstellungszeitpunkt der Einwilligungsinformation" />
      <definition value="Zu diesem Zeitpunkt wurde diese Einwilligungsinformation erstellt.&#xD;&#xA;Dies ist nicht notwendigerweise identisch mit dem Zeitpunkt der Einwilligungserklärung oder dem Beginn des Gültigkeitszeitraums." />
      <comment value="Dieser Zeitpunkt sollte in der Praxis, zumindest bei vollelektronischer Verarbeitung, identisch mit dem Unterschriftsdatum des Fragebogens sein (Provenance.signature.when des Patienten)" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.organization">
      <path value="Consent.organization" />
      <short value="Organisation, in der die Einwilligung erfasst wurde." />
      <definition value="Dies ist die Organisation, die den Consent erfasst hat." />
      <mustSupport value="true" />
    </element>
    <element id="Consent.source[x]">
      <path value="Consent.source[x]" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.de/ConsentManagement/StructureDefinition/QuestionnaireResponse" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.source[x].reference">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Consent.source[x].reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policy">
      <path value="Consent.policy" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policy.uri">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Consent.policy.uri" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policyRule">
      <path value="Consent.policyRule" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policyRule.extension">
      <path value="Consent.policyRule.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Consent.policyRule.extension:xacml">
      <path value="Consent.policyRule.extension" />
      <sliceName value="xacml" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.de/ConsentManagement/StructureDefinition/Xacml" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision">
      <path value="Consent.provision" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.period">
      <path value="Consent.provision.period" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>