Just wondering if anyone out there has a working auto BMI function. We currently utilize a calculation button to do this. A function that would populate the field once the height and weight are entered would be ideal.
I've gotten close, the field populates but only after swapping tabs.
If you can get your function to calculate the BMI correctly try something like this:
{!
DOCUMENT.BMIGOESHERE = str(NameOFBMIFXN(heigh,weight))
}
You may just need to wrap your function call inside a watcher to get it to pull for you. We are doing something similar.
I attached ours to a button, so it populates the fields, prints out the BMI letter if the BMI is outstanding, and adds their BMI to the chart.
Within the form, I use the following calculation:
if (obsnow("Height") <> "" and obsnow("Weight") <> "") or (obsprev("Height") <> "" and obsnow("Weight") <> "") then
OBSNOW("BMI",str(fnCalcBMIConv(OBSNOW("Height"),OBSPREV("Height"),OBSNOW("Weight"))))
OBSNOW("BSA",str(((OBSNOW("Weight")/2.2)^.425)*((OBSNOW("Height"))^.725)*(71.84/10000)))
else ""
endif
I then use a Data Display field with New observation of "BMI".
Finally, I also use the following page close handler:
if PATIENT._AGEINMONTHS < 216 and PATIENT._AGEINMONTHS >= 24 then
If OBSNOW("BMI%ILE") == ""
Then ""
Else cond
case OBSNOW("BMI%ILE") >= 95 If match(toupper(PROB_AFTER("delimited")),"BODY MASS INDEX PED >/EQUAL TO 95TH % AGE")>0
Then ""
Else MEL_ADD_PROBLEM("DX OF","BODY MASS INDEX PED >/EQUAL TO 95TH % AGE","ICD10-Z68.54",str(._todaysdate),"","BMI Problem created from BMI% Calculation","","")
EndIf
case OBSNOW("BMI%ILE") >= 85 and OBSNOW("BMI%ILE") < 95 If match(toupper(PROB_AFTER("delimited")),"BODY MASS INDEX PED 85TH % TO < 95TH % AGE")>0
Then ""
Else MEL_ADD_PROBLEM("DX OF","BODY MASS INDEX PED 85TH % TO < 95TH % AGE","ICD10-Z68.53",str(._todaysdate),"","BMI Problem created from BMI% Calculation","","")
EndIf
case OBSNOW("BMI%ILE") >= 5 and OBSNOW("BMI%ILE") < 85 If match(toupper(PROB_AFTER("delimited")),"BODY MASS INDEX PED 5TH % TO < 85TH % AGE")>0
Then ""
Else MEL_ADD_PROBLEM("DX OF","BODY MASS INDEX PED 5TH % TO < 85TH % AGE","ICD10-Z68.52",str(._todaysdate),"","BMI Problem created from BMI% Calculation","","")
EndIf
case OBSNOW("BMI%ILE") < 5 If match(toupper(PROB_AFTER("delimited")),"BODY MASS INDEX PEDIATRIC < 5TH PERCENTILE AGE")>0
Then ""
Else MEL_ADD_PROBLEM("DX OF","BODY MASS INDEX PEDIATRIC < 5TH PERCENTILE AGE","ICD10-Z68.51",str(._todaysdate),"","BMI Problem created from BMI% Calculation","","")
EndIf
else ""
endcond
EndIf
Else ""
EndIf
I got to be missing something with this, because I get a load of MEL vomit when I plug a height and weight.
This working on form load, but then doesn't evaluate continuously. It's like it using OBSPREV the whole time.
I apologize, I did forget to include a function that we are using in the Code for the form and just now realized this as I was reviewing this today, so this works in conjunction with the code I previously provided:
{! fn fnCalcBMIConv(heightnow,heightprev,weightnow)
{
local heightval = ""
local weightval = ""
If heightnow <> ""
Then heightval = heightnow
Else If heightprev <> ""
Then heightval = heightprev
Else heightval = ""
EndIf
EndIf
if weightnow <> "" then
weightval = weightnow
else
weightval = ""
endif
if weightval == "" or heightval == "" then
return ""
endif
if heightval <= 0 then
return str(0)
endif
return str(((weightval*1)/((heightval*1)*(heightval*1)))*703.0696)
}
}