<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Consent" />
  <url value="https://fhir.centraxx.de/StructureDefinition/Consent" />
  <version value="2025.4.0" />
  <name value="Consent" />
  <status value="active" />
  <publisher value="Kairos an IQVIA business" />
  <description value="Represents a CentraXX consent of a patient." />
  <fhirVersion value="4.0.1" />
  <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="closed" />
      </slicing>
      <min value="0" />
      <max value="7" />
      <type>
        <code value="Extension" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.extension:updateWithOverwrite">
      <path value="Consent.extension" />
      <sliceName value="updateWithOverwrite" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/updateWithOverwrite" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.extension:notes">
      <path value="Consent.extension" />
      <sliceName value="notes" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/consent/notes" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.extension:file">
      <path value="Consent.extension" />
      <sliceName value="file" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/consent/file" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.extension:revocationFile">
      <path value="Consent.extension" />
      <sliceName value="revocationFile" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/consent/revocation/file" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.extension:revocationNotes">
      <path value="Consent.extension" />
      <sliceName value="revocationNotes" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/consent/revocation/notes" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.extension:signature">
      <path value="Consent.extension" />
      <sliceName value="signature" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/consent/signature" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.extension:signStatus">
      <path value="Consent.extension" />
      <sliceName value="signStatus" />
      <comment value="The code of the CXX ConsentSignatureStatus." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/consent/signStatus" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.centraxx.de/valueSet/consent/signatureStatus" />
      </binding>
    </element>
    <element id="Consent.status">
      <path value="Consent.status" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.scope">
      <path value="Consent.scope" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <min value="1" />
      <max value="1" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="59284-0" />
          <display value="Patient Consent" />
        </coding>
      </fixedCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.centraxx.de/StructureDefinition/Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.dateTime">
      <path value="Consent.dateTime" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policyRule">
      <path value="Consent.policyRule" />
      <min value="1" />
      <max value="1" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
          <code value="OPTINR" />
          <display value="opt-in with restrictions" />
        </coding>
      </fixedCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Consent.verification">
      <path value="Consent.verification" />
      <comment value="The non-presence of this element implies that the consent has not been signed." />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.verification.verified">
      <path value="Consent.verification.verified" />
      <min value="1" />
      <max value="1" />
      <fixedBoolean value="true" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.verification.verificationDate">
      <path value="Consent.verification.verificationDate" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision">
      <path value="Consent.provision" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.extension">
      <path value="Consent.provision.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="closed" />
      </slicing>
      <min value="0" />
      <max value="2" />
      <type>
        <code value="Extension" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.extension:revocation">
      <path value="Consent.provision.extension" />
      <sliceName value="revocation" />
      <comment value="If present, the consent is was revoked. The sub-extensions specify if the consent when the consentwas revoked and if it was revoked partly only." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/consent/revocation" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.extension:userInfoFile">
      <path value="Consent.provision.extension" />
      <sliceName value="userInfoFile" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.centraxx.de/extension/consent/userInfoFile" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.period">
      <path value="Consent.provision.period" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.period.start">
      <path value="Consent.provision.period.start" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.period.end">
      <path value="Consent.provision.period.end" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.purpose">
      <path value="Consent.provision.purpose" />
      <comment value="The code of the CXX ConsentType of the Consent" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.centraxx.de/valueSet/consent/type" />
      </binding>
    </element>
    <element id="Consent.provision.purpose.system">
      <path value="Consent.provision.purpose.system" />
      <min value="1" />
      <max value="1" />
      <fixedString value="https://fhir.centraxx.de/system/consent/type" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.purpose.code">
      <path value="Consent.provision.purpose.code" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.data">
      <path value="Consent.provision.data" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.data.meaning">
      <path value="Consent.provision.data.meaning" />
      <min value="1" />
      <max value="1" />
      <fixedCode value="related" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.data.reference">
      <path value="Consent.provision.data.reference" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.centraxx.de/StructureDefinition/ResearchStudy" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.provision">
      <path value="Consent.provision.provision" />
      <comment value="Represents the CXX ConsentPolicy that belong to the consent." />
      <min value="0" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.provision.type">
      <path value="Consent.provision.provision.type" />
      <comment value="If 'DENY', this part of the consent is revoked" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.provision.purpose">
      <path value="Consent.provision.provision.purpose" />
      <comment value="The code of the CXX ConsentableAction." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.centraxx.de/valueSet/consent/action" />
      </binding>
    </element>
    <element id="Consent.provision.provision.purpose.system">
      <path value="Consent.provision.provision.purpose.system" />
      <min value="1" />
      <max value="1" />
      <fixedString value="https://fhir.centraxx.de/system/consent/action" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.provision.purpose.code">
      <path value="Consent.provision.provision.purpose.code" />
      <comment value="The ConsentableObject of the CXX ConsentPolicy." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.provision.class">
      <path value="Consent.provision.provision.class" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.centraxx.de/valueSet/consent/object" />
      </binding>
    </element>
    <element id="Consent.provision.provision.class.system">
      <path value="Consent.provision.provision.class.system" />
      <min value="1" />
      <max value="1" />
      <fixedString value="https://fhir.centraxx.de/system/consent/object" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.provision.class.code">
      <path value="Consent.provision.provision.class.code" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>