<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="England-Bundle-PharmacySpokeToHub" />
  <url value="https://fhir.nhs.uk/England/StructureDefinition/England-Bundle-PharmacySpokeToHub" />
  <version value="0.1.0" />
  <name value="EnglandBundlePharmacySpokeToHub" />
  <title value="England Bundle Pharmacy Spoke To Hub" />
  <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 Spoke to Hub 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 `requested`" />
      <type>
        <code value="Resource" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Task" />
      </type>
    </element>
    <element id="Bundle.entry:MedicationRequest">
      <path value="Bundle.entry" />
      <sliceName value="MedicationRequest" />
      <comment value="The spoke pharmacy implementation, in agreement with their hub pharmacy, will decide on how MedicationRequest resources are bundled. For example sent individually in separate bundles, bundles grouped by patient, or bundles containing multiple prescribed items for multiple patients." />
      <min value="1" />
    </element>
    <element id="Bundle.entry:MedicationRequest.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Resource" />
        <profile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest" />
      </type>
    </element>
    <element id="Bundle.entry:Patient">
      <path value="Bundle.entry" />
      <sliceName value="Patient" />
      <min value="1" />
    </element>
    <element id="Bundle.entry:Patient.resource">
      <path value="Bundle.entry.resource" />
      <comment value="Must provide each patient's name, NHS Number (if known), date of birth and address." />
      <type>
        <code value="Resource" />
        <profile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient" />
      </type>
    </element>
    <element id="Bundle.entry:Organisation">
      <path value="Bundle.entry" />
      <sliceName value="Organisation" />
      <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>