I built a button into one of our forms that is supposed to allow the user to quickly see the patients Flu Vaccine Hx.
This is the function that the button is set to run but it is displaying the flu vaccine hx from the previous chart. Anyone know what I need to fix?
{!fn fluvacc()
{userok("Flu Vaccine Hx:" +HRET + INFLUENZA_1)
}}
In this example INFLUENZA_1 is a global variable. If that is not set somewhere else, then it will be an empty string every time. You probably need to look at something like LAST_SIGNED_OBS_VALUE() or IMMUN_GETLIST() depending on how you are storing the vaccine info. If you use the newer HTML form then I think IMMUN_GETLIST("Influenza","LAST") is what you need.
We are using the HTML form so I wasn't quite sure how to make this work with that way that form captures the data. I did try
{!fn fluvacc()
{userok(IMMUN_GETLIST("Influenza","LAST"))
}}
just now and my pop up displays the following:
1864981584909990^1864981584909990^Influenza^^^1^N^Patient decision^N^^V01^^^^^^88^^^^^^^^^^^8/7/2015^jessicaw^2/5/2019 12:00AM^D^^^^^^jessicaw^2/5/2019 10:26 AM^^^^0^N^^1864981452904930^1864981584909990
According to the help guide the output I listed above is appropriate for IMMUN_GETLIST.
Looking for something that would provider a less cluttered view. Preferably the same as what shows on the Immunization History View. The history view is where I came up with the idea to try and use the global variable.
Probably have to clean it up a bit, try something like -
local hold = getfield(IMMUN_GETLIST("Influenza","LAST"),"^","")
if hold <> "" then
if hold[7] == "Y" then
return userok(hold[3] + " - " + hold[30])
else
return userok(hold[3] + " - Not Given: " + hold[8])
endif
else
return userok("None")
endif
That's not working for me either. Now my popup displays:
6 - Not Given: 5
Whoops, corrected the answer, this line needed to be adjusted, you need an array -
local hold = getfield(IMMUN_GETLIST("Influenza","LAST"),"^","")
One last thing....
It now works for patients who have an administration or "not given" reason documented. However, for patients who have nothing recorded under Influenza it is not displaying the userok("None").
Thanks for all your help with this!!