Heart-rate variability
Use this category for a numeric heart-rate-variability value.
Support in @ovok/core
- Category key:
heartRateVariability(heart-rate-variability) - Read: Supported through the observation mapping.
- Save: Supported through the typed measurement save workflow.
The category key selects a measurement shape. It does not determine the patient, time range, or source device. For the shared React query and save behavior, see Measurements and health data.
Data shape
The base measurement requires measurementTypeKey. Fields marked optional can be omitted when the source did not provide a value.
| Field | Type | Unit or meaning | Read and save behavior |
|---|---|---|---|
heartRateVariability | number (optional) | milliseconds (ms) | Mapped and saved as a numeric value; one decimal place on save. |
Source metric
Supply the value in milliseconds. The SDK stores and maps the numeric value; it does not calculate variability from heart-rate samples or normalize different source metrics. Preserve source context in your application when the metric definition matters.
Read this category
Select MeasurementTypeKey.heartRateVariability. The mapper returns the numeric Observation value as heartRateVariability.
Use useObservations() in a client-side component below OvokProvider. It returns mapped measurements, original observations, loading, and error. The hook reference describes its filters and state.
Save this category
Supply the source value in milliseconds. Use request-level effectiveDateTime for its measurement time.
Pass the measurement to OvokClient.saveMeasurement() or, in React, the function returned by useSaveMeasurement(). Common request fields such as patientId and device are described in the measurement overview.
Example
This example uses the configured OvokClient from the get started guide. Supply values in the units listed above.
import { MeasurementTypeKey } from '@ovok/core';
async function saveHeartRateVariability() {
return client.saveMeasurement({
measurement: {
measurementTypeKey: MeasurementTypeKey.heartRateVariability,
heartRateVariability: 42.5,
},
effectiveDateTime: new Date(),
});
}
When offline queueing is enabled, inspect the returned status. A queued result means the measurement is pending until the queue is flushed; it is not a completed server save.