<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-documentReference" />
  <meta>
    <versionId value="1" />
    <lastUpdated value="2022-10-17T13:43:57.0643363+00:00" />
  </meta>
  <url value="http://telus.com/fhir/patientChart/StructureDefinition/profile-clinical-note-documentReference" />
  <name value="DocumentReference" />
  <title value="DocumentReference" />
  <status value="draft" />
  <date value="2021-03-01T20:09:56.9691901+00:00" />
  <description value="Used to capture Clinical Notes" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="fhircomposition" />
    <uri value="http://hl7.org/fhir/composition" />
    <name value="FHIR Composition" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="cda" />
    <uri value="http://hl7.org/v3/cda" />
    <name value="CDA (R2)" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="xds" />
    <uri value="http://ihe.net/xds" />
    <name value="XDS metadata equivalent" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
  <derivation value="constraint" />
  <differential>
    <element id="DocumentReference">
      <path value="DocumentReference" />
      <comment value="Usage Notes:  Clinical notes that are captured as free text in the EMR map nicely into this resource.  If notes are captured in a more structured manner using templates, the questionnaire response is likely more appropriate.    &#xD;&#xA;&#xD;&#xA;Usually, this is used for documents other than those defined by FHIR." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.id">
      <path value="DocumentReference.id" />
      <comment value="Usage Note:   This will usually be a GUID that is assigned by the sending application. &#xD;&#xA;&#xD;&#xA;The only time that a resource does not have an id is when it is being submitted to the server using a create operation." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.meta">
      <path value="DocumentReference.meta" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.meta.lastUpdated">
      <path value="DocumentReference.meta.lastUpdated" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.meta.source">
      <path value="DocumentReference.meta.source" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.meta.profile">
      <path value="DocumentReference.meta.profile" />
      <comment value="Usage:   This will be determined by each implementation.   This may be useful in validating message instances against this profile.&#xD;&#xA;&#xD;&#xA;It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.text">
      <path value="DocumentReference.text" />
      <comment value="Conformance Rule:     This must be formatted, as closely as possible what was presented to the user in the originating system and must include all clinical data.    &#xD;&#xA;&#xD;&#xA;Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied).  This may be necessary for data from legacy systems where information is captured as a &quot;text blob&quot; or where text is additionally entered raw or narrated and encoded information is added later." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.text.status">
      <path value="DocumentReference.text.status" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.text.div">
      <path value="DocumentReference.text.div" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <comment value="Conformance Rule: This will be populated with the business identifier; for example, DI Requisition Identifier assocaited with the attachment or Bundle when known." />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier.system">
      <path value="DocumentReference.identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier.value">
      <path value="DocumentReference.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.status">
      <path value="DocumentReference.status" />
      <definition value="The status of this document reference" />
      <fixedCode value="current" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.docStatus">
      <path value="DocumentReference.docStatus" />
      <comment value="Usage:   Draft and unfinished notes would be preliminary;  Final is often used.  Amended and entered-in-error would likely not be used&#xD;&#xA;Usage:   If EMRs are able to provide it, this must be populated&#xD;&#xA;&#xD;&#xA;The document that is pointed to might be in various lifecycle states." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <comment value="Usage Note:   Category should be specified when known.    Typical categories are things like:  Internal/EMR - physicals, general assessment, Admission history nd physical, Diabetic visit note,  Follow-up Opiod addiction visit    ** LOOK FOR LOINC CODES FOR THESE -- https://loinc.org/LG38741-1/&#xD;&#xA;Usage Note:   This is used to identify the type of note/structure of the document, eg consultation, progress note, discharge summary etc.  This may not identifiy the specialty (eg cardiology), however, if this is known (eg cardinalogy discharge summary) it should be included here.   Note:  The same code may be replicated in category.     Example codes:   https://fhir.loinc.org/ValueSet/?url=http://loinc.org/vs/LG39083-7&#xD;&#xA;&#xD;&#xA;Conformance Rule: This must be specified when known. Set type to the best, most precise LOINC code corresponding to the concept of the document in the source system.&#xD;&#xA;Conformance Rule: If available, a local code must be supplied as well (code, system, mandatory text, userSelected).&#xD;&#xA;Examples (US Core) -  TELUS WILL NEED TO PUBLISH OUR OWN VALUE SET&#xD;&#xA;&#xD;&#xA;Consultation Note (11488-4)&#xD;&#xA;Discharge Summary (18842-5)&#xD;&#xA;History &amp; Physical Note (34117-2)&#xD;&#xA;Procedures Note (28570-0)&#xD;&#xA;Progress Note (11506-3)&#xD;&#xA;Note (34109-9)&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;Usage Note: In future releases, a full set of LOINC codes (including LOINC.Ontology codes) will be added to this value set. Implementers should expect that this value set will be provided outside of the specification. This will not be populated on messages that originate from sending systems on an earlier May 2016 version." />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://telus.com/fhir/ValueSet/telus-documentreference-type-category" />
      </binding>
    </element>
    <element id="DocumentReference.type.coding">
      <path value="DocumentReference.type.coding" />
      <max value="5" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.coding.system">
      <path value="DocumentReference.type.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.coding.code">
      <path value="DocumentReference.type.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.coding.display">
      <path value="DocumentReference.type.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.coding.userSelected">
      <path value="DocumentReference.type.coding.userSelected" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.text">
      <path value="DocumentReference.type.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type.text.extension">
      <path value="DocumentReference.type.text.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="DocumentReference.type.text.extension:TypeTextTranslation">
      <path value="DocumentReference.type.text.extension" />
      <sliceName value="TypeTextTranslation" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/translation" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.category">
      <path value="DocumentReference.category" />
      <comment value="Conformance Rule:   Populate category with the best, most precise LOINC code corresponding to each category code in the source system. Multiple categories may be specified in some cases. Example:  A document could be categorized as both a Discharge Summary and a Post-Operative Report.&#xD;&#xA;&#xD;&#xA;Usage note:   A category will typically pertain to the specialty, eg Chemotherapy, Cardiology.    This could be a repetition of the type, if the type is not a combination code of type/specialty, eg diabetes prorgess note.   The type could be &quot;progress note&quot;, or &quot;diabetes progress note&quot;.    If the document is a template/custom form/observational template, the name of the template would be captured as &quot;text&quot;, eg &quot;CDM diabetes visit&quot;.    &#xD;&#xA;&#xD;&#xA;Usage Rule: The POS must send a local code and the LOINC code.&#xD;&#xA;&#xD;&#xA;Usage Note: In future releases a full set of LOINC codes (including LOINC.Ontology codes) will be added to this value set. Implementers should expect that this value set will be provided outside of the specification. This will not be populated on messages that originate from sending systems on an earlier May 2016 version." />
      <max value="10" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://telus.com/fhir/ValueSet/telus-documentreference-type-category" />
      </binding>
    </element>
    <element id="DocumentReference.category.coding">
      <path value="DocumentReference.category.coding" />
      <max value="5" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.category.coding.system">
      <path value="DocumentReference.category.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.category.coding.code">
      <path value="DocumentReference.category.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.category.coding.display">
      <path value="DocumentReference.category.coding.display" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.category.coding.userSelected">
      <path value="DocumentReference.category.coding.userSelected" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.category.text">
      <path value="DocumentReference.category.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.category.text.extension">
      <path value="DocumentReference.category.text.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="DocumentReference.category.text.extension:CategoryTextTranslation">
      <path value="DocumentReference.category.text.extension" />
      <sliceName value="CategoryTextTranslation" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/translation" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.subject.reference">
      <path value="DocumentReference.subject.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.subject.display">
      <path value="DocumentReference.subject.display" />
      <comment value="Usage Note:   This should contain the name of the Patient, which can then be used in narrative where applicable&#xD;&#xA;&#xD;&#xA;This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.date">
      <path value="DocumentReference.date" />
      <comment value="Usage Note:   This is the date of the clinical note.&#xD;&#xA;&#xD;&#xA;Referencing/indexing time is used for tracking, organizing versions and searching." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content">
      <path value="DocumentReference.content" />
      <comment value="Conformance Rule: This is used to convey eServices discrete data bundles and/or attachments. If a discrete bundle is present, the related PDF must also be referenced below.&#xD;&#xA;Usage:  Often used to capture clinical notes from the EMR that are pertinent to the Patient Chart data being sent" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment">
      <path value="DocumentReference.content.attachment" />
      <comment value="Conformance Rule: When including an eServices bundle (DocumentReference.extension:RelatedBundle), there must be a PDF attachment relating to this for consuming applications who cannot process the discrete data in the bundle.&#xD;&#xA;&#xD;&#xA;When providing a summary view (for example with Observation.value[x]) Attachment should be represented with a brief display text such as &quot;Signed Procedure Consent&quot;." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.contentType">
      <path value="DocumentReference.content.attachment.contentType" />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://telus.com/fhir/ValueSet/telus-attachment-type" />
      </binding>
    </element>
    <element id="DocumentReference.content.attachment.language">
      <path value="DocumentReference.content.attachment.language" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.data">
      <path value="DocumentReference.content.attachment.data" />
      <comment value="Usage Note:  In most cases, data is expected to convey the clinical notes.&#xD;&#xA;&#xD;&#xA;The base64-encoded data SHALL be expressed in the same character set as the base resource XML or JSON." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.url">
      <path value="DocumentReference.content.attachment.url" />
      <comment value="Usage:  The EMR's may have a URL from an external source.    eg  - Repository to diagnostic images" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.size">
      <path value="DocumentReference.content.attachment.size" />
      <comment value="Usage:  Size is useful if there is a URL as it indicates the size prior to downloading&#xD;&#xA;&#xD;&#xA;The number of bytes is redundant if the data is provided as a base64binary, but is useful if the data is provided as a URL reference." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.hash">
      <path value="DocumentReference.content.attachment.hash" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.title">
      <path value="DocumentReference.content.attachment.title" />
      <comment value="Usage Note:   This could be populated with a template name, or if passing on an external note, the title of the attachment may be useful.&#xD;&#xA;Usage Note:  This should be populated with the title, eg &quot;Dec 27, 2015, A:  Gout, Left Foot&quot;.    This could be created from the Table of Contents in an EMR or a Summary from the Visit Tab.  &#xD;&#xA;&#xD;&#xA;Note that FHIR strings SHALL NOT exceed 1MB in size" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.creation">
      <path value="DocumentReference.content.attachment.creation" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.format">
      <path value="DocumentReference.content.format" />
      <comment value="Usage Note:  Intended to convey the set of template rules that this content adheres to.   Particularly useful for CDA documents.   eg Discharge summary following pattern A; &#xD;&#xA;&#xD;&#xA;Note that while IHE mostly issues URNs for format types, not all documents can be identified by a URI." />
    </element>
    <element id="DocumentReference.context">
      <path value="DocumentReference.context" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.encounter">
      <path value="DocumentReference.context.encounter" />
      <comment value="Usage:  Encounter will be used to capture the diagnosis and other visit data&#xD;&#xA;&#xD;&#xA;References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.encounter.reference">
      <path value="DocumentReference.context.encounter.reference" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.encounter.display">
      <path value="DocumentReference.context.encounter.display" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.period">
      <path value="DocumentReference.context.period" />
      <comment value="Usage:  This will be populated with the date that is pertinent to the clinical note.   eg the date of surgery that the note pertains to.  This is distinct from the DocumentRefernece.date which captures the date that the note was authored.   &#xD;&#xA;&#xD;&#xA;A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. &quot;the patient was an inpatient of the hospital for this time range&quot;) or one value from the range applies (e.g. &quot;give to the patient between these two times&quot;).&#xA;&#xA;Period is not used for a duration (a measure of elapsed time). See [Duration](datatypes.html#Duration)." />
    </element>
    <element id="DocumentReference.context.period.start">
      <path value="DocumentReference.context.period.start" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.period.end">
      <path value="DocumentReference.context.period.end" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.sourcePatientInfo">
      <path value="DocumentReference.context.sourcePatientInfo" />
      <comment value="Usage Note:   This must be populated unless it is not tied to a patient.&#xD;&#xA;&#xD;&#xA;References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.sourcePatientInfo.reference">
      <path value="DocumentReference.context.sourcePatientInfo.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.sourcePatientInfo.display">
      <path value="DocumentReference.context.sourcePatientInfo.display" />
      <comment value="Usage Note:   This should contain the name of the Patient, which can then be used in narrative where applicable&#xD;&#xA;&#xD;&#xA;This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.context.related">
      <path value="DocumentReference.context.related" />
      <comment value="Usage Note:   This can be linked to a service request for referrals.&#xD;&#xA;Alignment:   Ontario eReferral supports this&#xD;&#xA;&#xD;&#xA;May be identifiers or resources that caused the DocumentReference or referenced Document to be created." />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>