how do I create a pop up if an encounter is missing level of service. I have a function that goes through all ORDERS_NEW() looks for cpt code starting with 'cpt-99' .
How can I use this function to create a pop up box reminding users that level of service is missing. It could be before they leave centain form or before they sign the document.
On whichever form you are using to enter the order, use the function and say if the function returns no value, userok("No Level of Service has been entered") else "" endif
That was easy. Thank you.
Can you share the function you wrote for this?
I would also be interested in the function for no Service Charges entered in Visits
Thanks
{!fn fnLevelOfService(){
local los = getfield(ORDERS_NEW('delimited'),"|",",")
local n
for n=1, n<=size(los), n=n+1
do
los[n]=getfield(los[n],"^","")
endfor
local code
local service_code = 0
for n=1, n<=size(los),n=n+1
do
code = str(los[n][3])
if(match(code,1,'CPT-99') > 0 )
then service_code = 1
endif
endfor
if (service_code == 0) then
userok("No Level of Serice")
else ""
endif
}}
where did you embed this function?
you can put it any where. the script will execute when you open the form
How do you only get it to pop up once you click on the form with the function added? I built an encounter and as soon as I choose it, the pop-up comes up.