<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-DwDocumentReferenceClinicalNote" />
  <url value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwDocumentReferenceClinicalNote" />
  <version value="2.0.0" />
  <name value="DwDocumentReferenceClinicalNote" />
  <status value="draft" />
  <date value="2026-05-29" />
  <fhirVersion value="4.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.id">
      <path value="DocumentReference.id" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.meta.lastUpdated">
      <path value="DocumentReference.meta.lastUpdated" />
      <min value="1" />
    </element>
    <element id="DocumentReference.meta.source">
      <path value="DocumentReference.meta.source" />
      <min value="1" />
    </element>
    <element id="DocumentReference.meta.security">
      <path value="DocumentReference.meta.security" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.text">
      <path value="DocumentReference.text" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.status">
      <path value="DocumentReference.status" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.docStatus">
      <path value="DocumentReference.docStatus" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <comment value="Usage note: Use Loinc code 11506-3 Progress note&#xD;&#xA;&#xD;&#xA;Key metadata element describing the document that describes he exact type of document. Helps humans to assess whether the document is of interest when viewing a list of documents." />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPatient" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitioner" />
      </type>
    </element>
    <element id="DocumentReference.date">
      <path value="DocumentReference.date" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitioner" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPractitionerRole" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwOrganization" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPatient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content">
      <path value="DocumentReference.content" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.contentType">
      <path value="DocumentReference.content.attachment.contentType" />
      <mustSupport value="true" />
    </element>
    <element id="DocumentReference.content.attachment.data">
      <path value="DocumentReference.content.attachment.data" />
      <min value="1" />
    </element>
    <element id="DocumentReference.content.attachment.size">
      <path value="DocumentReference.content.attachment.size" />
      <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: MA - provide the title of the template prefixed with &quot;visit&quot;&#xD;&#xA;PSS - Provide title as &quot;Progress note&quot;. If it is categorized note also provide the category where avaiable eg &quot;progress note - 'category name'&quot;&#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.context.encounter">
      <path value="DocumentReference.context.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwEncounter" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>