<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="observation-eventTiming" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="oo" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="1" />
  </extension>
  <url value="http://hl7.org/fhir/StructureDefinition/observation-eventTiming" />
  <name value="eventTiming" />
  <title value="Event Timing" />
  <status value="draft" />
  <date value="2015-03-02" />
  <publisher value="Health Level Seven, Inc. - FHIR WG" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="HL7" />
    </telecom>
  </contact>
  <description value="Regular life events the observation is tied to. This is useful for recording imprecise or &quot;fuzzy&quot; times when the observation occurred.  For example, a blood glucose measurement &quot;after breakfast&quot;.  It is interpreted as relative to the `effectiveTime` element or the `issued` element if `effectiveTime` is absent.  For example the blood glucose measurement could be reported that same day (&quot;today after breakfast&quot;) or some other day (&quot;yesterday after breakfast&quot;)." />
  <fhirVersion value="3.0.1" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <kind value="complex-type" />
  <abstract value="false" />
  <contextType value="resource" />
  <context value="Observation" />
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension">
      <path value="Extension" />
      <short value="Approximate time of observation" />
      <definition value="Regular life events the observation is tied to. This is useful for recording imprecise or &quot;fuzzy&quot; times when the observation occurred.  For example, a blood glucose measurement &quot;after breakfast&quot;.  It is interpreted as relative to the `effectiveTime` element or the `issued` element if `effectiveTime` is absent.  For example the blood glucose measurement could be reported that same day (&quot;today after breakfast&quot;) or some other day (&quot;yesterday after breakfast&quot;)." />
      <min value="0" />
      <max value="*" />
      <mapping>
        <identity value="rim" />
        <map value="effectiveTime" />
      </mapping>
    </element>
    <element id="Extension.extension:code">
      <path value="Extension.extension" />
      <sliceName value="code" />
      <short value="Life events" />
      <definition value="Real world event that coincides with the effective time of the observation." />
      <comment value="For text only time  the `.text` element can be used.  (e.g. &quot;right before I walked the dog&quot;)." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="Extension.extension:code.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:code.url">
      <path value="Extension.extension.url" />
      <type>
        <code value="uri" />
      </type>
      <fixedUri value="code" />
    </element>
    <element id="Extension.extension:code.valueCodeableConcept">
      <path value="Extension.extension.valueCodeableConcept" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="EventCode" />
        </extension>
        <strength value="extensible" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/v3-TimingEvent" />
        </valueSetReference>
      </binding>
    </element>
    <element id="Extension.extension:offset">
      <path value="Extension.extension" />
      <sliceName value="offset" />
      <short value="How close to event" />
      <definition value="The duration of time before or after the event in `code`.  If the observation occurred *before* the event, a negative decimal is used.  (for example 30 minutes before = -30 m)  If the observation occurred *after* the event a positive decimal is used.(for example 2 hrs after = 2 h)." />
      <comment value="Avoid nonsensical combinations of code and offset such as an offset = 30 minutes before  and a code = after dinner." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
      </type>
    </element>
    <element id="Extension.extension:offset.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:offset.url">
      <path value="Extension.extension.url" />
      <type>
        <code value="uri" />
      </type>
      <fixedUri value="offset" />
    </element>
    <element id="Extension.extension:offset.valueQuantity">
      <path value="Extension.extension.valueQuantity" />
      <type>
        <code value="Quantity" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="OffsetUnit" />
        </extension>
        <strength value="required" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/units-of-time" />
        </valueSetReference>
      </binding>
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <type>
        <code value="uri" />
      </type>
      <fixedUri value="http://hl7.org/fhir/StructureDefinition/observation-eventTiming" />
    </element>
    <element id="Extension.value[x]">
      <path value="Extension.value[x]" />
      <min value="0" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>