{
  "resourceType": "StructureDefinition",
  "id": "pcm-healthcareservice-instance",
  "url": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-instance",
  "version": "0.1.6",
  "name": "PCMHealthcareServiceInstance",
  "title": "PCM HealthcareService Instance",
  "status": "active",
  "description": "Association between a specific Service Provider organization and a specific catalog HealthcareService. Referenced from Consent. Most content is inherited from the catalog entry. Created by organizations; inherited elements are read-only.",
  "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.meta.profile",
        "path": "HealthcareService.meta.profile",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "comment": "PCM server SHOULD populate meta.profile to declare conformance. This profile requires that the instance profile URL is present.",
        "min": 1
      },
      {
        "id": "HealthcareService.meta.profile:pcmCatalogProfile",
        "path": "HealthcareService.meta.profile",
        "sliceName": "pcmCatalogProfile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-healthcareservice-instance"
      },
      {
        "id": "HealthcareService.meta.tag",
        "path": "HealthcareService.meta.tag",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "comment": "Optional classification tag for workflow/search (_tag).",
        "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": "instance"
      },
      {
        "id": "HealthcareService.extension",
        "path": "HealthcareService.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 5
      },
      {
        "id": "HealthcareService.extension:basedOn",
        "path": "HealthcareService.extension",
        "sliceName": "basedOn",
        "comment": "Points to the catalog entry from which all non-metadata content is inherited.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-based-on-canonical-healthcareservice"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:approvalWindow",
        "path": "HealthcareService.extension",
        "sliceName": "approvalWindow",
        "comment": "Managed by PCM to indicate the approval period.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-approval-window"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:accessMode",
        "path": "HealthcareService.extension",
        "sliceName": "accessMode",
        "comment": "PCM copies this into Consent.category (access mode) on Consent creation.",
        "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": "PCM uses this to derive Consent.provision.period on Consent creation.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-access-duration"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:allowPatientBucketChange",
        "path": "HealthcareService.extension",
        "sliceName": "allowPatientBucketChange",
        "comment": "Whether patient can customize buckets when consenting.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-allow-patient-basket-change"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.extension:informationBucket",
        "path": "HealthcareService.extension",
        "sliceName": "informationBucket",
        "comment": "Definition of buckets included in this service.",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-information-bucket"
            ]
          }
        ]
      },
      {
        "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.active",
        "path": "HealthcareService.active",
        "comment": "Instance is activated after required approvals or after waiting period. Service Provider may deactivate immediately.",
        "min": 1
      },
      {
        "id": "HealthcareService.providedBy",
        "path": "HealthcareService.providedBy",
        "comment": "Always filled by the server based on access token/certificate.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-organization-service-provider"
            ]
          }
        ]
      },
      {
        "id": "HealthcareService.providedBy.identifier",
        "path": "HealthcareService.providedBy.identifier",
        "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": "Detailed description of the service for implementers and users.",
        "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"
      }
    ]
  }
}