{
 "title": "Terra fields to FHIR R4 Observation with LOINC",
 "checked": "2026-12-03",
 "loinc_source": "https://clinicaltables.nlm.nih.gov/api/loinc_items/v3/search",
 "vendor_source": "https://docs.tryterra.co/reference/health-and-fitness-api/data-models",
 "publisher": "Nirmitee.io",
 "warning": "A code match says the code exists with that name. It does not say a given device measures it the clinical way: wearable SpO2 and HRV are consumer readings, and your clinical team decides which ones go into a chart.",
 "mappings": [
  {
   "vendor_field": "heart_rate_data.summary.avg_hr_bpm",
   "vendor_payload": "activity, daily, sleep, body",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "8867-4",
   "loinc_display": "Heart rate",
   "ucum": "/min",
   "note": "Average over the payload window. Set effectivePeriod from metadata.start_time and end_time."
  },
  {
   "vendor_field": "heart_rate_data.summary.resting_hr_bpm",
   "vendor_payload": "daily, sleep",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "40443-4",
   "loinc_display": "Heart rate --resting",
   "ucum": "/min",
   "note": ""
  },
  {
   "vendor_field": "heart_rate_data.summary.avg_hrv_sdnn",
   "vendor_payload": "daily, sleep, body",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "80404-7",
   "loinc_display": "R-R interval.standard deviation (Heart rate variability)",
   "ucum": "ms",
   "note": "SDNN only. Terra notes Oura fills HRV only in sleep, as RMSSD."
  },
  {
   "vendor_field": "heart_rate_data.summary.avg_hrv_rmssd",
   "vendor_payload": "daily, sleep, body",
   "fhir_resource": "Observation",
   "category": "local",
   "loinc": null,
   "loinc_display": null,
   "ucum": "ms",
   "note": "No LOINC code found on NLM for this measure (searched 3 Dec 2026). Use a local code system and keep the vendor field name."
  },
  {
   "vendor_field": "oxygen_data.avg_saturation_percentage",
   "vendor_payload": "activity, daily, body",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "59408-5",
   "loinc_display": "Oxygen saturation in Arterial blood by Pulse oximetry",
   "ucum": "%",
   "note": "Consumer pulse oximetry. The LOINC name says arterial blood by pulse oximetry."
  },
  {
   "vendor_field": "respiration_data.oxygen_saturation_data.avg_saturation_percentage",
   "vendor_payload": "sleep",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "59408-5",
   "loinc_display": "Oxygen saturation in Arterial blood by Pulse oximetry",
   "ucum": "%",
   "note": ""
  },
  {
   "vendor_field": "distance_data.summary.steps",
   "vendor_payload": "daily",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "41950-7",
   "loinc_display": "Number of steps in 24 hour Measured",
   "ucum": "{steps}",
   "note": "Daily payloads are running totals. Overwrite the day's Observation; match on metadata.start_time and end_time."
  },
  {
   "vendor_field": "measurements_data.measurements[].weight_kg",
   "vendor_payload": "body",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "29463-7",
   "loinc_display": "Body weight",
   "ucum": "kg",
   "note": ""
  },
  {
   "vendor_field": "measurements_data.measurements[].BMI",
   "vendor_payload": "body",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "39156-5",
   "loinc_display": "Body mass index (BMI) [Ratio]",
   "ucum": "kg/m2",
   "note": ""
  },
  {
   "vendor_field": "measurements_data.measurements[].bodyfat_percentage",
   "vendor_payload": "body",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "41982-0",
   "loinc_display": "Percentage of body fat Measured",
   "ucum": "%",
   "note": ""
  },
  {
   "vendor_field": "measurements_data.measurements[].height_cm",
   "vendor_payload": "body",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "8302-2",
   "loinc_display": "Body height",
   "ucum": "cm",
   "note": ""
  },
  {
   "vendor_field": "blood_pressure_data.blood_pressure_samples[] (systolic_bp, diastolic_bp)",
   "vendor_payload": "body",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "85354-9",
   "loinc_display": "Blood pressure panel with all children optional",
   "ucum": "mm[Hg]",
   "note": "One panel Observation with components 8480-6 (systolic_bp) and 8462-4 (diastolic_bp)."
  },
  {
   "vendor_field": "glucose_data.blood_glucose_samples[].blood_glucose_mg_per_dL",
   "vendor_payload": "body",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "99504-3",
   "loinc_display": "Glucose [Mass/volume] in Interstitial fluid",
   "ucum": "mg/dL",
   "note": "Use 99504-3 for CGM (interstitial) sources such as Dexcom. Use 2339-0 for finger-stick meters."
  },
  {
   "vendor_field": "respiration_data.breaths_data.avg_breaths_per_min",
   "vendor_payload": "sleep",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "9279-1",
   "loinc_display": "Respiratory rate",
   "ucum": "/min",
   "note": ""
  },
  {
   "vendor_field": "sleep_durations_data.asleep.duration_asleep_state_seconds",
   "vendor_payload": "sleep",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "93832-4",
   "loinc_display": "Sleep duration",
   "ucum": "s",
   "note": "Terra says this can be null; then sum the stage durations."
  },
  {
   "vendor_field": "sleep_durations_data.asleep.duration_deep_sleep_state_seconds",
   "vendor_payload": "sleep",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "93831-6",
   "loinc_display": "Deep sleep duration",
   "ucum": "s",
   "note": ""
  },
  {
   "vendor_field": "sleep_durations_data.asleep.duration_light_sleep_state_seconds",
   "vendor_payload": "sleep",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "93830-8",
   "loinc_display": "Light sleep duration",
   "ucum": "s",
   "note": ""
  },
  {
   "vendor_field": "sleep_durations_data.asleep.duration_REM_sleep_state_seconds",
   "vendor_payload": "sleep",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "93829-0",
   "loinc_display": "REM sleep duration",
   "ucum": "s",
   "note": ""
  },
  {
   "vendor_field": "sleep_durations_data.awake.duration_awake_state_seconds",
   "vendor_payload": "sleep",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "93828-2",
   "loinc_display": "Nighttime awakening duration",
   "ucum": "s",
   "note": ""
  },
  {
   "vendor_field": "temperature_data.day_avg_body_temperature_celsius",
   "vendor_payload": "body",
   "fhir_resource": "Observation",
   "category": "vital-signs",
   "loinc": "8310-5",
   "loinc_display": "Body temperature",
   "ucum": "Cel",
   "note": ""
  },
  {
   "vendor_field": "temperature_data.day_avg_skin_temperature_celsius",
   "vendor_payload": "body",
   "fhir_resource": "Observation",
   "category": "activity",
   "loinc": "39106-0",
   "loinc_display": "Temperature of Skin",
   "ucum": "Cel",
   "note": ""
  },
  {
   "vendor_field": "temperature_data.delta (sleep)",
   "vendor_payload": "sleep",
   "fhir_resource": "Observation",
   "category": "local",
   "loinc": null,
   "loinc_display": null,
   "ucum": "Cel",
   "note": "A deviation from the user's baseline, not a temperature. No LOINC code found on NLM for this measure (searched 3 Dec 2026). Use a local code system and keep the vendor field name."
  }
 ]
}