© 2024 IQVIA - All Rights Reserved
BMI Calculation
Summary
This method calculates Body Mass Index using inputs from Height and Weight collection. The math for this calculation is as follows:
BMI = (Weight) / (Height)2
Form Setup
This method assumes that Height, Weight, and BMI Items are contained in the same Form; and that height and weight measurement units are defined as ‘cm’ and ‘kg’ respectively.
Item Reference
This method is attached to the BMI item reference.
Formal Expression
HEIGHT = Name of Item capturing height in CM
WEIGHT = Name of Item capturing weight in KG
var bmi = null;
var height = findFirstItemValueByName(formJson, 'HEIGHT');
var weight = findFirstItemValueByName(formJson, 'WEIGHT');
if (height && weight) { //BMI = ( Weight in Kilograms / ( Height in Meters x Height in Meters ) )
var heightMtr = (height / 100);
bmi = (Math.round((weight / (heightMtr * heightMtr)) * 10) / 10);
}
return {"value": bmi, "measurementUnitName": 'kg/m²'};
Method In Action
Alternate version getting Height from another form
var HEIGHT_FORM_STUDY_EVENT = 'Day -28 to -2';
var HEIGHT_FORM_NAME = 'Height / Weight / BMI'
var bmi = null;
var fixedNum = itemJson.item.significantDigits + 1;
var weight = findFirstItemValueByName(formJson, 'VS_WEIGHT');
// update Study Event and Form Name as needed to look up previously-collected data
var heightForm = findFormData(HEIGHT_FORM_STUDY_EVENT, HEIGHT_FORM_NAME);
var height = findFirstItemValueByName(heightForm[0],'VS_HEIGHT')
if (height && weight) { //BMI = ( Weight in Kilograms / ( Height in Meters x Height in Meters ) )
var heightMtr = (height / 100);
bmi = (Math.round((weight / (heightMtr * heightMtr)) * 10) / 10);
}
return {"value": bmi.toPrecision(fixedNum +1), "measurementUnitName": 'kg/m2'};
Exported and Printed Copies Are Uncontrolled