Can someone assist me with providing BMI% for data display?
Thanks in advance!
Are you building your own Vitals form and you are looking to calculate and display the percentile based on the Height, Weight and BMI? Or are you using a vitals form that already calculates the BMI %ile and you just want to display it elsewhere?
Thank you for the further details.
Building my own that autopopulates BMI, but now need to create another field to autopopulate BMI%tile in a data display next to it?
Basically, you will want to build a function that calculates the BMI %ile based on BMI and patient age. after the function calculates the BMI%ile, you can use the folllowing code to save it to an obs term:
{OBSNOW("BMI%ile",percentileVariable)}
All the data display has to do is show a New Observation for "BMI%ile" and it will display there after the function runs. Sorry I do not have a pre-made function for the calculation portion. maybe someone else will have one? If not, I am willing to help get one figured out. (helps me keep my programming skills in practice.)
Thank you,
Daniel Carpenter
Hi,
Here is the function that calculates BMI %. Hope this helps.
{global gHEIGHT = OBSNOW("Height")
global gWEIGHT = OBSNOW("Weight")
global gHEIGHTPREV = OBSPREV("Height")}
{ DOCUMENT.BODY_MASS_IN = str(CalcBMIConv(gHEIGHT,gHEIGHTPREV,gWEIGHT))
OBSNOW("BMI",DOCUMENT.BODY_MASS_IN) }
{fn CalcBMIConv(heightnow,heightprev,weightnow) {
local heightval = ""
cond
case heightnow ""
heightval = heightnow
case heightprev ""
heightval = heightprev
else
heightval = ""
endcond
if weightnow == "" or heightval == "" then
return ""
endif
if heightval == 0 then
return str(0)
endif
return str((weightnow / 2.2) / ((heightval / 39.4)^2))
}}
Latha