Health risks
Integrating risks functionality

Integrating risks functionality

To provide Shen.AI information about user's risks factors you should use the following structure:

class RisksFactors {
  final int? age;               // years
  final double? cholesterol;    // mg/dL
  final double? cholesterolHdl; // mg/dL
  final double? sbp;            // mmHg
  final bool? isSmoker;
  final bool? hypertensionTreatment;
  final bool? hasDiabetes;
  final double? bodyHeight; // centimeters
  final double? bodyWeight; // kilograms
  final Gender? gender;
  final String? country; // country name ISO code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
  final Race? race;
}
 
enum Gender {
  MALE(0),
  FEMALE(1),
  OTHER(2);
}
 
enum Race {
  WHITE(0),
  AFRICAN_AMERICAN(1),
  OTHER(2);
}

If some data is not provided, then risks which requires this data also won't be computed.

To compute the risks you should use computeHealthRisks() function. It returns the following structure, with filled only these fields, that could be computed with provided data:

 
static HealthRisks computeHealthRisks(RisksFactors healthRisksFactors);
 
 
class HealthRisks {
  final HardAndFatalEventsRisks? hardAndFatalEventsRisks;
  final CVDiseasesRisks? cvDiseases;
  final int? vascularAge;
  final RisksFactorsScores? scores;
}

The substructures are defined as follows:

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;
}

Because different metrics have different value ranges, dependent also on the risks factors, Shen.AI provides methods to get minimal, maximal and reference values for each risk.

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