{
  "resourceType": "StructureDefinition",
  "id": "CareConnect-GPC-DocumentReference-1",
  "url": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DocumentReference-1",
  "version": "1.2.0",
  "name": "CareConnect-GPC-DocumentReference-1",
  "status": "draft",
  "date": "2020-04-27",
  "publisher": "HL7 UK",
  "contact": [
    {
      "name": "INTEROPen",
      "telecom": [
        {
          "system": "email",
          "value": "admin@interopen.org",
          "use": "work"
        }
      ]
    }
  ],
  "description": "The DocumentReference resource is used to describe a document that is made available to a healthcare system.",
  "purpose": "CURATED BY INTEROPen see: http://www.interopen.org/careconnect-curation-methodology/ on the 5th July 2019.",
  "copyright": "Copyright © 2019 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": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "DocumentReference",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DocumentReference",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DocumentReference.meta.profile",
        "path": "DocumentReference.meta.profile",
        "min": 1
      },
      {
        "id": "DocumentReference.masterIdentifier",
        "path": "DocumentReference.masterIdentifier",
        "short": "Version Number of the document"
      },
      {
        "id": "DocumentReference.masterIdentifier.system",
        "path": "DocumentReference.masterIdentifier.system",
        "min": 1
      },
      {
        "id": "DocumentReference.masterIdentifier.value",
        "path": "DocumentReference.masterIdentifier.value",
        "min": 1
      },
      {
        "id": "DocumentReference.masterIdentifier.assigner",
        "path": "DocumentReference.masterIdentifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Organization-1"
          }
        ]
      },
      {
        "id": "DocumentReference.identifier",
        "path": "DocumentReference.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "short": "The identifier of the document.",
        "definition": "The identifier of the document. This will be generated by the organisation that is the custodian of the document. This could be a local identifier but will also contain identifier across care-settings.",
        "min": 1
      },
      {
        "id": "DocumentReference.identifier:crossCareSettingIdentifier",
        "path": "DocumentReference.identifier",
        "sliceName": "crossCareSettingIdentifier",
        "short": "Cross-Care Setting Identifier",
        "definition": "This Cross-Care Setting Identifier is a business identifiers and MUST be a GUID.  Providing systems MUST ensure this GUID is globally unique and a persistent identifier (that is, it doesn’t change between requests and, therefore, is stored with the source data).  Where consuming systems are integrating data from this resource to their local system, they MUST also persist this GUID at the same time.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "DocumentReference.identifier:crossCareSettingIdentifier.system",
        "path": "DocumentReference.identifier.system",
        "min": 1,
        "fixedUri": "https://fhir.nhs.uk/Id/cross-care-setting-identifier"
      },
      {
        "id": "DocumentReference.identifier:crossCareSettingIdentifier.value",
        "path": "DocumentReference.identifier.value",
        "min": 1
      },
      {
        "id": "DocumentReference.identifier:crossCareSettingIdentifier.assigner",
        "path": "DocumentReference.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1"
          }
        ]
      },
      {
        "id": "DocumentReference.identifier:sliceIdentifier",
        "path": "DocumentReference.identifier",
        "sliceName": "sliceIdentifier"
      },
      {
        "id": "DocumentReference.identifier:sliceIdentifier.system",
        "path": "DocumentReference.identifier.system",
        "min": 1
      },
      {
        "id": "DocumentReference.identifier:sliceIdentifier.value",
        "path": "DocumentReference.identifier.value",
        "min": 1
      },
      {
        "id": "DocumentReference.identifier:sliceIdentifier.assigner",
        "path": "DocumentReference.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1"
          }
        ]
      },
      {
        "id": "DocumentReference.type",
        "path": "DocumentReference.type",
        "short": "Type of document",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "DocumentC80Type"
            }
          ],
          "strength": "preferred",
          "description": "SNOMED CT UK document type",
          "valueSetReference": {
            "reference": "https://fhir.hl7.org.uk/STU3/ValueSet/CareConnect-DocumentType-1"
          }
        }
      },
      {
        "id": "DocumentReference.type.coding.extension",
        "path": "DocumentReference.type.coding.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "DocumentReference.type.coding.extension:snomedCTDescriptionID",
        "path": "DocumentReference.type.coding.extension",
        "sliceName": "snomedCTDescriptionID",
        "short": "The SNOMED CT Description ID for the display",
        "definition": "The SNOMED CT Description ID for the display.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
          }
        ]
      },
      {
        "id": "DocumentReference.type.coding.system",
        "path": "DocumentReference.type.coding.system",
        "min": 1
      },
      {
        "id": "DocumentReference.type.coding.version",
        "path": "DocumentReference.type.coding.version",
        "max": "0"
      },
      {
        "id": "DocumentReference.type.coding.code",
        "path": "DocumentReference.type.coding.code",
        "min": 1
      },
      {
        "id": "DocumentReference.type.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DocumentReference.type.coding.display",
        "min": 1
      },
      {
        "id": "DocumentReference.subject",
        "path": "DocumentReference.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Group"
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Device"
          },
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
          },
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1"
          }
        ]
      },
      {
        "id": "DocumentReference.created",
        "path": "DocumentReference.created",
        "definition": "When the document was created. Creation/Edit datetime of the document - event date"
      },
      {
        "id": "DocumentReference.author",
        "path": "DocumentReference.author",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Device"
          },
          {
            "code": "Reference",
            "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-RelatedPerson-1"
          },
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
          },
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1"
          },
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1"
          }
        ]
      },
      {
        "id": "DocumentReference.authenticator",
        "path": "DocumentReference.authenticator",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1"
          },
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1"
          }
        ]
      },
      {
        "id": "DocumentReference.custodian",
        "path": "DocumentReference.custodian",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1"
          }
        ]
      },
      {
        "id": "DocumentReference.relatesTo.target",
        "path": "DocumentReference.relatesTo.target",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DocumentReference-1"
          }
        ]
      },
      {
        "id": "DocumentReference.description",
        "path": "DocumentReference.description",
        "short": "Document description or title"
      },
      {
        "id": "DocumentReference.content.attachment.contentType",
        "path": "DocumentReference.content.attachment.contentType",
        "min": 1
      },
      {
        "id": "DocumentReference.content.attachment.url",
        "path": "DocumentReference.content.attachment.url",
        "min": 1
      },
      {
        "id": "DocumentReference.content.attachment.size",
        "path": "DocumentReference.content.attachment.size",
        "short": "Size of the file",
        "min": 1
      },
      {
        "id": "DocumentReference.context.encounter",
        "path": "DocumentReference.context.encounter",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Encounter-1"
          }
        ]
      },
      {
        "id": "DocumentReference.context.practiceSetting",
        "path": "DocumentReference.context.practiceSetting",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "DocumentC80PracticeSetting"
            }
          ],
          "strength": "preferred",
          "description": "Care setting type of the document",
          "valueSetReference": {
            "reference": "https://fhir.hl7.org.uk/STU3/ValueSet/CareConnect-CareSettingType-1"
          }
        }
      },
      {
        "id": "DocumentReference.context.sourcePatientInfo",
        "path": "DocumentReference.context.sourcePatientInfo",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
          }
        ]
      },
      {
        "id": "DocumentReference.context.related.identifier.assigner",
        "path": "DocumentReference.context.related.identifier.assigner",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1"
          }
        ]
      }
    ]
  }
}