Measurement questionnaires are used to further enhance the accuracy of the measurement results. To know more about questionnaires, please refer to the Measurement Questionnaire Section in our developers guide.
Call measurement.setDemographics() before startMeasurement(). Every field
is optional: only the fields you provide are sent with the measurement, and
results are calculated using only those fields.
import { faceAttributeValue, type Demographics } from "@nuralogix.ai/anura-web-core-sdk";
// Partial: only height and weight are sent
measurement.setDemographics({ height: 180, weight: 75 });
// Full
const demographics: Demographics = {
age: 40,
height: 180,
weight: 75,
sex: faceAttributeValue.SEX_ASSIGNED_MALE_AT_BIRTH,
smoking: faceAttributeValue.SMOKER_FALSE,
bloodPressureMedication: faceAttributeValue.BLOOD_PRESSURE_MEDICATION_FALSE,
diabetes: faceAttributeValue.DIABETES_NONE,
};
const demographicsSet = measurement.setDemographics(demographics); // true if valid
| Field | Valid values |
|---|---|
age |
Whole number, 13 – 120 years |
height |
120 – 220 cm |
weight |
30 – 300 kg |
sex |
SEX_NOT_PROVIDED (1), SEX_ASSIGNED_MALE_AT_BIRTH (2), SEX_ASSIGNED_FEMALE_AT_BIRTH (3) |
smoking |
SMOKER_TRUE (0), SMOKER_FALSE (1) |
bloodPressureMedication |
BLOOD_PRESSURE_MEDICATION_FALSE (0), BLOOD_PRESSURE_MEDICATION_TRUE (1) |
diabetes |
DIABETES_NONE (4), DIABETES_TYPE1 (5), DIABETES_TYPE2 (6) |
Notes:
setDemographics({ weight: 70 }) after a full set sends only weight.setDemographics({}) clears all demographics for the next measurement.false and the previously
set demographics are kept.reset() is called.