API referenceovok_sdk.resources

ovok_sdk.resources.measurement_series

Measurement series: values taken at a fixed interval, saved as sampled data.

  • Stable unknown
  • Release candidate not available
  • Development since 0.2.0-dev.36+f12b151

Measurement series: values taken at a fixed interval, saved as sampled data.

series_observations()

series_observations(params: Resource) -> list[Resource]

Return a series as Observations, one per measured value, main one first.

Each holds its values as valueSampledData across the series' effectivePeriod, with the codes of a single reading of that kind; a series of several values ends with their group. Save them with ovok.measurements.save_observations, which writes a series that grew over the one saved before, by its identifiers.

Parameters

NameTypeDefaultDescription
paramsResourceseries (measurement_type_key, start, period_ms and values: one list per value key, None for a slot with no value), patient_id, and optional device, status (default final), source_id (defaults to the device's sn or id; with neither, the series has no identifier) and former_source_ids. camelCase keys are accepted too.

Returns

  • list[Resource]: The Observations; empty when the series has no value.

Raises

  • OvokValidationError: The series lacks its start or period, or the SDK does not know its type.

read_series()

read_series(observation: Resource) -> Resource | None

Return the values of a series Observation, one per slot.

Parameters

NameTypeDefaultDescription
observationResourceAn Observation with one-dimensional valueSampledData.

Returns

  • Resource | None: start (datetime), period_ms and values (None for a slot with no value),
  • Resource | None: or None for any other Observation.

summarize_series()

summarize_series(values: list[float | None]) -> Resource | None

Return the lowest, highest and mean of a series' values.

Parameters

NameTypeDefaultDescription
valueslist[float | None]The values; None slots are skipped.

Returns

  • Resource | None: min, max, mean and count, or None when no slot has a value.

Last updated on

On this page