<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="pcm-healthcareservice-catalog-update-proposal" />
  <url value="http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-catalog-update-proposal" />
  <version value="0.3.2" />
  <name value="PCMHealthcareServiceCatalogUpdateProposal" />
  <title value="PCM HealthcareService Catalog Update Proposal" />
  <status value="active" />
  <description value="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 value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="HealthcareService" />
  <baseDefinition value="http://fhir.health.gov.il/StructureDefinition/il-core-healthcare-service" />
  <derivation value="constraint" />
  <differential>
    <element id="HealthcareService">
      <path value="HealthcareService" />
      <constraint>
        <key value="pcm-hcs-active-business-status-map" />
        <severity value="error" />
        <human value="HealthcareService.active is true if and only if the PCM service business status is active." />
        <expression value="(active = true) = (extension.where(url = 'http://pcm.fhir.health.gov.il/StructureDefinition/ext-service-business-status').value.ofType(Coding).code = 'active')" />
        <source value="http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-catalog-update-proposal" />
      </constraint>
      <constraint>
        <key value="pcm-hcs-catalog-no-suspended" />
        <severity value="error" />
        <human value="The suspended business status is valid only for provider-specific HealthcareService instances." />
        <expression value="extension.where(url = 'http://pcm.fhir.health.gov.il/StructureDefinition/ext-service-business-status').value.ofType(Coding).code != 'suspended'" />
        <source value="http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-catalog-update-proposal" />
      </constraint>
      <constraint>
        <key value="pcm-hcs-information-bucket-code-unique" />
        <severity value="error" />
        <human value="Each IL HDP information-bucket code may appear at most once in a PCM HealthcareService." />
        <expression value="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 value="http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-catalog-update-proposal" />
      </constraint>
    </element>
    <element id="HealthcareService.id">
      <path value="HealthcareService.id" />
      <min value="1" />
    </element>
    <element id="HealthcareService.meta">
      <path value="HealthcareService.meta" />
      <min value="1" />
    </element>
    <element id="HealthcareService.meta.versionId">
      <path value="HealthcareService.meta.versionId" />
      <comment value="Optional metadata copied from the retrieved canonical. PCM removes it before semantic comparison; it does not provide optimistic concurrency." />
    </element>
    <element id="HealthcareService.meta.lastUpdated">
      <path value="HealthcareService.meta.lastUpdated" />
      <comment value="Optional metadata copied from the retrieved canonical. PCM removes it before semantic comparison; it does not provide optimistic concurrency." />
    </element>
    <element id="HealthcareService.meta.profile">
      <path value="HealthcareService.meta.profile" />
      <comment value="Clients may assert this catalog-update proposal profile, but PCM validates the proposed representation independently and does not require this declaration." />
    </element>
    <element id="HealthcareService.meta.tag">
      <path value="HealthcareService.meta.tag" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <comment value="PCM-managed HealthcareService classification tags. The catalog tag is required on complete catalog representations; additional tags from other systems are allowed." />
      <min value="1" />
    </element>
    <element id="HealthcareService.meta.tag:pcmCatalogTag">
      <path value="HealthcareService.meta.tag" />
      <sliceName value="pcmCatalogTag" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="HealthcareService.meta.tag:pcmCatalogTag.system">
      <path value="HealthcareService.meta.tag.system" />
      <min value="1" />
      <fixedUri value="http://pcm.fhir.health.gov.il/cs/pcm-meta-tag" />
    </element>
    <element id="HealthcareService.meta.tag:pcmCatalogTag.code">
      <path value="HealthcareService.meta.tag.code" />
      <min value="1" />
      <fixedCode value="catalog" />
    </element>
    <element id="HealthcareService.extension">
      <path value="HealthcareService.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="6" />
    </element>
    <element id="HealthcareService.extension:businessStatus">
      <path value="HealthcareService.extension" />
      <sliceName value="businessStatus" />
      <comment value="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 value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://pcm.fhir.health.gov.il/StructureDefinition/ext-service-business-status" />
      </type>
    </element>
    <element id="HealthcareService.extension:basedOn">
      <path value="HealthcareService.extension" />
      <sliceName value="basedOn" />
      <comment value="Prohibited on catalog resources; only provider-specific instances link to a canonical service." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Extension" />
        <profile value="http://pcm.fhir.health.gov.il/StructureDefinition/ext-based-on-canonical-healthcareservice" />
      </type>
    </element>
    <element id="HealthcareService.extension:accessMode">
      <path value="HealthcareService.extension" />
      <sliceName value="accessMode" />
      <comment value="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 value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://pcm.fhir.health.gov.il/StructureDefinition/ext-access-mode" />
      </type>
    </element>
    <element id="HealthcareService.extension:accessDuration">
      <path value="HealthcareService.extension" />
      <sliceName value="accessDuration" />
      <comment value="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 value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://pcm.fhir.health.gov.il/StructureDefinition/ext-access-duration" />
      </type>
    </element>
    <element id="HealthcareService.extension:exampleQuery">
      <path value="HealthcareService.extension" />
      <sliceName value="exampleQuery" />
      <comment value="Example FHIR queries for implementers." />
      <min value="1" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="http://pcm.fhir.health.gov.il/StructureDefinition/ext-example-query" />
      </type>
    </element>
    <element id="HealthcareService.extension:allowPatientBucketChange">
      <path value="HealthcareService.extension" />
      <sliceName value="allowPatientBucketChange" />
      <comment value="Whether the patient may narrow the approved information buckets outside the public FHIR API. Normally false; true requires explicit PCM/MoH approval." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://pcm.fhir.health.gov.il/StructureDefinition/ext-allow-patient-bucket-change" />
      </type>
    </element>
    <element id="HealthcareService.extension:informationBucket">
      <path value="HealthcareService.extension" />
      <sliceName value="informationBucket" />
      <comment value="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 value="1" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="http://pcm.fhir.health.gov.il/StructureDefinition/ext-information-bucket" />
      </type>
    </element>
    <element id="HealthcareService.modifierExtension">
      <path value="HealthcareService.modifierExtension" />
      <comment value="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 value="0" />
    </element>
    <element id="HealthcareService.identifier">
      <path value="HealthcareService.identifier" />
      <comment value="PCM-managed stable business identifier of the catalog service definition. It is distinct from the FHIR logical id." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="HealthcareService.identifier.use">
      <path value="HealthcareService.identifier.use" />
      <min value="1" />
      <fixedCode value="official" />
    </element>
    <element id="HealthcareService.identifier.system">
      <path value="HealthcareService.identifier.system" />
      <min value="1" />
      <fixedUri value="http://pcm.fhir.health.gov.il/identifier/pcm-healthcareservice-catalog-id" />
    </element>
    <element id="HealthcareService.identifier.value">
      <path value="HealthcareService.identifier.value" />
      <min value="1" />
    </element>
    <element id="HealthcareService.active">
      <path value="HealthcareService.active" />
      <comment value="PCM-managed effective usability. It is true if and only if businessStatus is active." />
      <min value="1" />
    </element>
    <element id="HealthcareService.providedBy">
      <path value="HealthcareService.providedBy" />
      <comment value="Catalog entry is not tied to a specific provider organization." />
      <max value="0" />
    </element>
    <element id="HealthcareService.category">
      <path value="HealthcareService.category" />
      <comment value="At least one category is required. Binding is extensible to allow PCM-specific additions later; currently includes HL7 service-category." />
      <min value="1" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://pcm.fhir.health.gov.il/ValueSet/pcm-healthcareservice-category" />
      </binding>
    </element>
    <element id="HealthcareService.type">
      <path value="HealthcareService.type" />
      <comment value="Hardcoded: the service type is information access (INFA)." />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
          <code value="INFA" />
          <display value="information access" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="HealthcareService.specialty">
      <path value="HealthcareService.specialty" />
      <max value="0" />
    </element>
    <element id="HealthcareService.location">
      <path value="HealthcareService.location" />
      <max value="0" />
    </element>
    <element id="HealthcareService.name">
      <path value="HealthcareService.name" />
      <min value="1" />
    </element>
    <element id="HealthcareService.comment">
      <path value="HealthcareService.comment" />
      <max value="0" />
    </element>
    <element id="HealthcareService.extraDetails">
      <path value="HealthcareService.extraDetails" />
      <comment value="Concise patient-facing service description, including why the requested information buckets are needed." />
      <min value="1" />
    </element>
    <element id="HealthcareService.photo">
      <path value="HealthcareService.photo" />
      <max value="0" />
    </element>
    <element id="HealthcareService.telecom">
      <path value="HealthcareService.telecom" />
      <max value="0" />
    </element>
    <element id="HealthcareService.coverageArea">
      <path value="HealthcareService.coverageArea" />
      <max value="0" />
    </element>
    <element id="HealthcareService.serviceProvisionCode">
      <path value="HealthcareService.serviceProvisionCode" />
      <max value="0" />
    </element>
    <element id="HealthcareService.eligibility">
      <path value="HealthcareService.eligibility" />
      <max value="0" />
    </element>
    <element id="HealthcareService.program">
      <path value="HealthcareService.program" />
      <max value="0" />
    </element>
    <element id="HealthcareService.characteristic">
      <path value="HealthcareService.characteristic" />
      <max value="0" />
    </element>
    <element id="HealthcareService.communication">
      <path value="HealthcareService.communication" />
      <max value="0" />
    </element>
    <element id="HealthcareService.referralMethod">
      <path value="HealthcareService.referralMethod" />
      <max value="0" />
    </element>
    <element id="HealthcareService.appointmentRequired">
      <path value="HealthcareService.appointmentRequired" />
      <max value="0" />
    </element>
    <element id="HealthcareService.availableTime">
      <path value="HealthcareService.availableTime" />
      <max value="0" />
    </element>
    <element id="HealthcareService.notAvailable">
      <path value="HealthcareService.notAvailable" />
      <max value="0" />
    </element>
    <element id="HealthcareService.availabilityExceptions">
      <path value="HealthcareService.availabilityExceptions" />
      <max value="0" />
    </element>
    <element id="HealthcareService.endpoint">
      <path value="HealthcareService.endpoint" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>