Get Health Results
Target SDK
JavaScript
React
Vue
Flutter
ReactNative
Android
iOS
TIP
You can refer to the sample code and the API Reference for more details. Most related API(s) include: VideoFrameProcessedEvent
, ScanResult
, and Health
.
The Vital Sign Camera component returns the health results in the event.healthResult?.health
property through the onVideoFrameProcessed
callback function. In the example code below, it checks if the health results are ready, and display them in the console if they are ready.
Implement a function to print the health report based on the server version you are using:
typescript
function printHealthResult(event : VideoFrameProcessedEvent) {
const health = event.healthResult?.health;
if (health) {
console.log(`************* Wellness *************`)
console.log(`General Wellness = ${health?.holisticHealth?.generalWellness?.toFixed(2)}`)
console.log(`Stress Level = ${health?.vitalSigns?.stress?.toFixed(2)}`)
console.log(`************ Respiratory ************`)
console.log(`Respiratory Rate = ${health?.vitalSigns.respiratoryRate?.toFixed(2)} bpm`)
console.log(`Oxygen Saturation = ${health?.vitalSigns.spo2?.toFixed(2)} %`)
console.log(`********** Cardiovascular **********`)
console.log(`Heart Rate = ${health?.vitalSigns.heartRate?.toFixed(2)} bpm`)
console.log(`HRV-Mean IBI (Interbeat Interval) = ${health?.vitalSigns.ibi?.toFixed(2)} ms`)
console.log(`HRV-SDNN (Standard Deviation of NN Intervals) = ${health?.vitalSigns.hrvSdnn?.toFixed(2)} ms`)
console.log(`HRV-RMSSD (Root Mean Square of Successive Differences) = ${health?.vitalSigns.hrvRmssd?.toFixed(2)} ms`)
console.log(`Blood Pressure = ${health?.vitalSigns.bloodPressure}`)
console.log(`Systolic Blood Pressure = ${health?.vitalSigns.bloodPressureSystolic?.toFixed(2)} mmHg`)
console.log(`Diastolic Blood Pressure = ${health?.vitalSigns.bloodPressureDiastolic?.toFixed(2)} mmHg`)
console.log(`Cardiac Workload = ${health?.holisticHealth?.cardiacWorkload?.toFixed(2)}`)
console.log(`Pulse-Respiration Quotient (PRQ) = ${health?.holisticHealth?.pulseRespiratoryQuotient?.toFixed(2)}`)
console.log(`************** Risks ***************`)
let generalCVDRisk = health?.risks?.cardiovascularRisks?.generalRisk;
let chdRisk = health?.risks?.cardiovascularRisks?.coronaryHeartDisease;
let strokeRisk = health?.risks?.cardiovascularRisks?.stroke;
let chfRisk = health?.risks?.cardiovascularRisks?.congestiveHeartFailure;
let icRisk = health?.risks?.cardiovascularRisks?.intermittentClaudication;
let covidRisk = health?.risks?.covidRisk?.covidRisk;
let cholesterolRiskBeta = health?.risks?.cholesterolRisk;
console.log(`General Cardiovascular Disease (CVD) Risk = ${(generalCVDRisk ? (generalCVDRisk*100).toFixed(2) : "-")} %`)
console.log(`Coronary Heart Disease (CHD) Risk = ${(chdRisk ? (chdRisk*100).toFixed(2) : "-")} %`)
console.log(`Stroke Risk = ${(strokeRisk ? (strokeRisk*100).toFixed(2) : "-")} %`)
console.log(`Congestive Heart Failure (CHF) Risk = ${(chfRisk ? (chfRisk*100).toFixed(2) : "-")} %`)
console.log(`Intermittent Claudication (IC) Risk = ${(icRisk ? (icRisk*100).toFixed(2) : "-")} %`)
console.log(`Covid Risk = ${(covidRisk ? (covidRisk*100).toFixed(2) : "-")} %`)
console.log(`Cholesterol Risk (Beta) = ${cholesterolRiskBeta}`)
console.log(`******** Physical Analysis *********`)
console.log(`Waist-to-Height Ratio = ${health?.holisticHealth?.waistToHeightRatio?.toFixed(2)}`)
console.log(`A Body Shape Index (ABSI) = ${health?.holisticHealth?.absi?.toFixed(2)}`)
console.log(`Body Mass Index (BMI) = ${health?.holisticHealth?.bmi?.toFixed(2)}`)
}
}
js
function printHealthResult(event) {
const health = event.healthResult?.health;
if (health) {
console.log(`************* Wellness *************`)
console.log(`General Wellness = ${health?.holisticHealth?.generalWellness?.toFixed(2)}`)
console.log(`Stress Level = ${health?.vitalSigns?.stress?.toFixed(2)}`)
console.log(`************ Respiratory ************`)
console.log(`Respiratory Rate = ${health?.vitalSigns.respiratoryRate?.toFixed(2)} bpm`)
console.log(`Oxygen Saturation = ${health?.vitalSigns.spo2?.toFixed(2)} %`)
console.log(`********** Cardiovascular **********`)
console.log(`Heart Rate = ${health?.vitalSigns.heartRate?.toFixed(2)} bpm`)
console.log(`HRV-Mean IBI (Interbeat Interval) = ${health?.vitalSigns.ibi?.toFixed(2)} ms`)
console.log(`HRV-SDNN (Standard Deviation of NN Intervals) = ${health?.vitalSigns.hrvSdnn?.toFixed(2)} ms`)
console.log(`HRV-RMSSD (Root Mean Square of Successive Differences) = ${health?.vitalSigns.hrvRmssd?.toFixed(2)} ms`)
console.log(`Blood Pressure = ${health?.vitalSigns.bloodPressure}`)
console.log(`Systolic Blood Pressure = ${health?.vitalSigns.bloodPressureSystolic?.toFixed(2)} mmHg`)
console.log(`Diastolic Blood Pressure = ${health?.vitalSigns.bloodPressureDiastolic?.toFixed(2)} mmHg`)
console.log(`Cardiac Workload = ${health?.holisticHealth?.cardiacWorkload?.toFixed(2)}`)
console.log(`Pulse-Respiration Quotient (PRQ) = ${health?.holisticHealth?.pulseRespiratoryQuotient?.toFixed(2)}`)
console.log(`************** Risks ***************`)
let generalCVDRisk = health?.risks?.cardiovascularRisks?.generalRisk;
let chdRisk = health?.risks?.cardiovascularRisks?.coronaryHeartDisease;
let strokeRisk = health?.risks?.cardiovascularRisks?.stroke;
let chfRisk = health?.risks?.cardiovascularRisks?.congestiveHeartFailure;
let icRisk = health?.risks?.cardiovascularRisks?.intermittentClaudication;
let covidRisk = health?.risks?.covidRisk?.covidRisk;
let cholesterolRiskBeta = health?.risks?.cholesterolRisk;
console.log(`General Cardiovascular Disease (CVD) Risk = ${(generalCVDRisk ? (generalCVDRisk*100).toFixed(2) : "-")} %`)
console.log(`Coronary Heart Disease (CHD) Risk = ${(chdRisk ? (chdRisk*100).toFixed(2) : "-")} %`)
console.log(`Stroke Risk = ${(strokeRisk ? (strokeRisk*100).toFixed(2) : "-")} %`)
console.log(`Congestive Heart Failure (CHF) Risk = ${(chfRisk ? (chfRisk*100).toFixed(2) : "-")} %`)
console.log(`Intermittent Claudication (IC) Risk = ${(icRisk ? (icRisk*100).toFixed(2) : "-")} %`)
console.log(`Covid Risk = ${(covidRisk ? (covidRisk*100).toFixed(2) : "-")} %`)
console.log(`Cholesterol Risk (Beta) = ${cholesterolRiskBeta}`)
console.log(`******** Physical Analysis *********`)
console.log(`Waist-to-Height Ratio = ${health?.holisticHealth?.waistToHeightRatio?.toFixed(2)}`)
console.log(`A Body Shape Index (ABSI) = ${health?.holisticHealth?.absi?.toFixed(2)}`)
console.log(`Body Mass Index (BMI) = ${health?.holisticHealth?.bmi?.toFixed(2)}`)
}
}
typescript
function printHealthResult(event : VideoFrameProcessedEvent) {
const health = event.healthResult?.health;
if (health) {
console.log(`************* Wellness *************`)
console.log(`General Wellness = ${health?.holisticHealth?.generalWellness?.toFixed(2)}`)
console.log(`Stress Level = ${health?.vitalSigns?.stress?.toFixed(2)}`)
console.log(`Physical Wellness = ${health?.holisticHealth?.physicalWellness?.toFixed(2)}`)
console.log(`Mental Wellness = ${health?.holisticHealth?.mentalWellness?.toFixed(2)}`)
console.log(`Cardiovascular System Wellness = ${health?.holisticHealth?.cardiovascularSystemWellness?.toFixed(2)}`)
console.log(`Respiratory System Wellness = ${health?.holisticHealth?.respiratorySystemWellness?.toFixed(2)}`)
console.log(`************ Respiratory ************`)
console.log(`Respiratory Rate = ${health?.vitalSigns.respiratoryRate?.toFixed(2)} bpm`)
console.log(`Oxygen Saturation = ${health?.vitalSigns.spo2?.toFixed(2)} %`)
console.log(`********** Cardiovascular **********`)
console.log(`Heart Rate = ${health?.vitalSigns.heartRate?.toFixed(2)} bpm`)
console.log(`HRV-Mean IBI (Interbeat Interval) = ${health?.vitalSigns.ibi?.toFixed(2)} ms`)
console.log(`HRV-SDNN (Standard Deviation of NN Intervals) = ${health?.vitalSigns.hrvSdnn?.toFixed(2)} ms`)
console.log(`HRV-RMSSD (Root Mean Square of Successive Differences) = ${health?.vitalSigns.hrvRmssd?.toFixed(2)} ms`)
console.log(`Blood Pressure = ${health?.vitalSigns.bloodPressure}`)
console.log(`Systolic Blood Pressure = ${health?.vitalSigns.bloodPressureSystolic?.toFixed(2)} mmHg`)
console.log(`Diastolic Blood Pressure = ${health?.vitalSigns.bloodPressureDiastolic?.toFixed(2)} mmHg`)
console.log(`Cardiac Workload = ${health?.holisticHealth?.cardiacWorkload?.toFixed(2)}`)
console.log(`Pulse-Respiration Quotient (PRQ) = ${health?.holisticHealth?.pulseRespiratoryQuotient?.toFixed(2)}`)
console.log(`************** Risks ***************`)
let generalCVDRisk = health?.risks?.cardiovascularRisks?.generalRisk;
let chdRisk = health?.risks?.cardiovascularRisks?.coronaryHeartDisease;
let strokeRisk = health?.risks?.cardiovascularRisks?.stroke;
let chfRisk = health?.risks?.cardiovascularRisks?.congestiveHeartFailure;
let icRisk = health?.risks?.cardiovascularRisks?.intermittentClaudication;
let covidRisk = health?.risks?.covidRisk?.covidRisk;
let hypertensionRisk = health?.risks?.hypertensionRisk;
let diabetesRisk = health?.risks?.diabetesRisk;
console.log(`General Cardiovascular Disease (CVD) Risk = ${(generalCVDRisk ? (generalCVDRisk*100).toFixed(2) : "-")} %`)
console.log(`Coronary Heart Disease (CHD) Risk = ${(chdRisk ? (chdRisk*100).toFixed(2) : "-")} %`)
console.log(`Stroke Risk = ${(strokeRisk ? (strokeRisk*100).toFixed(2) : "-")} %`)
console.log(`Congestive Heart Failure (CHF) Risk = ${(chfRisk ? (chfRisk*100).toFixed(2) : "-")} %`)
console.log(`Intermittent Claudication (IC) Risk = ${(icRisk ? (icRisk*100).toFixed(2) : "-")} %`)
console.log(`Covid Risk = ${(covidRisk ? (covidRisk*100).toFixed(2) : "-")} %`)
console.log(`Hypertension Risk = ${(hypertensionRisk ? (hypertensionRisk*100).toFixed(2) : "-")} %`)
console.log(`Diabetes Risk = ${(diabetesRisk ? (diabetesRisk*100).toFixed(2) : "-")} %`)
console.log(`******** Physical Analysis *********`)
console.log(`Waist-to-Height Ratio = ${health?.holisticHealth?.waistToHeightRatio?.toFixed(2)}`)
console.log(`A Body Shape Index (ABSI) = ${health?.holisticHealth?.absi?.toFixed(2)}`)
console.log(`A Body Shape Index (ABSI) Z-score = ${health?.holisticHealth?.absiz?.toFixed(2)}`)
console.log(`Body Mass Index (BMI) = ${health?.holisticHealth?.bmi?.toFixed(2)}`)
}
}
typescript
function printHealthResult(event) {
const health = event.healthResult?.health;
if (health) {
console.log(`************* Wellness *************`)
console.log(`General Wellness = ${health?.holisticHealth?.generalWellness?.toFixed(2)}`)
console.log(`Stress Level = ${health?.vitalSigns?.stress?.toFixed(2)}`)
console.log(`Physical Wellness = ${health?.holisticHealth?.physicalWellness?.toFixed(2)}`)
console.log(`Mental Wellness = ${health?.holisticHealth?.mentalWellness?.toFixed(2)}`)
console.log(`Cardiovascular System Wellness = ${health?.holisticHealth?.cardiovascularSystemWellness?.toFixed(2)}`)
console.log(`Respiratory System Wellness = ${health?.holisticHealth?.respiratorySystemWellness?.toFixed(2)}`)
console.log(`************ Respiratory ************`)
console.log(`Respiratory Rate = ${health?.vitalSigns.respiratoryRate?.toFixed(2)} bpm`)
console.log(`Oxygen Saturation = ${health?.vitalSigns.spo2?.toFixed(2)} %`)
console.log(`********** Cardiovascular **********`)
console.log(`Heart Rate = ${health?.vitalSigns.heartRate?.toFixed(2)} bpm`)
console.log(`HRV-Mean IBI (Interbeat Interval) = ${health?.vitalSigns.ibi?.toFixed(2)} ms`)
console.log(`HRV-SDNN (Standard Deviation of NN Intervals) = ${health?.vitalSigns.hrvSdnn?.toFixed(2)} ms`)
console.log(`HRV-RMSSD (Root Mean Square of Successive Differences) = ${health?.vitalSigns.hrvRmssd?.toFixed(2)} ms`)
console.log(`Blood Pressure = ${health?.vitalSigns.bloodPressure}`)
console.log(`Systolic Blood Pressure = ${health?.vitalSigns.bloodPressureSystolic?.toFixed(2)} mmHg`)
console.log(`Diastolic Blood Pressure = ${health?.vitalSigns.bloodPressureDiastolic?.toFixed(2)} mmHg`)
console.log(`Cardiac Workload = ${health?.holisticHealth?.cardiacWorkload?.toFixed(2)}`)
console.log(`Pulse-Respiration Quotient (PRQ) = ${health?.holisticHealth?.pulseRespiratoryQuotient?.toFixed(2)}`)
console.log(`************** Risks ***************`)
let generalCVDRisk = health?.risks?.cardiovascularRisks?.generalRisk;
let chdRisk = health?.risks?.cardiovascularRisks?.coronaryHeartDisease;
let strokeRisk = health?.risks?.cardiovascularRisks?.stroke;
let chfRisk = health?.risks?.cardiovascularRisks?.congestiveHeartFailure;
let icRisk = health?.risks?.cardiovascularRisks?.intermittentClaudication;
let covidRisk = health?.risks?.covidRisk?.covidRisk;
let hypertensionRisk = health?.risks?.hypertensionRisk;
let diabetesRisk = health?.risks?.diabetesRisk;
console.log(`General Cardiovascular Disease (CVD) Risk = ${(generalCVDRisk ? (generalCVDRisk*100).toFixed(2) : "-")} %`)
console.log(`Coronary Heart Disease (CHD) Risk = ${(chdRisk ? (chdRisk*100).toFixed(2) : "-")} %`)
console.log(`Stroke Risk = ${(strokeRisk ? (strokeRisk*100).toFixed(2) : "-")} %`)
console.log(`Congestive Heart Failure (CHF) Risk = ${(chfRisk ? (chfRisk*100).toFixed(2) : "-")} %`)
console.log(`Intermittent Claudication (IC) Risk = ${(icRisk ? (icRisk*100).toFixed(2) : "-")} %`)
console.log(`Covid Risk = ${(covidRisk ? (covidRisk*100).toFixed(2) : "-")} %`)
console.log(`Hypertension Risk = ${(hypertensionRisk ? (hypertensionRisk*100).toFixed(2) : "-")} %`)
console.log(`Diabetes Risk = ${(diabetesRisk ? (diabetesRisk*100).toFixed(2) : "-")} %`)
console.log(`******** Physical Analysis *********`)
console.log(`Waist-to-Height Ratio = ${health?.holisticHealth?.waistToHeightRatio?.toFixed(2)}`)
console.log(`A Body Shape Index (ABSI) = ${health?.holisticHealth?.absi?.toFixed(2)}`)
console.log(`A Body Shape Index (ABSI) Z-score = ${health?.holisticHealth?.absiz?.toFixed(2)}`)
console.log(`Body Mass Index (BMI) = ${health?.holisticHealth?.bmi?.toFixed(2)}`)
}
}
Call the function in onVideoFrameProcessed
callback:
typescript
/* Update the onload event handler function */
window.onload = () => {
// ...
/* Update the onVideoFrameProcessed callback function */
cam.onVideoFrameProcessed = (event : VideoFrameProcessedEvent) => {
// ...
/* Print the health result if it is ready */
printHealthResult(event);
}
}
js
/* Update the onload event handler function */
window.onload = () => {
// ...
/* Update the onVideoFrameProcessed callback function */
cam.onVideoFrameProcessed = (event) => {
// ...
/* Print the health result if it is ready */
printHealthResult(event);
}
}