{
  "resourceType": "StructureDefinition",
  "id": "GEM-ERPCHRG-PR-Consent",
  "url": "https://gematik.de/fhir/erpchrg/StructureDefinition/GEM_ERPCHRG_PR_Consent",
  "version": "1.1.0",
  "name": "GEM_ERPCHRG_PR_Consent",
  "status": "active",
  "experimental": false,
  "date": "2025-04-10",
  "publisher": "gematik GmbH",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Consent",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Consent",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Consent.meta",
        "path": "Consent.meta",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Consent.meta.profile",
        "path": "Consent.meta.profile",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "$this"
            }
          ],
          "rules": "closed",
          "description": "Slicing for meta profile",
          "ordered": false
        },
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Consent.meta.profile:erpchrgProfile",
        "path": "Consent.meta.profile",
        "sliceName": "erpchrgProfile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://gematik.de/fhir/erpchrg/StructureDefinition/GEM_ERPCHRG_PR_Consent|1.1",
        "mustSupport": true
      },
      {
        "id": "Consent.status",
        "path": "Consent.status",
        "fixedCode": "active"
      },
      {
        "id": "Consent.scope.coding",
        "path": "Consent.scope.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Consent.scope.coding.system",
        "path": "Consent.scope.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/consentscope"
      },
      {
        "id": "Consent.scope.coding.code",
        "path": "Consent.scope.coding.code",
        "fixedCode": "patient-privacy"
      },
      {
        "id": "Consent.scope.coding.display",
        "path": "Consent.scope.coding.display",
        "fixedString": "Privacy Consent"
      },
      {
        "id": "Consent.category",
        "path": "Consent.category",
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://gematik.de/fhir/erpchrg/ValueSet/GEM_ERPCHRG_VS_ConsentType"
        }
      },
      {
        "id": "Consent.patient",
        "path": "Consent.patient",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Consent.patient.identifier",
        "path": "Consent.patient.identifier",
        "min": 1,
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://fhir.de/StructureDefinition/identifier-kvid-10"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Consent.patient.identifier.assigner",
        "path": "Consent.patient.identifier.assigner",
        "mustSupport": true
      },
      {
        "id": "Consent.patient.identifier.assigner.identifier",
        "path": "Consent.patient.identifier.assigner.identifier",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://fhir.de/StructureDefinition/identifier-iknr"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Consent.dateTime",
        "path": "Consent.dateTime",
        "comment": "dateTime wird vom E-Rezept-Fachdienst zu dem Zeitpunkt gesetzt, an dem die Consent Ressource hochgeladen wird.",
        "mustSupport": true
      },
      {
        "id": "Consent.policyRule",
        "path": "Consent.policyRule",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://terminology.hl7.org/ValueSet/v3-ActCode"
        }
      }
    ]
  }
}