<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Extension-England-OrganizationEndpointOrder" />
  <url value="https://fhir.nhs.uk/England/StructureDefinition/Extension-England-OrganizationEndpointOrder" />
  <version value="0.1.0" />
  <name value="ExtensionEnglandOrganizationEndpointOrder" />
  <title value="Extension England Organization Endpoint Order" />
  <status value="draft" />
  <date value="2025-07-21" />
  <publisher value="NHS England" />
  <contact>
    <name value="NHS England" />
    <telecom>
      <system value="email" />
      <value value="interoperabilityteam@nhs.net" />
      <use value="work" />
      <rank value="1" />
    </telecom>
  </contact>
  <description value="The Organization Endpoint Order extension is used to provide a priority ranking for endpoints associated with an Organization resource, allowing systems to determine the preferred order of endpoint usage." />
  <purpose value="This extension is a Directory of Service (DoS) use case, Enables prioritization of multiple endpoints for an Organization, supporting scenarios where organizations have multiple communication channels or services that need to be accessed in a specific order of preference." />
  <copyright value="Copyright © 2025+ HL7 UK Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at  https://www.hl7.org/fhir/license.html." />
  <fhirVersion value="4.0.1" />
  <kind value="complex-type" />
  <abstract value="false" />
  <context>
    <type value="element" />
    <expression value="Endpoint" />
  </context>
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension">
      <path value="Extension" />
      <max value="1" />
    </element>
    <element id="Extension.extension">
      <path value="Extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <fixedUri value="https://fhir.nhs.uk/England/StructureDefinition/Extension-England-OrganizationEndpointOrder" />
    </element>
    <element id="Extension.value[x]">
      <path value="Extension.value[x]" />
      <short value="Priority order for the endpoint" />
      <definition value="An integer value representing the priority order of this endpoint relative to other endpoints for the same organization. Lower numbers indicate higher priority (e.g., 1 = highest priority, 2 = second priority, etc.)." />
      <min value="1" />
      <type>
        <code value="integer" />
      </type>
      <constraint>
        <key value="nhse-endp-001" />
        <severity value="error" />
        <human value="Endpoint order must be a positive integer" />
        <expression value="value.integer &gt; 0" />
      </constraint>
    </element>
  </differential>
</StructureDefinition>