{
  "resourceType": "StructureDefinition",
  "id": "UKCore-Specimen",
  "url": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen",
  "version": "2.3.0",
  "name": "UKCoreSpecimen",
  "title": "UK Core Specimen",
  "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 profile defines the UK constraints and extensions on the International FHIR resource [Specimen](https://hl7.org/fhir/R4/Specimen.html).",
  "purpose": "This profile allows exchange of information about a sample to be used for analysis.",
  "copyright": "Copyright © 2021+ HL7 UK Licensed under the Apache License, Version 2.0 (the \"License\"); 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 \"AS IS\" 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": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Specimen",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Specimen",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Specimen",
        "path": "Specimen",
        "constraint": [
          {
            "key": "ukcore-spec-001",
            "severity": "error",
            "human": "There SHALL be only one reference between collection.collector and the extension collectionCollectorR5",
            "expression": "collection.collector.reference.empty() or collection.collector.extension('http://hl7.org/fhir/5.0/StructureDefinition/extension-Specimen.collection.collector').empty()"
          }
        ]
      },
      {
        "id": "Specimen.extension",
        "path": "Specimen.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Specimen.extension:sampleCategory",
        "path": "Specimen.extension",
        "sliceName": "sampleCategory",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-SampleCategory"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Specimen.identifier.assigner",
        "path": "Specimen.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.accessionIdentifier.assigner",
        "path": "Specimen.accessionIdentifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.type",
        "path": "Specimen.type",
        "binding": {
          "strength": "preferred",
          "description": "A code from the SNOMED CT UK Clinical Terminology coding system",
          "valueSet": "https://fhir.hl7.org.uk/ValueSet/UKCore-SpecimenType"
        }
      },
      {
        "id": "Specimen.subject",
        "path": "Specimen.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Group",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Device",
              "http://hl7.org/fhir/StructureDefinition/Substance",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Location"
            ]
          }
        ]
      },
      {
        "id": "Specimen.subject.identifier.assigner",
        "path": "Specimen.subject.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.parent",
        "path": "Specimen.parent",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen"
            ]
          }
        ]
      },
      {
        "id": "Specimen.parent.identifier.assigner",
        "path": "Specimen.parent.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.request",
        "path": "Specimen.request",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest"
            ]
          }
        ]
      },
      {
        "id": "Specimen.request.identifier.assigner",
        "path": "Specimen.request.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.collection.extension",
        "path": "Specimen.collection.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Specimen.collection.extension:specialHandling",
        "path": "Specimen.collection.extension",
        "sliceName": "specialHandling",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/specimen-specialHandling"
            ]
          }
        ]
      },
      {
        "id": "Specimen.collection.collector",
        "path": "Specimen.collection.collector",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole"
            ]
          }
        ]
      },
      {
        "id": "Specimen.collection.collector.extension",
        "path": "Specimen.collection.collector.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Specimen.collection.collector.extension:collectionCollectorR5",
        "path": "Specimen.collection.collector.extension",
        "sliceName": "collectionCollectorR5",
        "short": "Person who collected the specimen",
        "definition": "Person who collected the specimen. This is an R5 backport",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/5.0/StructureDefinition/extension-Specimen.collection.collector"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Specimen.collection.collector.extension:collectionCollectorR5.value[x]",
        "path": "Specimen.collection.collector.extension.value[x]",
        "short": "Person who collected the specimen"
      },
      {
        "id": "Specimen.collection.collector.identifier.assigner",
        "path": "Specimen.collection.collector.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.collection.bodySite",
        "path": "Specimen.collection.bodySite",
        "binding": {
          "strength": "preferred",
          "valueSet": "https://fhir.hl7.org.uk/ValueSet/UKCore-SpecimenBodySite"
        }
      },
      {
        "id": "Specimen.collection.bodySite.extension",
        "path": "Specimen.collection.bodySite.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Specimen.collection.bodySite.extension:bodySiteReference",
        "path": "Specimen.collection.bodySite.extension",
        "sliceName": "bodySiteReference",
        "short": "An extension to allow referencing to a BodyStructure",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-BodySiteReference"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Specimen.collection.bodySite.extension:bodySiteReference.value[x]",
        "path": "Specimen.collection.bodySite.extension.value[x]",
        "short": "A reference to a BodyStructure"
      },
      {
        "id": "Specimen.processing.additive.identifier.assigner",
        "path": "Specimen.processing.additive.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.container.identifier.assigner",
        "path": "Specimen.container.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.container.type",
        "path": "Specimen.container.type",
        "binding": {
          "strength": "preferred"
        }
      },
      {
        "id": "Specimen.condition",
        "path": "Specimen.condition",
        "binding": {
          "strength": "extensible",
          "valueSet": "https://fhir.hl7.org.uk/ValueSet/UKCore-BiopsyState"
        }
      },
      {
        "id": "Specimen.note.author[x]",
        "path": "Specimen.note.author[x]",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Practitioner",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-RelatedPerson",
              "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization"
            ]
          },
          {
            "code": "string"
          }
        ]
      }
    ]
  }
}