Good afternoon, I have a handout that our OBs use in Labor and Delivery with various lab results, etc for the patient. One of the items on this handout is the Flu Vaccine for the patient. We aren't storing them to obsterms anymore so I have some code that I have used on various forms to show when it was last given that I was trying to use in the handout, but it isn't working.
I have this code first
{!fn DisplayFluHx() {
local hold = getfield(IMMUN_GETLIST("Influenza", "last"), "|", "")
local temp
local rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt <> "") then
rslt = rslt
endif
rslt = rslt + temp[3] + " Vaccine" + " - " + temp[30] + "
"
endfor
return rslt
}}
and then in the field where I want it to display I have this (it's in table form)
LAST FLU SHOT: fnDisplayFLUHx()
Any suggestions to make this work would be greatly appreciated!
Thanks
Linda
I use global for this:
{global hold = getfield(IMMUN_GETLIST("Hepatitis B", "all"), "|", "")
global temp
global rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
if (rslt <> "") then
rslt = rslt + rtntype
endif
rslt = rslt + temp[3] + " Vaccine" + " - " + temp[30] + if temp[18] <> "" then " - " else "" endif + temp[18] + " " + temp [19] + " - " + if temp[7] == "Y" then "was given" else if temp[7] == "N" then "declined" else if temp[7] == "U" then "Undetermined" else "" endif endif endif + if temp[8] <> "" then " - " else "" endif + temp[8] + hret
endfor
rslt}
I know global isn't the cleanest thing to do but it works.
Thanks for the info but I finally got it to work. The changes I made was take out the ! in front of the function and then I but the fnDisplayFLUHx() in curly brackets!
Linda