<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="UKCore-Observation-LabGroup" />
  <url value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-LabGroup" />
  <version value="1.0.0" />
  <name value="UKCoreObservationLabGroup" />
  <title value="UK Core Observation Lab Group" />
  <status value="active" />
  <date value="2023-04-28" />
  <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 derived profile allows the grouping of multiple Observation-Lab tests to be referenced within the DiagnosticReport as a single display, e.g. Full Blood Count." />
  <purpose value="This profile allows the creation of a report for results borne from a single request panel, or profile, e.g. Full Blood Count, Lipid Profile, etc. allowing the results to be logically ordered according to the given profile and/or best practice guidelines." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
      <constraint>
        <key value="ukcore-obs-labgrp-001" />
        <severity value="warning" />
        <human value="value[x] SHOULD NOT be used within this Profile" />
        <expression value="value.empty()" />
      </constraint>
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="coding.code" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/observation-category" />
        </coding>
      </fixedCodeableConcept>
    </element>
    <element id="Observation.category:sliceLaboratory">
      <path value="Observation.category" />
      <sliceName value="sliceLaboratory" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.category:sliceLaboratory.coding.system">
      <path value="Observation.category.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/observation-category" />
    </element>
    <element id="Observation.category:sliceLaboratory.coding.code">
      <path value="Observation.category.coding.code" />
      <fixedCode value="laboratory" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <binding>
        <strength value="preferred" />
        <description value="A code from the SNOMED Clinical Terminology UK coding system regrading laboratory medicine test requests and results" />
        <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-UnifiedTestList" />
      </binding>
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient" />
      </type>
    </element>
    <element id="Observation.hasMember">
      <path value="Observation.hasMember" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-Lab" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-LabGroup" />
      </type>
    </element>
  </differential>
</StructureDefinition>