Hi. I have a form that uses a button to let the user to set a patient alert (pop-up), such as uncontrolled diabetes. However, I would like the button to not show if the alert already exists. We're getting duplicate alerts, because some of the users are adding the same alert repeatedly. Is there a way to pull in a list of the alerts or pop-ups that are attached to a patient's chart?
Thank you for your help.
I borrowed some code from another function and made this, I did not test it but it should work or at least be close. Put the function in the white space, and then something like this in a visibility field for you button - CheckFlagSubject("Message Subject here") == ""
It will return "Yes" if the message subject is in the patients chart and the delete date is blank and not display the visibility field.
{fn CheckFlagSubject(var){
local temp = ""
local tsize = GETROWCOUNT("_MELFlags")
local rslt = ""
for i = 0, i < tsize, i = i + 1 do
temp = GETROW("_MELFlags",i,"Priority","Subject","Message","FlagType","Sent","Due","Deleted_Date")
if temp[2] == var and temp[7] == "" then
rslt = "Yes"
endif
endfor
return rslt
}}
Thank you. I will give this a try.
And thanks for the help. It is truly appreciated.