<StructureDefinition xmlns="http://hl7.org/fhir">
  <meta>
    <lastUpdated value="2017-12-08T05:24:29.234-05:00" />
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="oo" />
  </extension>
  <url value="http://pchalliance.org/phdfhir/StructureDefinition/PhdCodedEnumerationObservation" />
  <name value="PhdCodedEnumerationObservation" />
  <status value="draft" />
  <date value="2017-06-02T14:29:52.39367-04:00" />
  <description value="Base StructureDefinition for Observation Resource representing measurement data coming from a medical device where the measurement itself is an enumerated code." />
  <fhirVersion value="3.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="http://pchalliance.org/phdfhir/StructureDefinition/PhdBaseObservation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
      <definition value="The PhdCodedEnumerationObservation reports PHD measurements that contain a Enum-Observed-Value-Simple-OID attribute." />
      <comment value="This type of measurement is used when the Personal Health Device reports a measurement as an IEEE 11073 10101 code. An example would be the most recent meal context associated with a glucose measurement such as 'breakfast', 'fasting', 'snack', etc. The list of codes for these meal options is finite." />
    </element>
    <element id="Observation.meta">
      <path value="Observation.meta" />
      <min value="1" />
    </element>
    <element id="Observation.meta.profile">
      <path value="Observation.meta.profile" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="PhdCodedEnumerationObservation" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Observation.meta.profile:phdProfile">
      <path value="Observation.meta.profile" />
      <sliceName value="phdProfile" />
      <min value="1" />
      <max value="1" />
      <fixedUri value="PhdCodedEnumerationObservation" />
    </element>
    <element id="Observation.identifier">
      <path value="Observation.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="value" />
        </discriminator>
        <ordered value="true" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Observation.identifier:conditionalCreateIdentifier">
      <path value="Observation.identifier" />
      <sliceName value="conditionalCreateIdentifier" />
      <short value="Unique identifier of this measurment for a given patient and device" />
      <definition value="An identifier created from a combination of the measurement parameters like sensor time stamp, type code, enumeration OID code, patient and device identifiers, and selected elements of any facet component elements." />
      <comment value="This value is used in the conditional create to prevent data duplication. PHDs will often re-send already sent data for a variety of reasons. This element is required unless the metric measurement contains no time stamp or is a measurement containing a time stamp that is real time. By real time the time stamp reported by the PHD must be later than the current time reported by the PHD before any measurements are received. Temporarily stored data from IEEE 11073 20601 devices, which are required to delete the data after sending, can also be considered real time. Temporarily stored data from Bluetooth Low Energy Health devices may be resent so these cannot be considered as real time." />
      <requirements value="Allows observations to be distinguished in a selective enough manner to prevent resource duplication." />
      <max value="1" />
    </element>
    <element id="Observation.identifier:conditionalCreateIdentifier.value">
      <path value="Observation.identifier.value" />
      <min value="1" />
    </element>
    <element id="Observation.status">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint">
        <valueString value="default: final" />
      </extension>
      <path value="Observation.status" />
      <comment value="The value shall be set to 'final' unless a Measurement-Status attribute or Enum-Observed-Value attribute, representing an OID, status field indicates that the measurement is preliminary. In that case this field shall be set to 'preliminary'" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <comment value="For Enumeration OID measurements, none will fall into the category of vital signs so a LOINC encoding is never necessary in this profile." />
    </element>
    <element id="Observation.code.coding:11073Type">
      <path value="Observation.code.coding" />
      <sliceName value="11073Type" />
      <comment value="For 11073-20601 metric enumeration measurements, this code is obtained from one or more of the Type, Metric-Id, Enum-Observed-Value.metric, and Metric-Id-Partition attributes. The algorithm to get the 16-bit partition and 16-bit term code is as follows:&#xD;&#xA;&#xD;&#xA;1. The partition and term code are obtained from the Type attribute.&#xD;&#xA;2. If there is a Metric-Id attribute the term code comes from this attribute.&#xD;&#xA;3. If there is a Enum-Observed-Value attribute the term code comes from this attribute.&#xD;&#xA;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.&#xD;&#xA;5. The 32-bit 11073-10101 code value is given by partition * 2 **16 + term code.&#xD;&#xA;&#xD;&#xA;It is this value that is placed in the code.coding.code element for this 11073Type slice" />
    </element>
    <element id="Observation.value[x]:valueCodeableConcept">
      <path value="Observation.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.value[x]:valueCodeableConcept.coding">
      <path value="Observation.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.value[x]:valueCodeableConcept.coding:11073Value">
      <path value="Observation.valueCodeableConcept.coding" />
      <sliceName value="11073Value" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.valueCodeableConcept.coding:11073Value.system">
      <path value="Observation.valueCodeableConcept.coding.system" />
      <min value="1" />
      <fixedUri value="urn:iso:std:iso:11073:10101" />
    </element>
    <element id="Observation.valueCodeableConcept.coding:11073Value.code">
      <path value="Observation.valueCodeableConcept.coding.code" />
      <min value="1" />
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
      <definition value="Provides a reason why the expected value in the element Observation.valueCodeableConcept is missing. This would be an error condition indicated by the Measurement-Status attribute." />
      <comment value="The current values in the http://hl7.org/fhir/data-absent-reason system do not provide the same detailed set of options reported in the Measurement-Status. In those cases one uses the generic 'error' code if the error is 'fatal'. The measurementStatusComponent can be used to report more specific information." />
    </element>
    <element id="Observation.dataAbsentReason.coding.system">
      <path value="Observation.dataAbsentReason.coding.system" />
      <min value="1" />
    </element>
    <element id="Observation.dataAbsentReason.coding.code">
      <path value="Observation.dataAbsentReason.coding.code" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>