I want my pop up :
{
if str(OBSNOW("BMI")) > "25"
then userok("Patient BMI is over 25. Provide patient with some info")
else ""
endif
}
to fire once. How can this be done?
Thanks in advanced!
Just a guess, but does the box launch and launch and launch forever?
If so, then perhaps set a document variable to "true" after the userok. And add a second condition to your initial if statement to and doc-var<>"true".
Thus, you will go through a first time, and then the doc variable is set preventing the userok from successfully launching again.
joeg1962 has a good idea. The other question is how/when do you calculate the bmi? You could modify that function to fire the userok.
it seems to fire after the encounter is put on hold then fires when reopened.
I have the button (type: calculation, target: BMI) that when clicked send the function to a edit field tied to the obs BMI. The pop up fires as the button to calculate is clicked which is perfect, but like i said above it will continue to throw the pop up when reenter the encounter after its been put on hold.
joeg1962, can you provide an example please.
I set mine up like so:
{
if OBSNOW("BP systolic") == "" and str(OBSNOW("BMI")) > "25"
then userok("Patient BMI is over 25. Provide patient with some infomation")
else ""
endif
}
simply because they'll always do a BP within the form but for whatever reason the pop up still fires when put on hold and reenter.
Got it! he's the final piece:
{!
if str(OBSNOW("BMI")) > "25" and document.stoppopup <> "true"
then userok("Patient BMI is over 25. Provide patient with some infomation")
document.stoppopup = "true"
else ""
endif
}