<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-observation3" />
  <meta>
    <lastUpdated value="2021-10-24T23:08:46.850+00:00" />
  </meta>
  <url value="https://simplifier.net/omd-cdss/generalobservationprofile" />
  <version value="0.2.0" />
  <name value="GeneralObservationProfile" />
  <title value="Observation Profile (General)" />
  <status value="draft" />
  <date value="2021-05-07T12:07:40.5574678+00:00" />
  <publisher value="OMD" />
  <description value="Proposed constraints on the Observation Resource for general use" />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="CA" />
      <display value="Canada" />
    </coding>
    <coding>
      <system value="http://loinc.org" />
      <version value="T1" />
      <code value="183747" />
      <display value="DHL" />
      <userSelected value="false" />
    </coding>
  </jurisdiction>
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="CDSS5.1" />
    <uri value="www.ontariomd.com" />
    <name value="CDS-S 5.1" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
      <short value="Observation Profile" />
      <definition value="The Observation Profile is based upon the core FHIR Observation Resource" />
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;The status of the result value.&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION:&#xD;&#xA;The status of the results as provided by the source." />
      <mustSupport value="true" />
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.013" />
        <comment value="Test Results Status" />
      </mapping>
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <comment value="The binding strength of this element is [Preferred](https://www.hl7.org/fhir/terminologies.html#strength), meaning that codes are encouraged to draw from the LOINC code system for interoperability purposes but are not required to do so to be considered conformant. *All* code-value and, if present, component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation." />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <description value="LOINC codes identifying names of simple observations." />
      </binding>
    </element>
    <element id="Observation.code.coding.system">
      <path value="Observation.code.coding.system" />
      <fixedUri value="http://loinc.org" />
    </element>
    <element id="Observation.code.coding.code">
      <path value="Observation.code.coding.code" />
      <code>
        <system value="http://loinc.org" />
        <code value="8992-5" />
        <display value="FEV" />
      </code>
      <code>
        <system value="http://loinc.org" />
        <code value="8573-3" />
        <display value="FVC1" />
      </code>
      <code>
        <system value="http://loinc.org" />
        <code value="19925-3" />
        <display value="FEV1/FVC1" />
      </code>
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="Period" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.value[x]">
      <path value="Observation.value[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <constraint>
        <key value="ca-baseline-value-1" />
        <severity value="error" />
        <human value="Observation.value[x] or Observation.dataAbsentReason or Observation.component SHOULD be present" />
        <expression value="value[x].exists() or dataAbsentReason.exists() or component.exists()" />
        <xpath value="Observation.value[x] or Observation.dataAbsentReason or Observation.component" />
        <source value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-observation" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Observation.value[x]:valueQuantity">
      <path value="Observation.value[x]" />
      <sliceName value="valueQuantity" />
      <type>
        <code value="Quantity" />
      </type>
    </element>
    <element id="Observation.value[x]:valueQuantity.unit">
      <path value="Observation.value[x].unit" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;A human-readable form of the unit.&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION:&#xD;&#xA;Unit of measure associated with the test result as provided by the source." />
      <mustSupport value="true" />
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.008" />
        <comment value="Result Unit of Measure" />
      </mapping>
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
      <constraint>
        <key value="ca-baseline-value-1" />
        <severity value="error" />
        <human value="Observation.value[x] or Observation.dataAbsentReason or Observation.component SHOULD be present" />
        <expression value="value[x].exists() or dataAbsentReason.exists() or component.exists()" />
        <xpath value="Observation.value[x] or Observation.dataAbsentReason or Observation.component" />
        <source value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-observation" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Observation.dataAbsentReason.coding.code">
      <path value="Observation.dataAbsentReason.coding.code" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION:&#xD;&#xA;Indicates whether the test result is considered sensitive information." />
      <mustSupport value="true" />
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.022" />
        <comment value="Blocked Test Result" />
      </mapping>
    </element>
    <element id="Observation.interpretation.text">
      <path value="Observation.interpretation.text" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION:&#xD;&#xA;Flag to indicate a test result is deemed normal, abnormal, unkown or as provided by the source." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="Refer to CT-029: Laboratory AbnormalFlag" />
        <valueSet value="https://simplifier.net/guide/CoreDataSetStandardCDS-SImplementationGuidance/ReportsFlagsDataTypesCodeTablesCT-027toCT-038" />
      </binding>
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.012" />
        <comment value="Abnormal Indicator" />
      </mapping>
    </element>
    <element id="Observation.note.text">
      <path value="Observation.note.text" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;The text of the annotation in markdown format.&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION (Patient Demographics):&#xD;&#xA;Additional notes about the patient.&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION (Laboratory Test Results - Lab Notes): &#xD;&#xA;Notes associated with an individual test result as provded by the source. &#xD;&#xA; &#xD;&#xA;CDS-S PROFILE DEFINITION (Laboratory Test Results - Physician Notes): &#xD;&#xA;Notes associated with an individual test result as typed in by a physician in the EMR." />
      <mustSupport value="true" />
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE01.023" />
        <comment value="Patient Note" />
      </mapping>
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.016" />
        <comment value="Lab Notes" />
      </mapping>
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.017" />
        <comment value="Physician Notes" />
      </mapping>
    </element>
    <element id="Observation.referenceRange.low">
      <path value="Observation.referenceRange.low" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is &gt;=5 - &lt;=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is &lt;=2.3).&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION:&#xD;&#xA;The lower range limit associated with a test as provided by the source." />
      <mustSupport value="true" />
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.009" />
        <comment value="Reference Range Low" />
      </mapping>
    </element>
    <element id="Observation.referenceRange.high">
      <path value="Observation.referenceRange.high" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is &gt;=5 - &lt;=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is &gt;= 2.3).&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION:&#xD;&#xA;The upper range limit associated with a test as provided by the laboratory." />
      <mustSupport value="true" />
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.010" />
        <comment value="Reference Range High" />
      </mapping>
    </element>
    <element id="Observation.referenceRange.text">
      <path value="Observation.referenceRange.text" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of &quot;Negative&quot; or a list or table of &quot;normals&quot;.&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION:&#xD;&#xA;The reference rage that cannot be depicted numerically or cannot be parsed as high and low reference range provided by the source." />
      <mustSupport value="true" />
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.011" />
        <comment value="Reference Range (Text Based)" />
      </mapping>
    </element>
    <element id="Observation.component.code">
      <path value="Observation.component.code" />
      <comment value="The binding strength of this element is [Preferred](https://www.hl7.org/fhir/terminologies.html#strength), meaning that codes are encouraged to draw from the LOINC code system for interoperability purposes but are not required to do so to be considered conformant. *All* code-value and, if present, component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation." />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <description value="LOINC codes identifying names of simple observations." />
      </binding>
    </element>
    <element id="Observation.component.value[x]">
      <path value="Observation.component.value[x]" />
      <definition value="BASE RESOURCE DEFINITION:&#xD;&#xA;The information determined as a result of making the observation, if the information has a simple value.&#xD;&#xA;&#xD;&#xA;CDS-S PROFILE DEFINITION:&#xD;&#xA;The numeric or qualitative results of a test as provided by the source." />
      <constraint>
        <key value="ca-baseline-value-2" />
        <severity value="error" />
        <human value="Observation.component.value[x] or Observation.component.dataAbsentReason SHALL be present" />
        <expression value="component.value[x].exists() or component.dataAbsentReason.exists()" />
        <xpath value="Observation.component.value[x] or Observation.component.dataAbsentReason" />
        <source value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-observation" />
      </constraint>
      <mustSupport value="true" />
      <mapping>
        <identity value="CDSS5.1" />
        <map value="DE10.007" />
        <comment value="Result Value" />
      </mapping>
    </element>
    <element id="Observation.component.dataAbsentReason">
      <path value="Observation.component.dataAbsentReason" />
      <constraint>
        <key value="ca-baseline-value-2" />
        <severity value="error" />
        <human value="Observation.component.value[x] or Observation.component.dataAbsentReason SHALL be present" />
        <expression value="component.value[x].exists() or component.dataAbsentReason.exists()" />
        <xpath value="Observation.component.value[x] or Observation.component.dataAbsentReason" />
        <source value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-observation" />
      </constraint>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>