<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-DwObservationResults" />
  <url value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwObservationResults" />
  <version value="2.0.0" />
  <name value="DwObservationResults" />
  <status value="draft" />
  <date value="2026-05-29" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation.id">
      <path value="Observation.id" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.meta.lastUpdated">
      <path value="Observation.meta.lastUpdated" />
      <min value="1" />
    </element>
    <element id="Observation.meta.source">
      <path value="Observation.meta.source" />
      <min value="1" />
    </element>
    <element id="Observation.text">
      <path value="Observation.text" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.identifier">
      <path value="Observation.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <comment value="Usage Note - Historical load does not send the deleted entries. For delta, send all updated resources including deleted.&#xA;&#xA;This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category.coding.code">
      <path value="Observation.category.coding.code" />
      <comment value="Usage note: Provide the following code where we are able to identify them.&#xD;&#xA;Laboratory &#xD;&#xA;imaging&#xD;&#xA;procedure&#xD;&#xA;&#xD;&#xA;Note that FHIR strings SHALL NOT exceed 1MB in size" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://www.telus.com/health/fhir/dwemrextract/ValueSet/combined-code-codes" />
      </binding>
    </element>
    <element id="Observation.code.coding">
      <path value="Observation.code.coding" />
      <code>
        <system value="http://loinc.org" />
      </code>
      <code>
        <system value="https://fhir.infoway-inforoute.ca/CodeSystem/pCLOCD" />
      </code>
      <comment value="Provide loinc or Pclocd or both code provided by the lab" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code.coding.system">
      <path value="Observation.code.coding.system" />
      <comment value="http://loinc.org&#xA;https://fhir.infoway-inforoute.ca/CodeSystem/pCLOCD" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code.coding.code">
      <path value="Observation.code.coding.code" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code.text">
      <path value="Observation.code.text" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPatient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.encounter">
      <path value="Observation.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwEncounter" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.performer">
      <path value="Observation.performer" />
      <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/DwCareTeam" />
        <targetProfile value="https://www.telus.com/health/fhir/dwemrextract/StructureDefinition/DwPatient" />
      </type>
    </element>
    <element id="Observation.performer.display">
      <path value="Observation.performer.display" />
      <comment value="Usage note: Source of the lab results where available eg lifelabs, OLIS, dynacare&#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="Observation.value[x]">
      <path value="Observation.value[x]" />
      <comment value="Usage note: There maybe some situations where value is not available namely&#xD;&#xA;1) value at the top level of a panel such as CBC&#xD;&#xA;2) Result is still pending for this observation from the lab. &#xD;&#xA;&#xD;&#xA;An observation may have; 1)  a single value here, 2)  both a value and a set of related or component values,  or 3)  only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code.  A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value.  For additional guidance, see the [Notes section](observation.html#notes) below." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
      <comment value="Usage note: If there is a lab observation with results pending in the EMR provide dataAbsentReason = temp-unknown and status = registered&#xD;&#xA;&#xD;&#xA;Null or exceptional values can be represented two ways in FHIR Observations.  One way is to simply include them in the value set and represent the exceptions in the value.  For example, measurement values for a serology test could be  &quot;detected&quot;, &quot;not detected&quot;, &quot;inconclusive&quot;, or  &quot;specimen unsatisfactory&quot;.   &#xA;&#xA;The alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values.  For example, the dataAbsentReason code &quot;error&quot; could be used when the measurement was not completed. Note that an observation may only be reported if there are values to report. For example differential cell counts values may be reported only when &gt; 0.  Because of these options, use-case agreements are required to interpret general observations for null or exceptional values." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.dataAbsentReason.text">
      <path value="Observation.dataAbsentReason.text" />
      <min value="1" />
    </element>
    <element id="Observation.interpretation.text">
      <path value="Observation.interpretation.text" />
      <min value="1" />
    </element>
    <element id="Observation.note">
      <path value="Observation.note" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.low">
      <path value="Observation.referenceRange.low" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.high">
      <path value="Observation.referenceRange.high" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.type.text">
      <path value="Observation.referenceRange.type.text" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.text">
      <path value="Observation.referenceRange.text" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.hasMember">
      <path value="Observation.hasMember" />
      <comment value="Usage note: CBC panel has multiple test results under it (eg, Hb, WBC, RBC etc) they are provided as members via hasMember.&#xD;&#xA;&#xD;&#xA;When using this element, an observation will typically have either a value or a set of related resources, although both may be present in some cases.  For a discussion on the ways Observations can assembled in groups together, see [Notes](observation.html#obsgrouping) below.  Note that a system may calculate results from [QuestionnaireResponse](questionnaireresponse.html)  into a final score and represent the score as an Observation." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component.value[x]">
      <path value="Observation.component.value[x]" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component.dataAbsentReason">
      <path value="Observation.component.dataAbsentReason" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component.dataAbsentReason.text">
      <path value="Observation.component.dataAbsentReason.text" />
      <min value="1" />
    </element>
    <element id="Observation.component.interpretation">
      <path value="Observation.component.interpretation" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>