<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="UKCore-Observation-Lab" />
  <url value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-Lab" />
  <version value="3.0.0" />
  <name value="UKCoreObservationLab" />
  <title value="UK Core Observation Lab" />
  <status value="active" />
  <date value="2026-02-25" />
  <publisher value="HL7 UK" />
  <contact>
    <name value="HL7 UK" />
    <telecom>
      <system value="email" />
      <value value="ukcore@hl7.org.uk" />
      <use value="work" />
      <rank value="1" />
    </telecom>
  </contact>
  <description value="This profile defines the UK constraints and extensions on the International FHIR resource [Observation](https://hl7.org/fhir/R4/Observation.html), in order to represent an individual laboratory test and result value. These tests can be grouped together using the UKCore-Observation-Group-Lab profile." />
  <purpose value="To provide the minimum expectations for each individual laboratory test." />
  <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="Observation" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
      <constraint>
        <key value="ukcore-obs-lab-001" />
        <severity value="warning" />
        <human value="Either `value`, `dataAbsentReason` or `note` SHOULD be populated" />
        <expression value="value.exists() or dataAbsentReason.exists() or note.exists()" />
      </constraint>
    </element>
    <element id="Observation.extension:ObservationOrganizer">
      <path value="Observation.extension" />
      <sliceName value="ObservationOrganizer" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/6.0/StructureDefinition/extension-Observation.organizer" />
      </type>
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <short value="The status of the result value." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="coding.code" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="A code that classifies the general type of observation being made." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category:laboratory">
      <path value="Observation.category" />
      <sliceName value="laboratory" />
      <short value="A mandatory code, to identify this observation as being Lab related." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category:laboratory.coding.system">
      <path value="Observation.category.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/observation-category" />
    </element>
    <element id="Observation.category:laboratory.coding.code">
      <path value="Observation.category.coding.code" />
      <fixedCode value="laboratory" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <short value="The type of lab related observation (code / type)." />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <description value="A code from the SNOMED Clinical Terminology UK coding system regarding laboratory medicine test results" />
        <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyAndLaboratoryMedicineObservables" />
      </binding>
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
    <element id="Observation.bodySite">
      <path value="Observation.bodySite" />
      <binding>
        <strength value="preferred" />
      </binding>
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
      <binding>
        <strength value="preferred" />
      </binding>
    </element>
  </differential>
</StructureDefinition>