Observation
Overview
The Observation resource represents measurements and simple assertions made about a patient. This includes vital signs (heart rate, blood pressure, temperature), lab results (blood glucose), and device-collected data (SpO2, weight).
API Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/monitoreds/{id}/observations/ | List observations for a patient |
| POST | /api/monitoreds/{id}/observations/ | Create observations |
| GET | /api/observations/{id}/ | Get observation details |
Data Model
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
observation_definition | object | Type and method of observation |
category | string | Category (e.g., physiological_data) |
value | string | Measured value |
value_type | string | Data type (float, int, etc.) |
value_unit | string | Unit of measurement (bpm, celsius, mmHg, etc.) |
issued | datetime | When the observation was issued |
effective_datetime | datetime | When the measurement was taken |
source_id | integer | Source device identifier |
Example
{
"id": 810,
"observation_definition": {
"observation_name": "heart_rate",
"observation_method": "device"
},
"category": "physiological_data",
"value": "72",
"value_type": "int",
"value_unit": "bpm",
"issued": "2024-01-15T10:30:00Z",
"effective_datetime": "2024-01-15T10:30:00Z",
"source_id": 1
}
Observation Types
| Name | Unit | Description |
|---|---|---|
heart_rate | bpm | Heart rate |
blood_pressure_systolic | mmHg | Systolic blood pressure |
blood_pressure_diastolic | mmHg | Diastolic blood pressure |
temperature | celsius | Body temperature |
oxygen_saturation | percentage | SpO2 |
weight | kg | Body weight |
blood_glucose | mg/dL | Blood glucose level |
respiratory_rate | breaths/min | Respiratory rate |
SDK v2 Typed Observations
When using the vitalera SDK v2, observations are returned as typed classes rather than generic JSON. This provides compile-time safety and auto-completion in your IDE.
API observation_name | SDK v2 Typed Class | Key Fields |
|---|---|---|
heart_rate | HeartRateObservation | heartRate (bpm) |
blood_pressure_systolic / blood_pressure_diastolic | BloodPressureObservation | systolic, diastolic (mmHg), pulseRate (bpm) |
temperature | TemperatureObservation | temperature (celsius) |
oxygen_saturation | OxygenSaturationObservation | spo2 (%) |
weight | WeightObservation | weight (kg) |
blood_glucose | BloodGlucoseObservation | glucose (mg/dL) |
respiratory_rate | RespiratoryRateObservation | respiratoryRate (breaths/min) |
Example (Kotlin):
device.collect().collect { observation ->
when (observation) {
is BloodPressureObservation ->
println("BP: ${observation.systolic}/${observation.diastolic} mmHg")
is HeartRateObservation ->
println("HR: ${observation.heartRate} bpm")
is OxygenSaturationObservation ->
println("SpO2: ${observation.spo2}%")
}
}
Example (Swift):
for try await observation in device.collect() {
if let bp = observation as? BloodPressureObservation {
print("BP: \(bp.systolic)/\(bp.diastolic) mmHg")
} else if let hr = observation as? HeartRateObservation {
print("HR: \(hr.heartRate) bpm")
} else if let spo2 = observation as? OxygenSaturationObservation {
print("SpO2: \(spo2.spo2)%")
}
}
For the full list of 30+ typed observation classes, see the SDK Overview.