{
  "resourceType": "StructureDefinition",
  "id": "UKCore-Observation-LabGroup",
  "url": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-LabGroup",
  "version": "1.0.0",
  "name": "UKCoreObservationLabGroup",
  "title": "UK Core Observation Lab Group",
  "status": "active",
  "date": "2023-04-28",
  "publisher": "HL7 UK",
  "contact": [
    {
      "name": "HL7 UK",
      "telecom": [
        {
          "system": "email",
          "value": "ukcore@hl7.org.uk",
          "use": "work",
          "rank": 1
        }
      ]
    }
  ],
  "description": "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": "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": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "constraint": [
          {
            "key": "ukcore-obs-labgrp-001",
            "severity": "warning",
            "human": "value[x] SHOULD NOT be used within this Profile",
            "expression": "value.empty()"
          }
        ]
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.code"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "fixedCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/observation-category"
            }
          ]
        }
      },
      {
        "id": "Observation.category:sliceLaboratory",
        "path": "Observation.category",
        "sliceName": "sliceLaboratory",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.category:sliceLaboratory.coding.system",
        "path": "Observation.category.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/observation-category"
      },
      {
        "id": "Observation.category:sliceLaboratory.coding.code",
        "path": "Observation.category.coding.code",
        "fixedCode": "laboratory"
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "binding": {
          "strength": "preferred",
          "description": "A code from the SNOMED Clinical Terminology UK coding system regrading laboratory medicine test requests and results",
          "valueSet": "https://fhir.hl7.org.uk/ValueSet/UKCore-UnifiedTestList"
        }
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient"
            ]
          }
        ]
      },
      {
        "id": "Observation.hasMember",
        "path": "Observation.hasMember",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-Lab",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Observation-LabGroup"
            ]
          }
        ]
      }
    ]
  }
}