getBpgDataTrend(dataType: Object)

Requires:
@ray-js/ray≥1.5.40
import { health } from '@ray-js/ray';

const { getBpgDataTrend } = health;

// Promise usage
try {
  const res = await getBpgDataTrend({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Get blood pressure data statistics

Parameters

PropertyTypeRequiredDescription
dataType"year" | "month" | "week"YesData type
devIdstringYesDevice ID
userIdstringYesUser ID
startTimenumberYesStart timestamp
endTimenumberYesEnd timestamp

Return Value

Type: Promise<Object↓>
PropertyTypeDescription
avgTotalDiastringAverage diastolic blood pressure
avgTotalPulsestringAverage pulse
avgTotalSysstringAverage systolic blood pressure
Trend data

Valid Values

dataType
ValueDescriptionSince
year--
month--
week--

Examples

Basic usage

import { health } from '@ray-js/ray'

health.getBpgDataTrend({
  dataType: 'week',
  devId: 'vdevo169477319679442',
  userId: 'user123',
  startTime: Date.now() - 7 * 24 * 60 * 60 * 1000,
  endTime: Date.now(),
}).then((res) => {
  console.log('Trend statistics:', res);
}).catch((error) => {
  console.error(error);
});