<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="England-Bundle-Lab-Pathology" />
  <url value="https://fhir.nhs.uk/England/StructureDefinition/England-Bundle-Lab-Pathology" />
  <version value="0.1.0" />
  <name value="EnglandBundleLabPathology" />
  <title value="England Bundle Lab Pathology" />
  <status value="draft" />
  <date value="2026-08-17" />
  <publisher value="NHS England" />
  <contact>
    <name value="NHS England" />
    <telecom>
      <system value="email" />
      <value value="england.interoperabilityteam@nhs.net" />
      <use value="work" />
      <rank value="1" />
    </telecom>
  </contact>
  <description value="&quot;This profile defines the NHSE constraints and extensions on the FHIR resource, in order to represent a bundle of pathology tests within the system." />
  <purpose value="This profile ensures the identification and standardisation of the document bundle within the Pathology project which includes the correct information and routing of the information between systems." />
  <copyright value="Copyright © 2021+ 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="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.eu/fhir/laboratory/StructureDefinition/Bundle-eu-lab" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle">
      <path value="Bundle" />
      <constraint>
        <key value="nhse-prov-1" />
        <severity value="error" />
        <human value="One Provenance Resource Instance SHALL exist within the Bundle that conforms to England-Provenance-Lab-Pathology" />
        <expression value="entry.resource.ofType(Provenance).where(conformsTo('https://fhir.nhs.uk/England/StructureDefinition/England-Provenance-Lab-Pathology')).count() = 1" />
      </constraint>
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <min value="3" />
    </element>
    <element id="Bundle.entry:specimen">
      <path value="Bundle.entry" />
      <sliceName value="specimen" />
    </element>
    <element id="Bundle.entry:specimen.resource.container.extension">
      <path value="Bundle.entry.resource.container.extension" />
      <min value="1" />
    </element>
    <element id="Bundle.entry:bodyStructure">
      <path value="Bundle.entry" />
      <sliceName value="bodyStructure" />
    </element>
    <element id="Bundle.entry:bodyStructure.resource.extension">
      <path value="Bundle.entry.resource.extension" />
      <min value="1" />
    </element>
    <element id="Bundle.entry:bodyStructure.resource.extension:includedStructure">
      <path value="Bundle.entry.resource.extension" />
      <sliceName value="includedStructure" />
    </element>
    <element id="Bundle.entry:bodyStructure.resource.extension:includedStructure.extension:bodyLandmarkOrientation">
      <path value="Bundle.entry.resource.extension.extension" />
      <sliceName value="bodyLandmarkOrientation" />
    </element>
    <element id="Bundle.entry:bodyStructure.resource.extension:includedStructure.extension:bodyLandmarkOrientation.extension:distanceFromLandmark">
      <path value="Bundle.entry.resource.extension.extension.extension" />
      <sliceName value="distanceFromLandmark" />
    </element>
    <element id="Bundle.entry:bodyStructure.resource.extension:includedStructure.extension:bodyLandmarkOrientation.extension:distanceFromLandmark.extension:device">
      <path value="Bundle.entry.resource.extension.extension.extension.extension" />
      <sliceName value="device" />
    </element>
    <element id="Bundle.entry:bodyStructure.resource.extension:includedStructure.extension:bodyLandmarkOrientation.extension:distanceFromLandmark.extension:device.extension">
      <path value="Bundle.entry.resource.extension.extension.extension.extension.extension" />
      <min value="1" />
    </element>
    <element id="Bundle.entry:provenance">
      <path value="Bundle.entry" />
      <sliceName value="provenance" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>