<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="NHSEngland-Specimen-Genomics" />
  <url value="https://fhir.nhs.uk/StructureDefinition/NHSEngland-Specimen-Genomics" />
  <version value="0.3.0" />
  <name value="NHSEngland_Specimen_Genomics" />
  <title value="NHSEngland Specimen Genomics" />
  <status value="active" />
  <date value="2026-04-16" />
  <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="This profile defines the Genomics constraints and extensions on the UK Core FHIR resource [Specimen](https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen)." />
  <purpose value="Used to capture information on Samples which will undergo or have undergone processing for genomic testing." />
  <copyright value="Copyright © 2026+ 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="Specimen" />
  <baseDefinition value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen" />
  <derivation value="constraint" />
  <differential>
    <element id="Specimen.extension:sampleCategory">
      <path value="Specimen.extension" />
      <sliceName value="sampleCategory" />
      <definition value="Allows the categorisation of a sample into either tumour or germline. Required for WGS Cancer Testing, though not currently part of the Order Management MDS. Additional terms may be added upon review though the valueCodeableConcept.text field MAY be used as a free text representation if needed." />
    </element>
    <element id="Specimen.identifier">
      <path value="Specimen.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="Multiple identifiers MAY be assigned to a sample as it travels between labs. Each lab SHOULD append their local identifier to the identifier array if needed, ensuring either the system or assigner, is able to disambiguate any identifiers from possibly overlapping numbers from other organizations. Assigner is preferred in this case (see identifier example on the UKCore-Patient page for further guidance)&#xD;&#xA;Note: accessionIdentifier is unused by the Genomic Medicine Service to facilitate movement of samples across organizational boundaries." />
      <min value="1" />
    </element>
    <element id="Specimen.identifier.assigner">
      <path value="Specimen.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/StructureDefinition/NHSEngland-Organization-Genomics" />
      </type>
    </element>
    <element id="Specimen.identifier:identifierGMSSpecimen">
      <path value="Specimen.identifier" />
      <sliceName value="identifierGMSSpecimen" />
      <max value="1" />
    </element>
    <element id="Specimen.identifier:identifierGMSSpecimen.use">
      <path value="Specimen.identifier.use" />
      <max value="0" />
    </element>
    <element id="Specimen.identifier:identifierGMSSpecimen.type">
      <path value="Specimen.identifier.type" />
      <max value="0" />
    </element>
    <element id="Specimen.identifier:identifierGMSSpecimen.system">
      <path value="Specimen.identifier.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.uk/Id/GMSSpecimen" />
    </element>
    <element id="Specimen.identifier:identifierGMSSpecimen.value">
      <path value="Specimen.identifier.value" />
      <min value="1" />
    </element>
    <element id="Specimen.identifier:identifierGMSSpecimen.period">
      <path value="Specimen.identifier.period" />
      <max value="0" />
    </element>
    <element id="Specimen.identifier:identifierGMSSpecimen.assigner">
      <path value="Specimen.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Specimen.identifier:localIdentifier">
      <path value="Specimen.identifier" />
      <sliceName value="localIdentifier" />
    </element>
    <element id="Specimen.identifier:localIdentifier.system">
      <path value="Specimen.identifier.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.uk/local-identifier/specimen" />
    </element>
    <element id="Specimen.identifier:localIdentifier.value">
      <path value="Specimen.identifier.value" />
      <min value="1" />
    </element>
    <element id="Specimen.identifier:localIdentifier.assigner">
      <path value="Specimen.identifier.assigner" />
      <min value="1" />
    </element>
    <element id="Specimen.identifier:localIdentifier.assigner.reference">
      <path value="Specimen.identifier.assigner.reference" />
      <max value="0" />
    </element>
    <element id="Specimen.identifier:localIdentifier.assigner.identifier">
      <path value="Specimen.identifier.assigner.identifier" />
      <min value="1" />
      <fixedIdentifier>
        <system value="https://fhir.nhs.uk/Id/ods-organization-code" />
      </fixedIdentifier>
    </element>
    <element id="Specimen.accessionIdentifier">
      <path value="Specimen.accessionIdentifier" />
      <max value="0" />
    </element>
    <element id="Specimen.status">
      <path value="Specimen.status" />
      <definition value="If a Specimen has not been collected, the status SHOULD be marked as 'unavailable'. If the quality of the Specimen is such that it cannot be processed, the status SHOULD be 'unsatisfactory' (this is equivalent to a QC status of Failed). If the Specimen passes quality control, the status SHOULD be set as 'available'" />
      <min value="1" />
    </element>
    <element id="Specimen.type">
      <path value="Specimen.type" />
      <definition value="The sample type, SNOMED CT preferred. Used to differentiate between raw and extracted (DNA) samples.&#xD;&#xA;ConceptMaps for the allowed values for primary (raw) and final (extracted DNA) samples upon release of MDSv1.04, to aid identification of whether a sample is primary vs. final" />
      <min value="1" />
    </element>
    <element id="Specimen.subject">
      <path value="Specimen.subject" />
      <definition value="SHALL be provided. This SHOULD be a reference to the Patient resource or the identifier, NHS number, for the patient.&#xD;&#xA;Samples collected from a Fetus SHOULD reference a Patient resource for the Fetus. This should then be linked to relevant maternal/paternal resources through the RelatedPerson resource. Further information can be found on the Fetus Management clinical scenario. It is not envisaged that samples would need to be linked to more than one person e.g. both fetus and mother, though this assumption will be tested within the Alpha phase of the Genomic Medicine Service." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/StructureDefinition/NHSEngland-Patient-Genomics" />
        <aggregation value="referenced" />
        <aggregation value="bundled" />
      </type>
    </element>
    <element id="Specimen.receivedTime">
      <path value="Specimen.receivedTime" />
      <definition value="SHOULD be updated upon receipt at a destination lab" />
    </element>
    <element id="Specimen.parent">
      <path value="Specimen.parent" />
      <definition value="If a sample has been split into multiple parts, such as DNA being extracted from a primary sample, each SHOULD be represented using an additional Specimen resource, referencing the parent sample through the parent element.&#xD;&#xA;The central Order Management broker will only create Tasks for Specimen resources which do not have a parent element, i.e. primary samples. If required, clients can create Tasks for processing of derivative samples manually.&#xD;&#xA;&#xD;&#xA;MAY also be used to record the Block identifier for FFPE/Tissue samples, using the reference.identifier element, where a reference to a Specimen resource is not required." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/StructureDefinition/NHSEngland-Specimen-Genomics" />
        <aggregation value="referenced" />
        <aggregation value="bundled" />
      </type>
    </element>
    <element id="Specimen.request">
      <path value="Specimen.request" />
      <definition value="SHALL be provided. This SHOULD be a reference to the request which initiated collection of the sample. SHALL NOT be updated if the sample is used for another test e.g. for re-analysis. In the case that a Specimen needs to be processed as part of a new request, e.g. using a sample in storage, the ServiceRequest SHALL reference the pre-existing sample via ServiceRequest.specimen." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/StructureDefinition/NHSEngland-ServiceRequest-Genomics" />
        <aggregation value="referenced" />
        <aggregation value="bundled" />
      </type>
    </element>
    <element id="Specimen.collection">
      <path value="Specimen.collection" />
      <definition value="Additional information which can be collected about the circumstances under which as sample was collected, if relevant. This include extensions for specialHandling of the sample, e.g. due to high risk of infection, as well as an extension to bodySite to extend the coding to a BodyStructure reference, for more detailed collection of structural information e.g. where tumour morphology and topography need to be collected (only required where morphology and topography are required.&#xD;&#xA;Where the collector is an Organization, or where the individual is not known, ODS codes MAY be used as identifiers in place of SDS-User-IDs. However, if referencing a resource, the PractitionerRole resource SHOULD still be referenced. In this case the PractitionerRole.identifier and PractitionerRole.practitioner reference would not be filled, leaving only the reference to an Organization from PractitionerRole.organization." />
    </element>
    <element id="Specimen.collection.extension:specialHandling">
      <path value="Specimen.collection.extension" />
      <sliceName value="specialHandling" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.nhs.uk/ValueSet/genomics-specimen-collection-specialhandling" />
      </binding>
    </element>
    <element id="Specimen.collection.collector">
      <path value="Specimen.collection.collector" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/StructureDefinition/NHSEngland-PractitionerRole-Genomics" />
        <aggregation value="referenced" />
        <aggregation value="bundled" />
      </type>
    </element>
    <element id="Specimen.collection.collected[x]">
      <path value="Specimen.collection.collected[x]" />
      <min value="1" />
    </element>
    <element id="Specimen.collection.quantity">
      <path value="Specimen.collection.quantity" />
      <definition value="The Specimen.collection.quantity is the amount of the sample collected at collection time. This quantity does not change as the sample is processed.&#xD;&#xA;&#xD;&#xA;The Specimen.container.specimenQuantity is the amount of sample remaining in a container, this is equivalent to GEL 1001 banked volume. This value should be updated as the specimen is used.&#xD;&#xA;&#xD;&#xA;If a specimen is split, additional specimen resources SHOULD be created (referencing the parent specimen), with individual container.specimenQuantity values." />
    </element>
    <element id="Specimen.collection.bodySite.extension:bodyStructureReference">
      <path value="Specimen.collection.bodySite.extension" />
      <sliceName value="bodyStructureReference" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/bodySite" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Specimen.processing">
      <path value="Specimen.processing" />
      <definition value="SHOULD be updated if processing occurs on the sample which affects later use, e.g. additives added" />
    </element>
    <element id="Specimen.processing.procedure.coding">
      <path value="Specimen.processing.procedure.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Specimen.processing.procedure.coding:codingSnomedCT">
      <path value="Specimen.processing.procedure.coding" />
      <sliceName value="codingSnomedCT" />
      <definition value="codes from https://fhir.nhs.uk/ConceptMap/genomics-samplepreparation" />
    </element>
    <element id="Specimen.processing.procedure.coding:codingSnomedCT.system">
      <path value="Specimen.processing.procedure.coding.system" />
      <fixedUri value="http://snomed.info/sct" />
    </element>
    <element id="Specimen.container">
      <path value="Specimen.container" />
      <definition value="The UK Core STU3 version of Specimen backports the R5 changes to the container BackboneElement to support capturing of storage location for a sample (through `container.location`) and recursive capture of device identifiers (e.g. tube, well, rack, freezer through `container.device`).&#xD;&#xA;The container.identifier should match the identifier associated with the barcode for the tube/collection device. This can be searched using the container-id SearchParameter.&#xD;&#xA;&#xD;&#xA;Additional examples/guidance will be provided within this IG once use of the fields has been appropriately tested.&#xD;&#xA;&#xD;&#xA;Sample tracking information SHOULD be added to Tasks acting on Specimen resources, e.g. Tasks marked SamplePreparation or SampleProcessing, on either the output or input elements. This information MAY include consignment number, destination, date sent etc.&#xD;&#xA;&#xD;&#xA;If known, the container type SHOULD be populated, using the example bound ValueSet, in SNOMED CT. If an appropraite code cannot be found, the specimen container type should be populated using free text, in Specimen.container.type.text. Additional container elements, such as capacity or specimenQuantity MAY be populated if known." />
      <max value="1" />
    </element>
    <element id="Specimen.container.extension:specimenContainerLocationR5">
      <path value="Specimen.container.extension" />
      <sliceName value="specimenContainerLocationR5" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/5.0/StructureDefinition/extension-Specimen.container.location" />
      </type>
    </element>
    <element id="Specimen.condition">
      <path value="Specimen.condition" />
      <definition value="Used to record the condition of a specimen. Within Genomics, SHOULD be used to record the fixed/frozen state, using the UK Core bound ValueSet." />
      <max value="1" />
    </element>
  </differential>
</StructureDefinition>