<StructureDefinition xmlns="http://hl7.org/fhir">
  <meta>
    <lastUpdated value="2017-12-14T04:17:26.671-05:00" />
  </meta>
  <url value="http://pchalliance.org/phdfhir/StructureDefinition/PhdBaseObservation" />
  <name value="PhdBaseObservation" />
  <status value="draft" />
  <date value="2017-11-24T15:17:35.385-05:00" />
  <description value="Observation elements that are common to all the Continua PHD Observation profiles" />
  <fhirVersion value="3.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">
      <path value="Observation" />
      <comment value="This variant on the Observation defines a base profile for the PHD Observation profiles. This profile is abstract and does not exist alone." />
    </element>
    <element id="Observation.identifier">
      <path value="Observation.identifier" />
      <comment value="For Phd Observations that require conditional creates the create selection criteria will be based upon the information placed in an identifier element. The information will uniquely represent the measurement content. How that information is generated is dependent upon the Phd Observation Profile." />
    </element>
    <element id="Observation.status">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint">
        <valueString value="default: final" />
      </extension>
      <path value="Observation.status" />
      <definition value="The status of the result value. Either 'final' or 'preliminary'" />
      <comment value="The value shall be set to 'final' unless a Measurement-Status attribute or Nu-Observed-Value attribute status field indicates that the measurement is preliminary. In that case this field shall be set to 'preliminary'" />
    </element>
    <element id="Observation.code.coding">
      <path value="Observation.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <ordered value="true" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Observation.code.coding:11073Type">
      <path value="Observation.code.coding" />
      <sliceName value="11073Type" />
      <short value="The 11073-10101 code for the measurement" />
      <comment value="For non-compound 11073-20601 metric numeric measurements, this code is obtained from one or more of the Type, Metric-Id, Nu-Observed-Value, and Metric-Id-Partition attributes. The algorithm to get the 16-bit partition and 16-bit term code is as follows:  1. The partition and term code are obtained from the Type attribute. 2. If there is a Metric-Id attribute the term code comes from this attribute. 3. If there is a Nu-Observed-Value attribute the term code comes from this attribute. 4. If the term code is NOT from the Type attribute, and there is a Metric-Id-Partition attribute, the partition comes from this attribute. 5. The 32-bit 11073-10101 code value is given by partition * 2 **16 + term code.  It is this value that is placed in the code.coding.code element for this 11073Type slice.&#xD;&#xA;For compound numeric measurements, the code comes from the Type attribute." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.code.coding:11073Type.system">
      <path value="Observation.code.coding.system" />
      <min value="1" />
      <fixedUri value="urn:iso:std:iso:11073:10101" />
    </element>
    <element id="Observation.code.coding:11073Type.code">
      <path value="Observation.code.coding.code" />
      <min value="1" />
    </element>
    <element id="Observation.code.coding:LoincCoding">
      <path value="Observation.code.coding" />
      <sliceName value="LoincCoding" />
      <comment value="If the measurement is one of the magic vital signs, the Magic LOINC code for that vital sign as specified by FHIR appears here. When it occurs It shall be second after the MDC code." />
      <max value="1" />
    </element>
    <element id="Observation.code.coding:LoincCoding.system">
      <path value="Observation.code.coding.system" />
      <min value="1" />
      <fixedUri value="http://loinc.org" />
    </element>
    <element id="Observation.code.coding:LoincCoding.code">
      <path value="Observation.code.coding.code" />
      <comment value="Required if the measurement is a vital sign" />
      <min value="1" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
    </element>
    <element id="Observation.subject.reference">
      <path value="Observation.subject.reference" />
      <min value="1" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <slicing>
        <discriminator>
          <type value="exists" />
          <path value="start" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="The time or time-period the observed value is asserted as being true. It is a time period if a Measure-Active-Period (duration) attribute is part of the metric measurement sent by the PHD. Otherwise it is the time stamp sent by the PHD or the time of reception by the PHG if the PHD sent no time stamp." />
      <min value="1" />
    </element>
    <element id="Observation.effective[x]:dateTimeEffective">
      <path value="Observation.effective[x]" />
      <sliceName value="dateTimeEffective" />
      <comment value="A date and time shall always be present." />
      <type>
        <code value="dateTime" />
      </type>
    </element>
    <element id="Observation.effective[x].effective[x]:effectivePeriod">
      <path value="Observation.effectivePeriod" />
      <sliceName value="effectivePeriod" />
      <definition value="The time period when there is a Measure-Active-Period attribute. The difference between the end and start fields is the value of the Measure-Active-Period." />
      <type>
        <code value="Period" />
      </type>
    </element>
    <element id="Observation.effective[x].effective[x]:effectivePeriod.start">
      <path value="Observation.effectivePeriod.start" />
      <min value="1" />
    </element>
    <element id="Observation.effective[x].effective[x]:effectivePeriod.end">
      <path value="Observation.effectivePeriod.end" />
      <definition value="The end of the period. It will be the value of the Measure-Active-Period plus the start time." />
      <min value="1" />
    </element>
    <element id="Observation.device">
      <path value="Observation.device" />
      <comment value="This field will reference the DeviceComponent when the updated fixes are in place. In the meantime it will reference the DeviceMetric" />
      <min value="1" />
    </element>
    <element id="Observation.device.reference">
      <path value="Observation.device.reference" />
      <short value="Reference to the device responsible for the measurement" />
      <definition value="Reference to the device-related resources that describe the sensor device taking the measurement and the gateway that handled it. This element will point to a DeviceComponent resource following the Phd Parent DeviceComponent Profile." />
      <comment value="This reference points to the DeviceComponent resource containing information about the sensor device that took the measurement and gateway (if any) that handled it." />
      <min value="1" />
    </element>
    <element id="Observation.related">
      <path value="Observation.related" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="target.reference" />
        </discriminator>
        <ordered value="true" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Observation.related:coincidentTimeStampRelated">
      <path value="Observation.related" />
      <sliceName value="coincidentTimeStampRelated" />
      <short value="Pointer to the Coincident Time Stamp" />
      <definition value="A reference to the Coincident Time Stamp observation. The Coincident Time Stamp indicates how the time stamps from the PHD are corrected, if at all." />
      <comment value="This reference shall be present if the PHD reports a time stamp. The reference shall point to the Coincident Time Stamp observation. The Coincident Time Stamp Observation provides an audit of the time stamp. Whether or not the gateway corrected the time stamp can be determined from the elements in this Observation. If the timestamps were corrected, the elements of the Observation can be used to obtain the actual time stamps reported by the PHD.&#xD;&#xA;&#xD;&#xA;There is no reference to a Coincident Time Stamp Observation when the PHD does not report a time stamp." />
      <requirements value="This Observation allows one to re-create the original time stamp generated by the PHD should it have been modified by the PHG." />
    </element>
    <element id="Observation.related:coincidentTimeStampRelated.target.reference">
      <path value="Observation.related.target.reference" />
      <min value="1" />
    </element>
    <element id="Observation.related:SourceHandleReferenceRelated">
      <path value="Observation.related" />
      <sliceName value="SourceHandleReferenceRelated" />
      <comment value="A measurement may have one or more source handle references which point to measurements that this measurement is related to in some way. When one of these attributes are present in the measurement, these values point to other measurements. In this case these measurements will be previously generated Observation resources which are then referenced here. Note that the previously received measurement must be received in the same connection as the current measurement. The application does not need to keep record of all measurements from the given device!" />
      <requirements value="Points to a measurement that this measurement is related to or dependent upon, for example a BMI which is calculated from a weight and height measurement or a heart rate taken during a running session." />
    </element>
    <element id="Observation.related:SourceHandleReferenceRelated.target.reference">
      <path value="Observation.related.target.reference" />
      <min value="1" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="code.coding.code" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Observation.component:supplementalTypesComponent">
      <path value="Observation.component" />
      <sliceName value="supplementalTypesComponent" />
      <definition value="For each paritition:term code pair contained in the Supplemental-Types attribute, a separate supplementalTypesComponent element is generated. The component is not generated if the attribute is absent or empty. The component shall be generated otherwise.&#xD;&#xA;" />
      <comment value="A PHD may send a Supplemental-Types attribute as part of the measurement. This attribute consists of a set of MDC nomenclature codes as partition:term code pairs. Each pair is a code describing something additional about the measurement, such as MDC_MODALITY_SPOT in the pulse oximeter which indicates that the provided meausrement is a stable average. An MDC_MODALITY_FAST would indicate that a short averaging is used and the result reported regardless of stability." />
    </element>
    <element id="Observation.component:supplementalTypesComponent.code.coding">
      <path value="Observation.component.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <ordered value="true" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.code.coding:11073Type">
      <path value="Observation.component.code.coding" />
      <sliceName value="11073Type" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.code.coding:11073Type.system">
      <path value="Observation.component.code.coding.system" />
      <min value="1" />
      <fixedUri value="urn:iso:std:iso:11073:10101" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.code.coding:11073Type.code">
      <path value="Observation.component.code.coding.code" />
      <definition value="68193 is the 32-bit nomenclature code indicating a 'Supplemental-Types' value" />
      <min value="1" />
      <fixedCode value="68193" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.code.coding:11073Type.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="Observation.component.code.coding.display" />
      <definition value="It is recommended to display at least the reference identifier for the Supplemental-Types which is MDC_ATTR_SUPPLEMENTAL_TYPES" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.value[x]:valueCodeableConcept">
      <path value="Observation.component.valueCodeableConcept" />
      <sliceName value="valueCodeableConcept" />
      <definition value="The information determined as a result of making the observation, if the information is a code." />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="Observation.component:supplementalTypesComponent.value[x]:valueCodeableConcept.coding">
      <path value="Observation.component.valueCodeableConcept.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <ordered value="true" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.value[x]:valueCodeableConcept.coding:11073Value">
      <path value="Observation.component.valueCodeableConcept.coding" />
      <sliceName value="11073Value" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.value[x]:valueCodeableConcept.coding:11073Value.system">
      <path value="Observation.component.valueCodeableConcept.coding.system" />
      <min value="1" />
      <fixedUri value="urn:iso:std:iso:11073:10101" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.value[x]:valueCodeableConcept.coding:11073Value.code">
      <path value="Observation.component.valueCodeableConcept.coding.code" />
      <definition value="For the given Supplemental-Types entry the code here is given by: partition * 2**16 + term code" />
      <min value="1" />
    </element>
    <element id="Observation.component:supplementalTypesComponent.dataAbsentReason">
      <path value="Observation.component.dataAbsentReason" />
      <max value="0" />
    </element>
    <element id="Observation.component:relativeTimeComponent">
      <path value="Observation.component" />
      <sliceName value="relativeTimeComponent" />
      <definition value="This component shall be present if the measurement contains a Relative-Time-Stamp." />
      <comment value="Relative time stamps are converted to wall clock time by the PHG through the Coincident Time Stamp Observation. The original relative time value shall be provided here in order to recover the data sent by the sensor device.&#xD;&#xA;The Relative-Time-Stamp is a 32-bit unsigned integer in units of 1/8th ms." />
      <max value="1" />
    </element>
    <element id="Observation.component:relativeTimesComponent.code.coding">
      <path value="Observation.component.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="code" />
        </discriminator>
        <ordered value="true" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Observation.component:relativeTimeComponent.code.coding:11073Type">
      <path value="Observation.component.code.coding" />
      <sliceName value="11073Type" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:relativeTimeComponent.code.coding:11073Type.system">
      <path value="Observation.component.code.coding.system" />
      <min value="1" />
      <fixedUri value="urn:iso:std:iso:11073:10101" />
    </element>
    <element id="Observation.component:relativeTimeComponent.code.coding:11073Type.code">
      <path value="Observation.component.code.coding.code" />
      <definition value="The MDC code of the Relative-Time-Stamp attribute" />
      <min value="1" />
      <fixedCode value="67985" />
    </element>
    <element id="Observation.component:relativeTimeComponent.code.coding:11073Type.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="Observation.component.code.coding.display" />
      <definition value="The reference identifier should be included in the description. For a Relative-Time-Stamp the ref id is MDC_ATTR_TIME_STAMP_REL" />
    </element>
    <element id="Observation.component:relativeTimeComponent.value[x]:valueQuantity">
      <path value="Observation.component.valueQuantity" />
      <sliceName value="valueQuantity" />
      <min value="1" />
      <type>
        <code value="Quantity" />
      </type>
    </element>
    <element id="Observation.component:relativeTimeComponent.value[x]:valueQuantity.value">
      <path value="Observation.component.valueQuantity.value" />
      <definition value="The value of the relative time attribute which is in units of 1/8th milliseconds scaled to microseconds." />
      <min value="1" />
    </element>
    <element id="Observation.component:relativeTimeComponent.value[x]:valueQuantity.unit">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="Observation.component.valueQuantity.unit" />
      <definition value="A human-readable form of the unit which in this case is recommended to be the UCUM code for microseconds (us)" />
      <min value="1" />
    </element>
    <element id="Observation.component:relativeTimeComponent.value[x]:valueQuantity.system">
      <path value="Observation.component.valueQuantity.system" />
      <definition value="The unit code shall use the MDC system" />
      <min value="1" />
      <fixedUri value="urn:iso:std:iso:11073:10101" />
    </element>
    <element id="Observation.component:relativeTimeComponent.value[x]:valueQuantity.code">
      <path value="Observation.component.valueQuantity.code" />
      <definition value="The MDC code for microseconds is 264339" />
      <min value="1" />
      <fixedCode value="264339" />
    </element>
    <element id="Observation.component:relativeTimeComponent.dataAbsentReason">
      <path value="Observation.component.dataAbsentReason" />
      <max value="0" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent">
      <path value="Observation.component" />
      <sliceName value="hiresRelativeTimeComponent" />
      <definition value="This component shall be present if the measurement contains Hi-Res-Relative-Time-Stamp." />
      <comment value="Hi Res Relative time stamps are converted to wall clock time by the PHG through the Coincident Time Stamp Observation. The original relative time value shall be provided here in order to recover the data sent by the sensor device.&#xD;&#xA;The Hi-Res-Relative-Time-Stamp is a 64-bit unsigned interger in units of microseconds." />
      <max value="1" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.code.coding">
      <path value="Observation.component.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="code" />
        </discriminator>
        <ordered value="true" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.code.coding:11073Type">
      <path value="Observation.component.code.coding" />
      <sliceName value="11073Type" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.code.coding:11073Type.system">
      <path value="Observation.component.code.coding.system" />
      <min value="1" />
      <fixedUri value="urn:iso:std:iso:11073:10101" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.code.coding:11073Type.code">
      <path value="Observation.component.code.coding.code" />
      <definition value="The MDC code for the Hi-Res-Relative-Time-Stamp attribute" />
      <min value="1" />
      <fixedCode value="68073" />
    </element>
    <element id="Observation.component:hiresRelativeTime.code.coding:11073Type.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="Observation.component.code.coding.display" />
      <definition value="The reference identifier should be included in the description. For a Hi-Res-Relative-Time-Stamp the ref id is MDC_ATTR_TIME_STAMP_REL_HI_RES" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.value[x]:valueQuantity">
      <path value="Observation.component.valueQuantity" />
      <sliceName value="valueQuantity" />
      <min value="1" />
      <type>
        <code value="Quantity" />
      </type>
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.value[x]:valueQuantity.value">
      <path value="Observation.component.valueQuantity.value" />
      <short value="Numerical value" />
      <definition value="The value of the hi res relative time attribute (already in microseconds)." />
      <min value="1" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.value[x]:valueQuantity.unit">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="Observation.component.valueQuantity.unit" />
      <definition value="A human-readable form of the unit which in this case is recommended to be the UCUM code for microseconds (us)" />
      <min value="1" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.value[x]:valueQuantity.system">
      <path value="Observation.component.valueQuantity.system" />
      <definition value="The unit code shall use the MDC system" />
      <min value="1" />
      <fixedUri value="urn:iso:std:iso:11073:10101" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.value[x]:valueQuantity.code">
      <path value="Observation.component.valueQuantity.code" />
      <definition value="The MDC code for microseconds is 264339" />
      <min value="1" />
      <fixedCode value="264339" />
    </element>
    <element id="Observation.component:hiresRelativeTimeComponent.dataAbsentReason">
      <path value="Observation.component.dataAbsentReason" />
      <max value="0" />
    </element>
    <element id="Observation.component:measurementStatusComponent">
      <path value="Observation.component" />
      <sliceName value="measurementStatusComponent" />
      <definition value="This component gives one of the settings reported in the Measurement-Status attribute that are not reported in the Observation.dataAbsentReason or Observation.status element. The settings that ARE reported in the dataAbsentReason and status elements are 'invalid', 'questionable', 'not-available', and 'early-indication'. It is optional to report any of the other settings UNLESS MDER-BITs 14 or 15 are set. It is optional to report any defined cleared setting; these are all events." />
      <comment value="When MDER-BITs 14 and 15 are set, these are special uses cases by the Pulse Oximeter and Continuous Glucose specialization. MDER-BIT 14 indicates that a threshold set up in other attributes has been crossed. MDER-BIT 15 indicates that the alert mechanism has been turned off.  There will be one measurementStatusComponent entry for every setting reported." />
      <requirements value="This component indicates a Measurement-Status setting." />
    </element>
    <element id="Observation.component:measurementStatusComponent.code.coding">
      <path value="Observation.component.code.coding" />
      <comment value="Normally alternative coding systems are allowed but in this case the value is intimately tied to the code. The code represents the feature indicated by a bit settin in the attribute value. which is either cleared (0) or set (1). Thus the value for this entry is itself a binary 'Y' or 'N' code from http://hl7.org/fhir/v2/0136" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:measurementStatusComponent.code.coding.system">
      <path value="Observation.component.code.coding.system" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/IEEE.ASN1" />
    </element>
    <element id="Observation.component:measurementStatusComponent.code.coding.code">
      <path value="Observation.component.code.coding.code" />
      <definition value="This code, which is an alpha-numeric string, is generated by the attribute MDC code, which is 133447 for the Measurement-Status, followed by a dot (.) followed by the MDER-bit that was set." />
      <comment value="Note that this code is an alpha-numeric string and not a decimal number. Think of it like a very-limited OID. MDER-BITs 14 and 15 shall be reported if set." />
      <min value="1" />
    </element>
    <element id="Observation.component:measurementStatusComponent.value[x]">
      <path value="Observation.component.valueCodeableConcept" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="Observation.component:measurementStatusComponent.value[x]:valueCodeableConcept.coding">
      <path value="Observation.component.valueCodeableConcept.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:measurementStatusComponent.value[x]:valueCodeableConcept.coding.system">
      <path value="Observation.component.valueCodeableConcept.coding.system" />
      <definition value="This coding system contains only two entries, 'Y' (yes) and 'N' (no)" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/v2/0136" />
    </element>
    <element id="Observation.component:measurementStatusComponent.value[x]:valueCodeableConcept.coding.code">
      <path value="Observation.component.valueCodeableConcept.coding.code" />
      <definition value="If the MDER-Bit is set, the code value is 'Y' otherwise it is 'N'" />
      <comment value="Recall that when the value is 'Y' the alarm or alert is turned off" />
      <min value="1" />
    </element>
    <element id="Observation.component:measurementStatusComponent.dataAbsentReason">
      <path value="Observation.component.dataAbsentReason" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>