<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="England-Bundle-PharmacyHubToSpoke" />
  <url value="https://fhir.nhs.uk/England/StructureDefinition/England-Bundle-PharmacyHubToSpoke" />
  <version value="0.1.0" />
  <name value="EnglandBundlePharmacyHubToSpoke" />
  <title value="England Bundle Pharmacy Hub To Spoke" />
  <status value="draft" />
  <date value="2025-12-04T00:00:00+00:00" />
  <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="Transaction Bundle Definition" />
  <purpose value="Documents the requirements for Hub to Spoke Pharmacy transactions" />
  <copyright value="Copyright © 2024+ NHS England 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="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <fixedCode value="transaction" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="profile" />
          <path value="resolve()" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Bundle.entry:Task">
      <path value="Bundle.entry" />
      <sliceName value="Task" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Bundle.entry:Task.resource">
      <path value="Bundle.entry.resource" />
      <comment value="The `Task.status` SHOULD be fixed to `completed` or `failed`" />
      <type>
        <code value="Resource" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Task" />
      </type>
    </element>
    <element id="Bundle.entry:MedicationDispense">
      <path value="Bundle.entry" />
      <sliceName value="MedicationDispense" />
      <comment value="The hub pharmacy implementation will decide on how MedicationDispense resources are bundled. For example; sent individually in separate bundles, bundles grouped by patient, or bundles containing multiple dispensed items for multiple patients." />
      <min value="1" />
    </element>
    <element id="Bundle.entry:MedicationDispense.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Resource" />
        <profile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationDispense" />
      </type>
    </element>
    <element id="Bundle.entry:Organisation">
      <path value="Bundle.entry" />
      <sliceName value="Organisation" />
      <definition value="Must provide the name and address of the performing hub pharmacy." />
      <comment value="Must provide the name and address of the requesting spoke pharmacy." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Bundle.entry:Organisation.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Resource" />
        <profile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization" />
      </type>
    </element>
  </differential>
</StructureDefinition>