{
  "resourceType": "StructureDefinition",
  "id": "pcm-endpoint",
  "url": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-endpoint",
  "version": "0.3.2",
  "name": "PCMEndpoint",
  "title": "PCM Endpoint",
  "status": "active",
  "description": "Authoritative FHIR REST API Endpoint of a Data Source organization. The owning Data Source controls technical availability through status and may update the address under the documented transition rules. Identity, ownership, and certificate inventory remain PCM-controlled.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Endpoint",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Endpoint",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Endpoint.id",
        "path": "Endpoint.id",
        "min": 1
      },
      {
        "id": "Endpoint.meta",
        "path": "Endpoint.meta",
        "min": 1
      },
      {
        "id": "Endpoint.meta.lastUpdated",
        "path": "Endpoint.meta.lastUpdated",
        "comment": "Server-managed timestamp of the most recent authoritative resource change.",
        "min": 1
      },
      {
        "id": "Endpoint.meta.profile",
        "path": "Endpoint.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": "Endpoint.meta.profile:pcmProfile",
        "path": "Endpoint.meta.profile",
        "sliceName": "pcmProfile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-endpoint"
      },
      {
        "id": "Endpoint.extension",
        "path": "Endpoint.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Endpoint.extension:applicableCertificates",
        "path": "Endpoint.extension",
        "sliceName": "applicableCertificates",
        "comment": "PCM-managed read-only projection of certificate thumbprints explicitly associated with this Endpoint. 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": "Endpoint.status",
        "path": "Endpoint.status",
        "comment": "Technical availability declared by the owning Data Source: active is usable, suspended is temporarily unavailable, and off is terminal. Only active Endpoints are eligible for Data Source token issuance and active introspection. Endpoint state does not change Consent lifecycle.",
        "binding": {
          "strength": "required",
          "valueSet": "http://pcm.fhir.health.gov.il/ValueSet/pcm-endpoint-status"
        }
      },
      {
        "id": "Endpoint.connectionType",
        "path": "Endpoint.connectionType",
        "comment": "PCM endpoints are FHIR REST endpoints."
      },
      {
        "id": "Endpoint.connectionType.system",
        "path": "Endpoint.connectionType.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type"
      },
      {
        "id": "Endpoint.connectionType.code",
        "path": "Endpoint.connectionType.code",
        "min": 1,
        "fixedCode": "hl7-fhir-rest"
      },
      {
        "id": "Endpoint.name",
        "path": "Endpoint.name",
        "max": "0"
      },
      {
        "id": "Endpoint.managingOrganization",
        "path": "Endpoint.managingOrganization",
        "comment": "The Data Source organization that owns this endpoint.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://pcm.fhir.health.gov.il/StructureDefinition/pcm-organization-source"
            ]
          }
        ]
      },
      {
        "id": "Endpoint.managingOrganization.reference",
        "path": "Endpoint.managingOrganization.reference",
        "min": 1
      },
      {
        "id": "Endpoint.managingOrganization.identifier",
        "path": "Endpoint.managingOrganization.identifier",
        "max": "0"
      },
      {
        "id": "Endpoint.contact",
        "path": "Endpoint.contact",
        "max": "0"
      },
      {
        "id": "Endpoint.period",
        "path": "Endpoint.period",
        "max": "0"
      },
      {
        "id": "Endpoint.payloadType",
        "path": "Endpoint.payloadType",
        "comment": "General payload coding for a FHIR REST Endpoint. Supported resources and interactions are defined by the Data Source CapabilityStatement; this value does not widen authorization.",
        "max": "1",
        "fixedCodeableConcept": {
          "coding": [
            {
              "code": "any",
              "system": "http://terminology.hl7.org/CodeSystem/endpoint-payload-type"
            }
          ]
        }
      },
      {
        "id": "Endpoint.payloadType.coding",
        "path": "Endpoint.payloadType.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Endpoint.payloadMimeType",
        "path": "Endpoint.payloadMimeType",
        "max": "0"
      },
      {
        "id": "Endpoint.address",
        "path": "Endpoint.address",
        "comment": "Base URL of the organization's FHIR REST API and the exact OAuth resource/audience for Data Source access. A change invalidates authorization for the previous address."
      },
      {
        "id": "Endpoint.header",
        "path": "Endpoint.header",
        "max": "0"
      }
    ]
  }
}