{
  "resourceType": "StructureDefinition",
  "id": "pcm-organization-source-update",
  "url": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-organization-source-update",
  "version": "0.3.2",
  "name": "PCMOrganizationDataSourceUpdate",
  "title": "PCM Data Source Organization Update Request",
  "status": "active",
  "description": "Closed FHIR PUT request projection for replacing the Data Source child's Endpoint reference and optional purpose-coded contact overrides. The request repeats the authoritative name required by base FHIR Organization; PCM rejects a mismatch and does not treat it as writable. Child identity, Parent, role, active state, and certificate inventory are prohibited.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Organization",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Organization",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Organization.id",
        "path": "Organization.id",
        "min": 1
      },
      {
        "id": "Organization.meta.versionId",
        "path": "Organization.meta.versionId",
        "comment": "Server-managed FHIR metadata. Prohibited in client requests.",
        "max": "0"
      },
      {
        "id": "Organization.meta.lastUpdated",
        "path": "Organization.meta.lastUpdated",
        "comment": "Server-managed FHIR metadata. Prohibited in client requests.",
        "max": "0"
      },
      {
        "id": "Organization.meta.source",
        "path": "Organization.meta.source",
        "max": "0"
      },
      {
        "id": "Organization.meta.profile",
        "path": "Organization.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": "Organization.meta.security",
        "path": "Organization.meta.security",
        "max": "0"
      },
      {
        "id": "Organization.meta.tag",
        "path": "Organization.meta.tag",
        "max": "0"
      },
      {
        "id": "Organization.implicitRules",
        "path": "Organization.implicitRules",
        "max": "0"
      },
      {
        "id": "Organization.language",
        "path": "Organization.language",
        "max": "0"
      },
      {
        "id": "Organization.text",
        "path": "Organization.text",
        "max": "0"
      },
      {
        "id": "Organization.contained",
        "path": "Organization.contained",
        "max": "0"
      },
      {
        "id": "Organization.extension",
        "path": "Organization.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Organization.extension:oauth2RedirectUri",
        "path": "Organization.extension",
        "sliceName": "oauth2RedirectUri",
        "comment": "Prohibited on Data Source update. This projection belongs only to an authoritative Service Provider child.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-oauth2-redirect-uri"
            ]
          }
        ]
      },
      {
        "id": "Organization.extension:applicableCertificates",
        "path": "Organization.extension",
        "sliceName": "applicableCertificates",
        "comment": "Prohibited on update. PCM alone preserves or recomputes the authoritative certificate inventory.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-applicable-certificates"
            ]
          }
        ]
      },
      {
        "id": "Organization.modifierExtension",
        "path": "Organization.modifierExtension",
        "max": "0"
      },
      {
        "id": "Organization.identifier",
        "path": "Organization.identifier",
        "comment": "Prohibited on update. PCM preserves the stored PCM Organization business identifier.",
        "max": "0"
      },
      {
        "id": "Organization.active",
        "path": "Organization.active",
        "comment": "Prohibited on update. Only MoH/PCM changes Organization.active.",
        "max": "0"
      },
      {
        "id": "Organization.type",
        "path": "Organization.type",
        "comment": "Prohibited on update. PCM preserves the Data Source role.",
        "max": "0"
      },
      {
        "id": "Organization.name",
        "path": "Organization.name",
        "comment": "Required unchanged authoritative child name. PCM rejects a mismatch; this interaction does not permit renaming.",
        "min": 1
      },
      {
        "id": "Organization.alias",
        "path": "Organization.alias",
        "max": "0"
      },
      {
        "id": "Organization.telecom",
        "path": "Organization.telecom",
        "max": "0"
      },
      {
        "id": "Organization.address",
        "path": "Organization.address",
        "max": "0"
      },
      {
        "id": "Organization.partOf",
        "path": "Organization.partOf",
        "comment": "Prohibited on update. PCM preserves the authenticated client's Parent.",
        "max": "0"
      },
      {
        "id": "Organization.contact",
        "path": "Organization.contact",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "purpose.coding.code"
            }
          ],
          "rules": "open"
        },
        "comment": "Complete replacement for the optional child contact overrides. A missing purpose falls back to the Parent; an OPS contact SHOULD be supplied."
      },
      {
        "id": "Organization.contact.modifierExtension",
        "path": "Organization.contact.modifierExtension",
        "max": "0"
      },
      {
        "id": "Organization.contact.purpose",
        "path": "Organization.contact.purpose",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://pcm.fhir.health.gov.il/ValueSet/pcm-contactentity-type"
        }
      },
      {
        "id": "Organization.contact:operations",
        "path": "Organization.contact",
        "sliceName": "operations",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Organization.contact:operations.purpose.coding",
        "path": "Organization.contact.purpose.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Organization.contact:operations.purpose.coding.system",
        "path": "Organization.contact.purpose.coding.system",
        "min": 1,
        "fixedUri": "http://pcm.fhir.health.gov.il/cs/pcm-contactentity-type"
      },
      {
        "id": "Organization.contact:operations.purpose.coding.code",
        "path": "Organization.contact.purpose.coding.code",
        "min": 1,
        "fixedCode": "OPS"
      },
      {
        "id": "Organization.endpoint",
        "path": "Organization.endpoint",
        "comment": "Complete replacement for the registered Endpoint reference. PCM validates that the Endpoint belongs to this Data Source.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-endpoint"
            ]
          }
        ]
      },
      {
        "id": "Organization.endpoint.reference",
        "path": "Organization.endpoint.reference",
        "min": 1
      },
      {
        "id": "Organization.endpoint.identifier",
        "path": "Organization.endpoint.identifier",
        "max": "0"
      }
    ]
  }
}