Skip to Content
Health IndicesIntegrating indices functionality

Integrating Health Indices

In the embedded UX flow (the “Full UX flow” described here), Health Indices are integrated automatically. Risk factors are collected within the SDK flow, and the results are displayed in the SDK UI.

The instructions below apply only to API-based Health Indices computation, including standalone usage outside the video-measurement flow. Standalone does not mean “without SDK initialization”. These API calls still require an initialized SDK session, and the active license must allow Health Indices.

All RisksFactors values must be passed in metric units as documented on this page: centimeters, kilograms, mmHg, and mg/dL. This remains true even when the application UI accepts inputs in imperial units.

For common pitfalls related to partial output, standalone Wellness Score expectations, and custom UI formatting, see Health Indices troubleshooting.

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; /// Neck circumference, centimeters double? neckCircumference; /// Hip circumference, centimeters double? hipCircumference; 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.

computeHealthRisks() runs against the initialized SDK runtime. If the SDK is not initialized yet, or the active license does not include Health Indices, the returned object can be empty.

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.

getMinimalRisks() and getMaximalRisks() return helper ranges for the indices, not the contribution of each input factor. It is expected that some fields are null because not every output has a strict minimum or maximum benchmark. In particular, these helpers do not populate every derived field in HealthRisks such as Wellness Score or factor-score breakdowns.

static HealthRisks getMinimalHealthRisks(RisksFactors factors); static HealthRisks getMaximalHealthRisks(RisksFactors factors); static HealthRisks getReferenceHealthRisks(RisksFactors factors);

Summary of Implementation Steps

  1. Create a RisksFactors object with the user’s details (age, blood pressure, cholesterol, anthropometric data, etc.).
  2. Invoke computeHealthRisks() to generate HealthRisks (including vascular age, CVD risk, event risk, waist-to-height ratio, body fat percentage, and basal metabolic rate).
  3. Display the resulting risk values and any derived body composition metrics within your application.
  4. 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.