{
  "resourceType": "StructureDefinition",
  "meta": {
    "lastUpdated": "2017-12-14T14:41:34.341+00:00"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "oo"
    }
  ],
  "url": "http://pchalliance.org/phdfhir/StructureDefinition/PhdCoincidentTimeStampObservation",
  "name": "PhdCoincidentTimeStampObservation",
  "status": "draft",
  "date": "2017-06-02T18:29:52.39367+00:00",
  "description": "Base StructureDefinition for Observation Resource representing the coincident time stamp. This report is a measurement of the current time of the sensor at the current time of the PHG. The purpose of this observation is to record the difference in the time lines between the PHG and PHD and to be able to recover the original measurement time stamps reported by the PHD should the PHG correct them because the sensor clock is in error.",
  "fhirVersion": "3.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "definition": "The PhdCoincidentTimeStampObservation reports the current time of the PHD sensor at the current time of the PHG.",
        "comment": "Used to record the correction the PHG applied to the PHD measurement time stamps (if any) and to be able to recover the original time stamps reported by the PHD should that be needed."
      },
      {
        "id": "Observation.meta",
        "path": "Observation.meta",
        "comment": "Implementations must indicate the PhdCoincidentTimeStampObservation profile this resource adheres to.",
        "min": 1
      },
      {
        "id": "Observation.meta.profile",
        "path": "Observation.meta.profile",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "PhdCoincidentTimeStampObservation"
            }
          ],
          "rules": "open"
        },
        "definition": "A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](). At least one entry must be PhdCoincidentTimeStampObservation",
        "min": 1
      },
      {
        "id": "Observation.meta.profile:phdProfile",
        "path": "Observation.meta.profile",
        "sliceName": "phdProfile",
        "min": 1,
        "max": "1",
        "fixedUri": "PhdCoincidentTimeStampObservation"
      },
      {
        "id": "Observation.status",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint",
            "valueString": "default: final"
          }
        ],
        "path": "Observation.status",
        "definition": "The status of the result value. Always 'final'",
        "comment": "The value shall be set to 'final'",
        "fixedCode": "final"
      },
      {
        "id": "Observation.code.coding",
        "path": "Observation.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "ordered": true,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Observation.code.coding:11073Type",
        "path": "Observation.code.coding",
        "sliceName": "11073Type",
        "short": "The 11073-10101 code for the type of time clock used by the PHD",
        "comment": "PHDs use one of absolute time, base offset time, relative time, or high resolution relative time.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.code.coding:11073Type.system",
        "path": "Observation.code.coding.system",
        "min": 1,
        "fixedUri": "urn:iso:std:iso:11073:10101"
      },
      {
        "id": "Observation.code.coding:11073Type.code",
        "path": "Observation.code.coding.code",
        "comment": "The code for absolute time is 67975 with reference id MDC_ATTR_TIME_ABS, for base offset time is 68226 with reference id MDC_ATTR_TIME_BO, for relative time is 67983 with reference id MDC_ATTR_TIME_REL, and for high resolution relative time is 68072 with reference id MDC_ATTR_TIME_REL_HI_RES.",
        "min": 1
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1
      },
      {
        "id": "Observation.subject.reference",
        "path": "Observation.subject.reference",
        "min": 1
      },
      {
        "id": "Observation.effective[x]:effectiveDateTime",
        "path": "Observation.effectiveDateTime",
        "definition": "The time of the PHG at the time the current time of the PHD is ascertained.",
        "comment": "This element is absent if the PHD has superior time synchronization relative to the PHG. Wnen this element is absent it indicates that the PHG reported the measurement time stamps of the PHD without modification.",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "exists",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "definition": "The current time reported by the PHD unless there is a time fault in which case this element is absent and the dataAbsentReason indicates 'unknown'",
        "comment": "This observation is a measurement of the PHDs current time at the current time of the PHG and is present to allow a comparison and auditing. PHGs are responsible for assuring the measurement time stamps are correctly aligned to UTC and local offset. If the PHD has superior time synchronization than the PHG (very rare with PHDs) only the current time of the PHD is shown and the effectiveDateTime element is absent. If the PHD has a time fault (the current time line of the PHD cannot be ascertained for the measurements uploaded) the value[x] element is absent. If the PHD reports no time stanps in its measurements, this resource is not needed.",
        "requirements": "The primary reason for the coincident time stamp is to know the details of any time stamp corrections the PHG may have applied."
      },
      {
        "id": "Observation.value[x]:dateTimeValue",
        "path": "Observation.value[x]",
        "sliceName": "dateTimeValue",
        "definition": "This reports the current time of the PHD when the real time clock uses either absolute time or base offset time",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Observation.value[x]:relativeTimeValue",
        "path": "Observation.value[x]",
        "sliceName": "relativeTimeValue",
        "type": [
          {
            "code": "Quantity"
          }
        ]
      },
      {
        "id": "Observation.value[x]:relativeTimeValue.value",
        "path": "Observation.value[x].value",
        "definition": "The current relative or high resolution relative time reported by the PHD scaled to units of microseconds.",
        "comment": "The current relative time forms the 'origin' of the time axis allowing the PHG to convert the PHD's relative time stamps to wall-clock time. The PHG knows the current wall clock time at this current relative time. Any measurement relative time stamp can be converted to wall clock time by subtracting this value from the measurement relative time stamp and adding that to the current wall-clock time recorded at the 'origin' relative time.",
        "min": 1
      },
      {
        "id": "Observation.value[x]:relativeTimeValue.unit",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Observation.value[x].unit",
        "definition": "A human-readable form of the unit. This should be the UCUM code 'us' for microseconds."
      },
      {
        "id": "Observation.value[x]:relativeTimeValue.system",
        "path": "Observation.value[x].system",
        "definition": "Identifies the MDC coding system",
        "min": 1,
        "fixedUri": "urn:iso:std:iso:11073:10101"
      },
      {
        "id": "Observation.value[x]:relativeTimeValue.code",
        "path": "Observation.value[x].code",
        "definition": "The 32-bit 11073 10101 code for microseconds which is 264339.",
        "comment": "The 11073-10101 code is used as this comes from the device. This usage allows gateways responsible for translating device measurements to FHIR to handle future specializations they may introduce new codes. If a translation to another coding system is done instead, that gateway would not be able to process the measurement.",
        "min": 1,
        "fixedCode": "264339"
      },
      {
        "id": "Observation.dataAbsentReason",
        "path": "Observation.dataAbsentReason",
        "definition": "In this profile this element indicates that the current time of the PHD for the measurements reported is not known and is unable to be obtained",
        "comment": "This situation arises when the PHD has a time fault, perhaps by battery change. The sensor device may have stored data with time stamps taken at a time when the clock was running but after the fault the original time line was not able to be recovered. Thus the current time line, if any, has an unknown relationship to the previous time line."
      },
      {
        "id": "Observation.dataAbsentReason.coding",
        "path": "Observation.dataAbsentReason.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.dataAbsentReason.coding.system",
        "path": "Observation.dataAbsentReason.coding.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/data-absent-reason"
      },
      {
        "id": "Observation.dataAbsentReason.coding.code",
        "path": "Observation.dataAbsentReason.coding.code",
        "min": 1,
        "fixedCode": "unknown"
      },
      {
        "id": "Observation.device",
        "path": "Observation.device",
        "comment": "This field will reference the DeviceComponent when the updated fixes are in place. In the meantime it will reference the DeviceMetric",
        "min": 1
      },
      {
        "id": "Observation.device.reference",
        "path": "Observation.device.reference",
        "short": "Reference to the device responsible for the measurement",
        "definition": "Reference to the device-related resources that describe the sensor device taking the measurement and the gateway that handled it.",
        "comment": "This reference points to the DeviceComponent resource chain containing information about the sensor device  that took the measurement and gateway (if any) that handled it.",
        "min": 1
      }
    ]
  }
}