<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="CareConnect-GPC-DocumentReference-1" />
  <url value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DocumentReference-1" />
  <version value="1.2.0" />
  <name value="CareConnect-GPC-DocumentReference-1" />
  <status value="draft" />
  <date value="2020-04-27" />
  <publisher value="HL7 UK" />
  <contact>
    <name value="INTEROPen" />
    <telecom>
      <system value="email" />
      <value value="admin@interopen.org" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="The DocumentReference resource is used to describe a document that is made available to a healthcare system." />
  <purpose value="CURATED BY INTEROPen see: http://www.interopen.org/careconnect-curation-methodology/ on the 5th July 2019." />
  <copyright value="Copyright © 2019 HL7 UK  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="3.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
  <derivation value="constraint" />
  <differential>
    <element id="DocumentReference.meta.profile">
      <path value="DocumentReference.meta.profile" />
      <min value="1" />
    </element>
    <element id="DocumentReference.masterIdentifier">
      <path value="DocumentReference.masterIdentifier" />
      <short value="Version Number of the document" />
    </element>
    <element id="DocumentReference.masterIdentifier.system">
      <path value="DocumentReference.masterIdentifier.system" />
      <min value="1" />
    </element>
    <element id="DocumentReference.masterIdentifier.value">
      <path value="DocumentReference.masterIdentifier.value" />
      <min value="1" />
    </element>
    <element id="DocumentReference.masterIdentifier.assigner">
      <path value="DocumentReference.masterIdentifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Organization-1" />
      </type>
    </element>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="The identifier of the document." />
      <definition value="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 value="1" />
    </element>
    <element id="DocumentReference.identifier:crossCareSettingIdentifier">
      <path value="DocumentReference.identifier" />
      <sliceName value="crossCareSettingIdentifier" />
      <short value="Cross-Care Setting Identifier" />
      <definition value="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 value="1" />
      <max value="1" />
    </element>
    <element id="DocumentReference.identifier:crossCareSettingIdentifier.system">
      <path value="DocumentReference.identifier.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.uk/Id/cross-care-setting-identifier" />
    </element>
    <element id="DocumentReference.identifier:crossCareSettingIdentifier.value">
      <path value="DocumentReference.identifier.value" />
      <min value="1" />
    </element>
    <element id="DocumentReference.identifier:crossCareSettingIdentifier.assigner">
      <path value="DocumentReference.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" />
      </type>
    </element>
    <element id="DocumentReference.identifier:sliceIdentifier">
      <path value="DocumentReference.identifier" />
      <sliceName value="sliceIdentifier" />
    </element>
    <element id="DocumentReference.identifier:sliceIdentifier.system">
      <path value="DocumentReference.identifier.system" />
      <min value="1" />
    </element>
    <element id="DocumentReference.identifier:sliceIdentifier.value">
      <path value="DocumentReference.identifier.value" />
      <min value="1" />
    </element>
    <element id="DocumentReference.identifier:sliceIdentifier.assigner">
      <path value="DocumentReference.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" />
      </type>
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <short value="Type of document" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentC80Type" />
        </extension>
        <strength value="preferred" />
        <description value="SNOMED CT UK document type" />
        <valueSetReference>
          <reference value="https://fhir.hl7.org.uk/STU3/ValueSet/CareConnect-DocumentType-1" />
        </valueSetReference>
      </binding>
    </element>
    <element id="DocumentReference.type.coding.extension">
      <path value="DocumentReference.type.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="DocumentReference.type.coding.extension:snomedCTDescriptionID">
      <path value="DocumentReference.type.coding.extension" />
      <sliceName value="snomedCTDescriptionID" />
      <short value="The SNOMED CT Description ID for the display" />
      <definition value="The SNOMED CT Description ID for the display." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
      </type>
    </element>
    <element id="DocumentReference.type.coding.system">
      <path value="DocumentReference.type.coding.system" />
      <min value="1" />
    </element>
    <element id="DocumentReference.type.coding.version">
      <path value="DocumentReference.type.coding.version" />
      <max value="0" />
    </element>
    <element id="DocumentReference.type.coding.code">
      <path value="DocumentReference.type.coding.code" />
      <min value="1" />
    </element>
    <element id="DocumentReference.type.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.type.coding.display" />
      <min value="1" />
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" />
      </type>
    </element>
    <element id="DocumentReference.created">
      <path value="DocumentReference.created" />
      <definition value="When the document was created. Creation/Edit datetime of the document - event date" />
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-RelatedPerson-1" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" />
      </type>
    </element>
    <element id="DocumentReference.authenticator">
      <path value="DocumentReference.authenticator" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" />
      </type>
    </element>
    <element id="DocumentReference.custodian">
      <path value="DocumentReference.custodian" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" />
      </type>
    </element>
    <element id="DocumentReference.relatesTo.target">
      <path value="DocumentReference.relatesTo.target" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DocumentReference-1" />
      </type>
    </element>
    <element id="DocumentReference.description">
      <path value="DocumentReference.description" />
      <short value="Document description or title" />
    </element>
    <element id="DocumentReference.content.attachment.contentType">
      <path value="DocumentReference.content.attachment.contentType" />
      <min value="1" />
    </element>
    <element id="DocumentReference.content.attachment.url">
      <path value="DocumentReference.content.attachment.url" />
      <min value="1" />
    </element>
    <element id="DocumentReference.content.attachment.size">
      <path value="DocumentReference.content.attachment.size" />
      <short value="Size of the file" />
      <min value="1" />
    </element>
    <element id="DocumentReference.context.encounter">
      <path value="DocumentReference.context.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Encounter-1" />
      </type>
    </element>
    <element id="DocumentReference.context.practiceSetting">
      <path value="DocumentReference.context.practiceSetting" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentC80PracticeSetting" />
        </extension>
        <strength value="preferred" />
        <description value="Care setting type of the document" />
        <valueSetReference>
          <reference value="https://fhir.hl7.org.uk/STU3/ValueSet/CareConnect-CareSettingType-1" />
        </valueSetReference>
      </binding>
    </element>
    <element id="DocumentReference.context.sourcePatientInfo">
      <path value="DocumentReference.context.sourcePatientInfo" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
      </type>
    </element>
    <element id="DocumentReference.context.related.identifier.assigner">
      <path value="DocumentReference.context.related.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" />
      </type>
    </element>
  </differential>
</StructureDefinition>