Health IndicesIntegrating indices functionality

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;
 
  bool? isSmoker;
  bool? 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;
}
 
enum Gender {
  MALE(0),
  FEMALE(1),
  OTHER(2);
}
 
enum Race {
  WHITE(0),
  AFRICAN_AMERICAN(1),
  OTHER(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;
 
  RisksFactorsScores scores;
}


Substructures

The HealthRisks object contains multiple substructures:

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 minimal, maximal, and reference values for each risk.

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.

;