{
  "resourceType": "StructureDefinition",
  "id": "pcm-healthcareservice-catalog-update-proposal",
  "url": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-catalog-update-proposal",
  "version": "0.3.2",
  "name": "PCMHealthcareServiceCatalogUpdateProposal",
  "title": "PCM HealthcareService Catalog Update Proposal",
  "status": "active",
  "description": "Complete canonical HealthcareService representation carried inside $request-catalog-update for semantic comparison with the authoritative catalog resource. This is not a direct HealthcareService write profile, so the fixed catalog classification tag remains required as part of the complete representation. PCM-managed values must match, except that representation-neutral content and unknown ordinary non-modifier extensions are ignored before comparison. Unsupported modifier extensions are prohibited.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "HealthcareService",
  "baseDefinition": "http://fhir.health.gov.il/StructureDefinition/il-core-healthcare-service",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "HealthcareService",
        "path": "HealthcareService",
        "constraint": [
          {
            "key": "pcm-hcs-active-business-status-map",
            "severity": "error",
            "human": "HealthcareService.active is true if and only if the PCM service business status is active.",
            "expression": "(active = true) = (extension.where(url = 'http://pcm.fhir.health.gov.il/StructureDefinition/ext-service-business-status').value.ofType(Coding).code = 'active')",
            "source": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-catalog-update-proposal"
          },
          {
            "key": "pcm-hcs-catalog-no-suspended",
            "severity": "error",
            "human": "The suspended business status is valid only for provider-specific HealthcareService instances.",
            "expression": "extension.where(url = 'http://pcm.fhir.health.gov.il/StructureDefinition/ext-service-business-status').value.ofType(Coding).code != 'suspended'",
            "source": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-catalog-update-proposal"
          },
          {
            "key": "pcm-hcs-information-bucket-code-unique",
            "severity": "error",
            "human": "Each IL HDP information-bucket code may appear at most once in a PCM HealthcareService.",
            "expression": "extension.where(url = 'http://pcm.fhir.health.gov.il/StructureDefinition/ext-information-bucket').extension.where(url = 'bucket').value.ofType(CodeableConcept).coding.where(system = 'http://fhir.health.gov.il/cs/il-hdp-information-buckets').code.isDistinct()",
            "source": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-catalog-update-proposal"
          }
        ]
      },
      {
        "id": "HealthcareService.id",
        "path": "HealthcareService.id",
        "min": 1
      },
      {
        "id": "HealthcareService.meta",
        "path": "HealthcareService.meta",
        "min": 1
      },
      {
        "id": "HealthcareService.meta.versionId",
        "path": "HealthcareService.meta.versionId",
        "comment": "Optional metadata copied from the retrieved canonical. PCM removes it before semantic comparison; it does not provide optimistic concurrency."
      },
      {
        "id": "HealthcareService.meta.lastUpdated",
        "path": "HealthcareService.meta.lastUpdated",
        "comment": "Optional metadata copied from the retrieved canonical. PCM removes it before semantic comparison; it does not provide optimistic concurrency."
      },
      {
        "id": "HealthcareService.meta.profile",
        "path": "HealthcareService.meta.profile",
        "comment": "Clients may assert this catalog-update proposal profile, but PCM validates the proposed representation independently and does not require this declaration."
      },
      {
        "id": "HealthcareService.meta.tag",
        "path": "HealthcareService.meta.tag",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "comment": "PCM-managed HealthcareService classification tags. The catalog tag is required on complete catalog representations; additional tags from other systems are allowed.",
        "min": 1
      },
      {
        "id": "HealthcareService.meta.tag:pcmCatalogTag",
        "path": "HealthcareService.meta.tag",
        "sliceName": "pcmCatalogTag",
        "min": 1,
        "max": "1"
      },
      {
        "id": "HealthcareService.meta.tag:pcmCatalogTag.system",
        "path": "HealthcareService.meta.tag.system",
        "min": 1,
        "fixedUri": "http://pcm.fhir.health.gov.il/cs/pcm-meta-tag"
      },
      {
        "id": "HealthcareService.meta.tag:pcmCatalogTag.code",
        "path": "HealthcareService.meta.tag.code",
        "min": 1,
        "fixedCode": "catalog"
      },
      {
        "id": "HealthcareService.extension",
        "path": "HealthcareService.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 6
      },
      {
        "id": "HealthcareService.extension:businessStatus",
        "path": "HealthcareService.extension",
        "sliceName": "businessStatus",
        "comment": "PCM/MoH-managed business/regulatory lifecycle status. Provider-instance suspended is not valid on a canonical service. Clients cannot set catalog lifecycle through create/update.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-service-business-status"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:basedOn",
        "path": "HealthcareService.extension",
        "sliceName": "basedOn",
        "comment": "Prohibited on catalog resources; only provider-specific instances link to a canonical service.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-based-on-canonical-healthcareservice"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:accessMode",
        "path": "HealthcareService.extension",
        "sliceName": "accessMode",
        "comment": "Requested/default Consent access mode. PCM initializes the proposed Consent from this value; an authorized patient decision, including an assisted or delegated flow, may narrow continuous access to one-time.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-access-mode"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:accessDuration",
        "path": "HealthcareService.extension",
        "sliceName": "accessDuration",
        "comment": "Maximum permitted Consent duration. PCM establishes the approval-anchored Consent period within this ceiling; an authorized patient decision, including an assisted or delegated flow, may approve a shorter period or later shorten it.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-access-duration"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:exampleQuery",
        "path": "HealthcareService.extension",
        "sliceName": "exampleQuery",
        "comment": "Example FHIR queries for implementers.",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-example-query"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:allowPatientBucketChange",
        "path": "HealthcareService.extension",
        "sliceName": "allowPatientBucketChange",
        "comment": "Whether the patient may narrow the approved information buckets outside the public FHIR API. Normally false; true requires explicit PCM/MoH approval.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-allow-patient-bucket-change"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:informationBucket",
        "path": "HealthcareService.extension",
        "sliceName": "informationBucket",
        "comment": "Definition of buckets included in this service. Each IL HDP information-bucket code may occur only once; PCM rejects the complete resource when a code is repeated.",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-information-bucket"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.modifierExtension",
        "path": "HealthcareService.modifierExtension",
        "comment": "Unsupported modifier extensions are prohibited in the proposed request resource. Unknown ordinary non-modifier extensions are accepted without interpretation, ignored before semantic comparison, and are not guaranteed to round-trip.",
        "max": "0"
      },
      {
        "id": "HealthcareService.identifier",
        "path": "HealthcareService.identifier",
        "comment": "PCM-managed stable business identifier of the catalog service definition. It is distinct from the FHIR logical id.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "HealthcareService.identifier.use",
        "path": "HealthcareService.identifier.use",
        "min": 1,
        "fixedCode": "official"
      },
      {
        "id": "HealthcareService.identifier.system",
        "path": "HealthcareService.identifier.system",
        "min": 1,
        "fixedUri": "http://pcm.fhir.health.gov.il/identifier/pcm-healthcareservice-catalog-id"
      },
      {
        "id": "HealthcareService.identifier.value",
        "path": "HealthcareService.identifier.value",
        "min": 1
      },
      {
        "id": "HealthcareService.active",
        "path": "HealthcareService.active",
        "comment": "PCM-managed effective usability. It is true if and only if businessStatus is active.",
        "min": 1
      },
      {
        "id": "HealthcareService.providedBy",
        "path": "HealthcareService.providedBy",
        "comment": "Catalog entry is not tied to a specific provider organization.",
        "max": "0"
      },
      {
        "id": "HealthcareService.category",
        "path": "HealthcareService.category",
        "comment": "At least one category is required. Binding is extensible to allow PCM-specific additions later; currently includes HL7 service-category.",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://pcm.fhir.health.gov.il/ValueSet/pcm-healthcareservice-category"
        }
      },
      {
        "id": "HealthcareService.type",
        "path": "HealthcareService.type",
        "comment": "Hardcoded: the service type is information access (INFA).",
        "min": 1,
        "max": "1",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "INFA",
              "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
              "display": "information access"
            }
          ]
        }
      },
      {
        "id": "HealthcareService.specialty",
        "path": "HealthcareService.specialty",
        "max": "0"
      },
      {
        "id": "HealthcareService.location",
        "path": "HealthcareService.location",
        "max": "0"
      },
      {
        "id": "HealthcareService.name",
        "path": "HealthcareService.name",
        "min": 1
      },
      {
        "id": "HealthcareService.comment",
        "path": "HealthcareService.comment",
        "max": "0"
      },
      {
        "id": "HealthcareService.extraDetails",
        "path": "HealthcareService.extraDetails",
        "comment": "Concise patient-facing service description, including why the requested information buckets are needed.",
        "min": 1
      },
      {
        "id": "HealthcareService.photo",
        "path": "HealthcareService.photo",
        "max": "0"
      },
      {
        "id": "HealthcareService.telecom",
        "path": "HealthcareService.telecom",
        "max": "0"
      },
      {
        "id": "HealthcareService.coverageArea",
        "path": "HealthcareService.coverageArea",
        "max": "0"
      },
      {
        "id": "HealthcareService.serviceProvisionCode",
        "path": "HealthcareService.serviceProvisionCode",
        "max": "0"
      },
      {
        "id": "HealthcareService.eligibility",
        "path": "HealthcareService.eligibility",
        "max": "0"
      },
      {
        "id": "HealthcareService.program",
        "path": "HealthcareService.program",
        "max": "0"
      },
      {
        "id": "HealthcareService.characteristic",
        "path": "HealthcareService.characteristic",
        "max": "0"
      },
      {
        "id": "HealthcareService.communication",
        "path": "HealthcareService.communication",
        "max": "0"
      },
      {
        "id": "HealthcareService.referralMethod",
        "path": "HealthcareService.referralMethod",
        "max": "0"
      },
      {
        "id": "HealthcareService.appointmentRequired",
        "path": "HealthcareService.appointmentRequired",
        "max": "0"
      },
      {
        "id": "HealthcareService.availableTime",
        "path": "HealthcareService.availableTime",
        "max": "0"
      },
      {
        "id": "HealthcareService.notAvailable",
        "path": "HealthcareService.notAvailable",
        "max": "0"
      },
      {
        "id": "HealthcareService.availabilityExceptions",
        "path": "HealthcareService.availabilityExceptions",
        "max": "0"
      },
      {
        "id": "HealthcareService.endpoint",
        "path": "HealthcareService.endpoint",
        "max": "0"
      }
    ]
  }
}