{
  "resourceType": "StructureDefinition",
  "id": "pcm-consent-deactivate",
  "url": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-consent-deactivate",
  "version": "0.3.2",
  "name": "PCMConsentDeactivate",
  "title": "PCM Consent Deactivation Request",
  "status": "active",
  "description": "Closed FHIR PUT request by the creating Service Provider to make its Consent inactive. The client supplies status=inactive plus the base-required fixed scope, category, and legal policy. All other Consent content is prohibited; PCM preserves the authoritative legal policy and derives the terminal service-provider-cancelled business status.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Consent",
  "baseDefinition": "http://fhir.health.gov.il/StructureDefinition/il-core-consent",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Consent.id",
        "path": "Consent.id",
        "min": 1
      },
      {
        "id": "Consent.meta.versionId",
        "path": "Consent.meta.versionId",
        "comment": "Server-managed FHIR metadata. Prohibited in client requests.",
        "max": "0"
      },
      {
        "id": "Consent.meta.lastUpdated",
        "path": "Consent.meta.lastUpdated",
        "comment": "Server-managed FHIR metadata. Prohibited in client requests.",
        "max": "0"
      },
      {
        "id": "Consent.meta.source",
        "path": "Consent.meta.source",
        "max": "0"
      },
      {
        "id": "Consent.meta.profile",
        "path": "Consent.meta.profile",
        "comment": "Clients may assert the interaction-specific request profile, but PCM validates the request shape independently and does not require this declaration."
      },
      {
        "id": "Consent.meta.security",
        "path": "Consent.meta.security",
        "comment": "Prohibited on update. PCM preserves the server-derived HTEST security label.",
        "max": "0"
      },
      {
        "id": "Consent.meta.tag",
        "path": "Consent.meta.tag",
        "max": "0"
      },
      {
        "id": "Consent.implicitRules",
        "path": "Consent.implicitRules",
        "max": "0"
      },
      {
        "id": "Consent.language",
        "path": "Consent.language",
        "max": "0"
      },
      {
        "id": "Consent.text",
        "path": "Consent.text",
        "max": "0"
      },
      {
        "id": "Consent.contained",
        "path": "Consent.contained",
        "max": "0"
      },
      {
        "id": "Consent.extension",
        "path": "Consent.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Consent.extension:businessStatus",
        "path": "Consent.extension",
        "sliceName": "businessStatus",
        "comment": "Prohibited in the request. PCM derives service-provider-cancelled after accepting the transition.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-consent-business-status"
            ]
          }
        ]
      },
      {
        "id": "Consent.extension:pcmService",
        "path": "Consent.extension",
        "sliceName": "pcmService",
        "comment": "Prohibited in the request. PCM preserves the authoritative service-instance reference.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-pcm-service"
            ]
          }
        ]
      },
      {
        "id": "Consent.modifierExtension",
        "path": "Consent.modifierExtension",
        "max": "0"
      },
      {
        "id": "Consent.identifier",
        "path": "Consent.identifier",
        "comment": "Prohibited on update. PCM preserves the Consent business identifier.",
        "max": "0"
      },
      {
        "id": "Consent.status",
        "path": "Consent.status",
        "fixedCode": "inactive"
      },
      {
        "id": "Consent.scope",
        "path": "Consent.scope",
        "comment": "Required fixed request-envelope value. PCM validates patient-privacy and rejects a mismatch."
      },
      {
        "id": "Consent.scope.coding",
        "path": "Consent.scope.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.scope.coding.system",
        "path": "Consent.scope.coding.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/consentscope"
      },
      {
        "id": "Consent.scope.coding.code",
        "path": "Consent.scope.coding.code",
        "min": 1,
        "fixedCode": "patient-privacy"
      },
      {
        "id": "Consent.category",
        "path": "Consent.category",
        "comment": "Required fixed request-envelope value. PCM validates INFA and rejects a mismatch.",
        "max": "1"
      },
      {
        "id": "Consent.category.coding",
        "path": "Consent.category.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.category.coding.system",
        "path": "Consent.category.coding.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"
      },
      {
        "id": "Consent.category.coding.code",
        "path": "Consent.category.coding.code",
        "min": 1,
        "fixedCode": "INFA"
      },
      {
        "id": "Consent.patient",
        "path": "Consent.patient",
        "comment": "Prohibited on update. PCM preserves the patient identifier.",
        "max": "0"
      },
      {
        "id": "Consent.dateTime",
        "path": "Consent.dateTime",
        "comment": "Prohibited on update. PCM preserves the creation timestamp.",
        "max": "0"
      },
      {
        "id": "Consent.performer",
        "path": "Consent.performer",
        "max": "0"
      },
      {
        "id": "Consent.organization",
        "path": "Consent.organization",
        "max": "0"
      },
      {
        "id": "Consent.source[x]",
        "path": "Consent.source[x]",
        "max": "0"
      },
      {
        "id": "Consent.source[x]:sourceReference",
        "path": "Consent.source[x]",
        "sliceName": "sourceReference",
        "max": "0",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.health.gov.il/StructureDefinition/il-core-consent",
              "http://fhir.health.gov.il/StructureDefinition/il-core-document-reference",
              "http://hl7.org/fhir/StructureDefinition/Contract",
              "http://fhir.health.gov.il/StructureDefinition/il-core-questionnaire-response"
            ]
          }
        ]
      },
      {
        "id": "Consent.source[x]:sourceAttachment",
        "path": "Consent.source[x]",
        "sliceName": "sourceAttachment",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "Attachment"
          }
        ]
      },
      {
        "id": "Consent.policy",
        "path": "Consent.policy",
        "comment": "Required fixed legal policy covered by the Consent being deactivated.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.policy.authority",
        "path": "Consent.policy.authority",
        "min": 1,
        "fixedUri": "https://www.gov.il/"
      },
      {
        "id": "Consent.policy.uri",
        "path": "Consent.policy.uri",
        "min": 1,
        "fixedUri": "https://pcm.fhir.health.gov.il/consent-policy/medical-information-mobility-law-2024"
      },
      {
        "id": "Consent.policyRule",
        "path": "Consent.policyRule",
        "max": "0"
      },
      {
        "id": "Consent.verification",
        "path": "Consent.verification",
        "max": "0"
      },
      {
        "id": "Consent.provision",
        "path": "Consent.provision",
        "comment": "Prohibited on update. PCM preserves the existing period, actors, and derived authorization content.",
        "max": "0"
      }
    ]
  }
}