Integrating Health Indices
-
If you are using our embedded UX flow (the “Full UX flow” described here), the Health Indices are automatically integrated. You don’t need to do anything special to show or compute them— the user is guided to enter their risk factors and the results are displayed in the SDK’s UI.
-
The instructions below are only relevant if you want to compute health indices through the API—for example, if you are using the Health Indices completely standalone, independently of the video measurement.
Providing User Risk Factors
You should construct a RisksFactors object (or equivalent structure in your platform) and pass it to the risk-computation function. If certain data is missing, the relevant risks will not be computed. The following fields are available:
class RisksFactors {
/// Age, in years
int? age;
/// Total cholesterol, mg/dL
double? cholesterol;
/// HDL cholesterol, mg/dL
double? cholesterolHdl;
/// Systolic blood pressure, mmHg
double? sbp;
/// Diastolic blood pressure, mmHg
double? dbp;
bool? isSmoker;
HypertensionTreatment? hypertensionTreatment;
bool? hasDiabetes;
/// Body height, centimeters
double? bodyHeight;
/// Body weight, kilograms
double? bodyWeight;
/// Waist circumference, centimeters
double? waistCircumference;
Gender? gender;
/// Two-letter ISO country code, e.g. "US"
String? country;
Race? race;
/// Physical activity level
PhysicalActivity? physicalActivity;
/// Triglyceride level, mg/dL
double? triglyceride;
/// Fasting glucose level, mg/dL
double? fastingGlucose;
bool? vegetableFruitDiet;
bool? historyOfHighGlucose;
bool? historyOfHypertension;
ParentalHistory? parentalHypertension;
FamilyHistory? familyDiabetes;
}
enum Gender {
MALE(0),
FEMALE(1),
OTHER(2);
}
enum Race {
WHITE(0),
AFRICAN_AMERICAN(1),
OTHER(2);
}
enum PhysicalActivity {
SEDENTARY(0),
LIGHTLY_ACTIVE(1),
MODERATELY(2),
VERY_ACTIVE(3),
EXTRA_ACTIVE(4);
}
enum HypertensionTreatment {
NOT_NEEDED(0),
NO(1),
YES(2);
}
enum ParentalHistory {
NONE(0),
ONE(1),
BOTH(2);
}
enum FamilyHistory {
NONE(0),
NONE_FIRST_DEGREE(1),
FIRST_DEGREE(2);
}Computing Health Risks
Call the computeHealthRisks() function with the RisksFactors object to compute all the available risk indices and body composition metrics. The returned structure is HealthRisks.
If some data is not provided, then any risk requiring that data will not be computed.
static HealthRisks computeHealthRisks(RisksFactors factors);
class HealthRisks {
HardAndFatalEventsRisks hardAndFatalEvents;
CVDiseasesRisks cvDiseases;
int? vascularAge;
/// Computed waist-to-height ratio (WHtR)
double? waistToHeightRatio;
/// Computed body fat percentage (BFP)
double? bodyFatPercentage;
/// Computed basal metabolic rate (BMR)
double? basalMetabolicRate;
/// Computed body roundness index (BRI)
double? bodyRoundnessIndex;
/// Computed a body shape index (ABSI)
double? aBodyShapeIndex;
/// Computed conicity index (CI)
double? conicityIndex;
/// Computed total daily energy expenditure (TDEE)
double? totalDailyEnergyExpenditure;
/// Computed wellness score (WS)
double? wellnessScore;
RisksFactorsScores scores;
/// Computed hypertension risk
double? hypertensionRisk;
/// Computed diabeted risk
double? diabetesRisk;
/// Computed non alcoholic fatty liver disease risk
NAFLDRisk? nonAlcoholicFattyLiverDiseaseRisk;
}Substructures
The HealthRisks object contains multiple substructures:
enum NAFLDRisk {
low,
moderate,
high,
}
class HardAndFatalEventsRisks {
final double? coronaryDeathEventRisk;
final double? fatalStrokeEventRisk;
final double? totalCVMortalityRisk;
final double? hardCVEventRisk;
}
class CVDiseasesRisks {
final double? overallRisk;
final double? coronaryHeartDiseaseRisk;
final double? strokeRisk;
final double? heartFailureRisk;
final double? peripheralVascularDiseaseRisk;
}
class RisksFactorsScores {
final int? ageScore;
final int? sbpScore;
final int? smokingScore;
final int? diabetesScore;
final int? bmiScore;
final int? cholesterolScore;
final int? cholesterolHdlScore;
final int? totalScore;
}Minimal, Maximal, and Reference Values
Different metrics have different ranges depending on the user’s risk factors. Shen.AI provides methods to retrieve the minimum and maximum values that define the normal range for each index or the low-risk range for each risk. These values indicate the lower and upper bounds of the defined range for a given metric. For some risks, the low-risk range is determined based on a combination of multiple metrics rather than a single value. Some metrics, however, are highly individual and do not have strict “normal ranges,” so no minimum or maximum is defined for them.
Reference values represent a “typical healthy profile” – the same demographics (age, gender, country, race) as the user, but with all other risk factors set to clinically normal levels. They serve as a benchmark when you need to compare a user’s current outcome against what we expect for someone like them with ideal metrics.
static HealthRisks getMinimalHealthRisks(RisksFactors factors);
static HealthRisks getMaximalHealthRisks(RisksFactors factors);
static HealthRisks getReferenceHealthRisks(RisksFactors factors);Summary of Implementation Steps
- Create a
RisksFactorsobject with the user’s details (age, blood pressure, cholesterol, anthropometric data, etc.). - Invoke
computeHealthRisks()to generateHealthRisks(including vascular age, CVD risk, event risk, waist-to-height ratio, body fat percentage, and basal metabolic rate). - Display the resulting risk values and any derived body composition metrics within your application.
- Optionally, retrieve minimal, maximal, or reference risk profiles for additional insights.
This comprehensive approach lets you integrate Shen.AI’s cardiovascular risk calculations and body composition estimates in a straightforward way.