We are making a custom form, and we want the last flu shot to display. We use the new Immunization Management HTML form to document flu shots, so I need to pull the data field, and not the obs term.
I'm using a Data Display in VFE with IMMUN_GETLIST('Influenza','last').
This returns a huge ugly string with about a million pieces of information on it. I really just need something short and sweet, like the name of the flu immunization and the date it was given.
Any ideas?
This is what I use to pull all last immunizations:
{!fn fnDisplayImmunHx() {
local hold = getfield(IMMUN_GETLIST("", "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[4] + " - " +*/ 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] + "
"
endfor
return rslt
}}
To pull just flu use:
{!fn fnDisplayImmunHx() {
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[4] + " - " +*/ 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] + "
"
endfor
return rslt
}}
Each temp (ie. temp[3] is the name) is the ^ things you see using your original. I use that to see what fields I want to pull.
The simple for just the vaccine and the date would be:
{!fn fnDisplayImmunHx() {
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
}}
Then fnDisplayImmunHx() goes in your data display