{
  "resourceType": "StructureDefinition",
  "id": "pcm-organization-service-provider",
  "url": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-organization-service-provider",
  "version": "0.4.2",
  "name": "PCMOrganizationServiceProvider",
  "title": "PCM Service Provider Organization",
  "status": "active",
  "description": "PCM role child that provides services to end-users and initiates Consent requests. PCM controls its identity, Parent link, role, policy state, and OAuth registration projection. An organization may create this child through the documented request interaction only after PCM authorizes Service Provider expansion. The organization may maintain purpose-coded contact overrides; PCM populates the optional redirect URI from its authoritative OAuth client registration.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Organization",
  "baseDefinition": "http://fhir.health.gov.il/StructureDefinition/il-core-organization",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Organization.id",
        "path": "Organization.id",
        "min": 1
      },
      {
        "id": "Organization.meta",
        "path": "Organization.meta",
        "min": 1
      },
      {
        "id": "Organization.meta.lastUpdated",
        "path": "Organization.meta.lastUpdated",
        "comment": "Server-managed timestamp of the most recent authoritative resource change.",
        "min": 1
      },
      {
        "id": "Organization.meta.profile",
        "path": "Organization.meta.profile",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "comment": "PCM includes the applicable server-return profile URL; additional compatible profile URLs are allowed.",
        "min": 1
      },
      {
        "id": "Organization.meta.profile:pcmProfile",
        "path": "Organization.meta.profile",
        "sliceName": "pcmProfile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-organization-service-provider"
      },
      {
        "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": "PCM-managed read-only projection of the fixed, fully specified redirect URI registered for the primary standalone SMART application. It may be absent until that OAuth application is registered and is prohibited in client create/update requests.",
        "min": 0,
        "max": "1",
        "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": "PCM-managed read-only projection of certificate thumbprints explicitly associated with this Service Provider. The inventory is not a complete trust-store view, proof of current certificate use, or an authorization decision.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/ext-applicable-certificates"
            ]
          }
        ]
      },
      {
        "id": "Organization.identifier",
        "path": "Organization.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "closed"
        },
        "comment": "The single PCM Organization business identifier is assigned and managed by PCM. Child Organizations do not copy the Parent's MoH identifier.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Organization.identifier:moh-inst-symbol",
        "path": "Organization.identifier",
        "sliceName": "moh-inst-symbol",
        "max": "0"
      },
      {
        "id": "Organization.identifier:legal-entity",
        "path": "Organization.identifier",
        "sliceName": "legal-entity",
        "max": "0"
      },
      {
        "id": "Organization.identifier:moe-inst",
        "path": "Organization.identifier",
        "sliceName": "moe-inst",
        "max": "0"
      },
      {
        "id": "Organization.identifier:moh-hospital-department",
        "path": "Organization.identifier",
        "sliceName": "moh-hospital-department",
        "max": "0"
      },
      {
        "id": "Organization.identifier:paying-entity-moh",
        "path": "Organization.identifier",
        "sliceName": "paying-entity-moh",
        "max": "0"
      },
      {
        "id": "Organization.identifier:pcmOrganizationId",
        "path": "Organization.identifier",
        "sliceName": "pcmOrganizationId",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Organization.identifier:pcmOrganizationId.use",
        "path": "Organization.identifier.use",
        "min": 1,
        "fixedCode": "official"
      },
      {
        "id": "Organization.identifier:pcmOrganizationId.system",
        "path": "Organization.identifier.system",
        "fixedUri": "http://pcm.fhir.health.gov.il/identifier/pcm-organization-id"
      },
      {
        "id": "Organization.active",
        "path": "Organization.active",
        "comment": "MoH/PCM-controlled participation state. The owning organization cannot change it through the client FHIR API. Operational use also requires the Parent Organization to be active.",
        "min": 1
      },
      {
        "id": "Organization.type",
        "path": "Organization.type",
        "min": 2
      },
      {
        "id": "Organization.type:pcmOrgType",
        "path": "Organization.type",
        "sliceName": "pcmOrgType",
        "comment": "Marks this Organization as a PCM Service Provider.",
        "min": 1,
        "max": "1",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "service-provider",
              "system": "http://pcm.fhir.health.gov.il/cs/pcm-org-type"
            }
          ]
        }
      },
      {
        "id": "Organization.type:pcmOrgType.coding",
        "path": "Organization.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Organization.type:pcmOrgType.coding.system",
        "path": "Organization.type.coding.system",
        "min": 1,
        "fixedUri": "http://pcm.fhir.health.gov.il/cs/pcm-org-type"
      },
      {
        "id": "Organization.type:pcmOrgType.coding.code",
        "path": "Organization.type.coding.code",
        "min": 1,
        "fixedCode": "service-provider"
      },
      {
        "id": "Organization.name",
        "path": "Organization.name",
        "comment": "Authoritative Service Provider child name maintained by PCM."
      },
      {
        "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": "PCM-managed reference to the Parent Organization. Parent inactive state disables this child for operational use.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-organization-parent"
            ],
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy",
                "valueBoolean": true
              }
            ]
          }
        ]
      },
      {
        "id": "Organization.partOf.reference",
        "path": "Organization.partOf.reference",
        "min": 1
      },
      {
        "id": "Organization.partOf.identifier",
        "path": "Organization.partOf.identifier",
        "max": "0"
      },
      {
        "id": "Organization.contact",
        "path": "Organization.contact",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "purpose.coding.code"
            }
          ],
          "rules": "open"
        },
        "comment": "Optional purpose-coded contact overrides. A missing purpose falls back to the matching Parent contact. An OPS contact SHOULD be supplied when the service/application operations contact differs from the Parent."
      },
      {
        "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",
        "max": "0"
      }
    ]
  }
}