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