{
  "resourceType": "StructureDefinition",
  "id": "NHSEngland-DocumentReference-GenomicDataFile",
  "url": "https://fhir.nhs.uk/StructureDefinition/NHSEngland-DocumentReference-GenomicDataFile",
  "version": "0.3.0",
  "name": "NHSEngland_DocumentReference_GenomicDataFile",
  "title": "NHSEngland DocumentReference GenomicDataFile",
  "status": "active",
  "date": "2026-04-16",
  "publisher": "NHS England",
  "contact": [
    {
      "name": "NHS England",
      "telecom": [
        {
          "system": "email",
          "value": "interoperabilityteam@nhs.net",
          "use": "work",
          "rank": 1
        }
      ]
    }
  ],
  "description": "This profile defines the Genomics constraints and extensions on the Genomics Reporting FHIR resource [Genomic Data File DocumentReference](http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/genomic-data-file).",
  "purpose": "The DocumentReference resource is used to reference data files generated as part of genomic testing and allow these files to be retrieved through the DRS API standard.\r\n\r\nPrimarily, the ServiceRequest SHALL be referenced via DiagnosticReport.basedOn. The DocumentReference then links back to the report via DocumentReference.context.related.\r\n\r\nIf following the Genomic Reporting IG, you could also reference the DocumentReference from the DiagnosticReport using the following chain: DiagnosticReport.extension:genomic-study -> Procedure (Genomic Study).extension:genomic-study-analysis -> Procedure (Genomic Study Analysis).extension:output.extension:file.valueReference -> DocumentReference (Genomic Data File)\r\n\r\nThe R5 DiagnosticReport.media.link reference to DocumentReference MAY be used to support referencing the data files from the DiagnosticReport directly. DiagnosticReport resources MAY alternatively reference the DocumentReference for the data used by the report though the DiagnosticReport.extension:supporting-info element. In all cases the DocumentReference SHOULD reference the DNA Specimen from which the data originated and the ServiceRequest which triggered the capture of the data.\r\n\r\nAdditionally MAY be used within requests to reference binary files such as images or unstructured reports.",
  "copyright": "Copyright © 2026+ NHS England 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",
  "kind": "resource",
  "abstract": false,
  "type": "DocumentReference",
  "baseDefinition": "http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/genomic-data-file",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DocumentReference.subject",
        "path": "DocumentReference.subject",
        "definition": "SHOULD be present if related to a patient. Reference to the Patient this data file is pertaining to. This MAY be through a resource reference if the ID on the central service is known (or provided within the transaction bundle) or through NHS number where this is known and has been traced through PDS",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.uk/StructureDefinition/NHSEngland-Patient-Genomics",
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/Group",
              "http://hl7.org/fhir/StructureDefinition/Device"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "DocumentReference.author",
        "path": "DocumentReference.author",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "definition": "SHOULD reference the organization responsible for creating the data file, preferably by ODS code."
      },
      {
        "id": "DocumentReference.author:authorODS",
        "path": "DocumentReference.author",
        "sliceName": "authorODS"
      },
      {
        "id": "DocumentReference.author:authorODS.reference",
        "path": "DocumentReference.author.reference",
        "max": "0"
      },
      {
        "id": "DocumentReference.author:authorODS.identifier",
        "path": "DocumentReference.author.identifier",
        "min": 1
      },
      {
        "id": "DocumentReference.author:authorODS.identifier.system",
        "path": "DocumentReference.author.identifier.system",
        "fixedUri": "https://fhir.nhs.uk/Id/ods-organization-code"
      },
      {
        "id": "DocumentReference.description",
        "path": "DocumentReference.description",
        "definition": "Human readable description for the data file. NOTE: this is being used in place of DocumentReference.type until suitable LOINC or SNOMED CT concepts are identified for the file types expected."
      },
      {
        "id": "DocumentReference.content",
        "path": "DocumentReference.content",
        "definition": "SHOULD be a DRS compatible reference to the data file."
      },
      {
        "id": "DocumentReference.context",
        "path": "DocumentReference.context",
        "definition": "In all cases the DocumentReference SHOULD reference the DNA Specimen from which the data originated, where available, and the ServiceRequest which triggered the capture of the data.\r\nThe DiagnosticReport using the data file SHOULD reference the DocumentReference via the DiagnosticReport.extension:supporting-info element. This guidance will be updated upon release of the R5 backport of DiagnosticReport.media, allowing references to DocumentReference. Once backported, the DiagnosticReport.media.link SHOULD be used to reference the DocumentReference resources for data files analysed for the report instead."
      },
      {
        "id": "DocumentReference.context.related",
        "path": "DocumentReference.context.related",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "type"
            }
          ],
          "rules": "open"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.nhs.uk/StructureDefinition/NHSEngland-Specimen-Genomics",
              "https://fhir.nhs.uk/StructureDefinition/NHSEngland-DiagnosticReport-GenomicReport",
              "https://fhir.nhs.uk/StructureDefinition/NHSEngland-ServiceRequest-Genomics",
              "http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/genomic-report"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "DocumentReference.context.related:relatedServiceRequest",
        "path": "DocumentReference.context.related",
        "sliceName": "relatedServiceRequest"
      },
      {
        "id": "DocumentReference.context.related:relatedServiceRequest.reference",
        "path": "DocumentReference.context.related.reference",
        "min": 1
      },
      {
        "id": "DocumentReference.context.related:relatedServiceRequest.type",
        "path": "DocumentReference.context.related.type",
        "fixedUri": "ServiceRequest"
      },
      {
        "id": "DocumentReference.context.related:relatedSpecimen",
        "path": "DocumentReference.context.related",
        "sliceName": "relatedSpecimen"
      },
      {
        "id": "DocumentReference.context.related:relatedSpecimen.reference",
        "path": "DocumentReference.context.related.reference",
        "min": 1
      },
      {
        "id": "DocumentReference.context.related:relatedSpecimen.type",
        "path": "DocumentReference.context.related.type",
        "fixedUri": "Specimen"
      }
    ]
  }
}