Skip to main content

Body weight

Use this category for a body-weight reading.

Support in @ovok/core​

  • Category key: bodyWeight (body-weight)
  • 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.

FieldTypeUnit or meaningRead and save behavior
bodyWeightnumber (optional)kgMapped and saved as body weight; two decimal places on save.
timestampnumber (optional)Numeric timestamp; unit is not declaredPresent in the type but not consumed by the save mapper. Set request-level effectiveDateTime for the observation time.

Time and units​

Supply bodyWeight in kilograms. The SDK does not convert pounds to kilograms. The type’s timestamp field is not used to set the saved Observation time; pass effectiveDateTime in the save request instead.

The read mapper returns the numeric weight. Use the original Observation in observations to access its effective date and other FHIR metadata.

Read this category​

Select MeasurementTypeKey.bodyWeight. The mapper returns bodyWeight; use the raw Observation resource for its recorded time.

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 weight in kilograms. Use request-level effectiveDateTime for when it was measured; do not rely on the measurement-level timestamp field to set that date.

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 saveBodyWeight() {
return client.saveMeasurement({
measurement: {
measurementTypeKey: MeasurementTypeKey.bodyWeight,
bodyWeight: 72.45,
},
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.