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