In our vitals form we have the BMI automatically calculated when height and weight are entered. It is not a button but a data display. The problem comes when the note is put on hold and the user comes back to it, the BMI field is empty and BMI information is deleted from the note. I realize that it acts as a calculator and refreshes each time. My question is how to get the Obs Term (BMI) to stay with the note no matter how many times the note is put on hold.
Thanks in Advance.
This only happens with diabetic patients.
The solution depends on how you have the form coded. Can you give more details on how you are assigning the Data Display ? Do you just have the function directly tied to the DD ? If so, try creating a document variable in the MEL code area, for example:
{!DOCUMENT.thisBMI = Your_fnBMI( OBSANY("HEIGHT"), OBSANY("WEIGHT") }
and assigning this document variable to the data display.
- Beverly
//Automatically calculate BMI
local FMVI_watch_newBMI
FMVI_watch_newBMI=FMVI_CalcBMI(OBSNOW("WEIGHT"),OBSNOW("HEIGHT"))
if (FMVI_watch_newBMI=="") then
OBSNOW("BMI","")
else
OBSNOW("BMI",FMVI_watch_newBMI)
endif
} }
{!fn FMVI_CalcBMI(FMVI_cbmi_weight,FMVI_cbmi_height) {
if (FMVI_cbmi_weight=="" or FMVI_cbmi_height=="") then
//If either field is blank, return
return ""
else
if (val(FMVI_cbmi_weight)==0 or val(FMVI_cbmi_height)==0) then
//If either field is zero, return.
return ""
endif
endif
return str((val(FMVI_cbmi_weight) / 2.2) / ((val(FMVI_cbmi_height) / 39.4)^2))
} }
The Data display in the form is just New Observation -BMI
The BMI will repopluate if you make a change to either height or weight.
Thanks for your response Beverly.
Try adding this code to the MEL area of the form.
It will only update DOCUMENT.thisBMI if OBSNOW("BMI") has a value.
{!DOCUMENT.thisBMI = (if OBSNOW("BMI")<>"", OBSNOW("BMI"), DOCUMENT.thisBMI }
And on the form, assign the Data Display to just
{DOCUMENT.thisBMI}
- Beverly
Beverly,
That works for capturing the text into the note, but it now does not display in the form (the data display is blank). Also, when I add it in with other forms the box to enter weight disappears.
Thanks for your help.
Ouch! - Complex form.
So I took a quick look.
You have a typo.
Remove double )) at end
Change
{!DOCUMENT.thisBMI = (if OBSNOW("BMI") <> "",OBSNOW("BMI"),DOCUMENT.thisBMI) )
}
To
{!DOCUMENT.thisBMI = (if OBSNOW("BMI") <> "",OBSNOW("BMI"),DOCUMENT.thisBMI)
}
Hope this fixes the issue.
- B