Needs help creating a letter for patients who have received the flu shot, with (last) date lot#, etc. We are finding employers are requiring this information ( why, I don't know), proof that their employee had the flu shot.
I have this, but it just pulls a list and date...
{global hold = getfield(IMMUN_GETLIST("Influenza", "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}
If you look on the help desk you will see where the above numbers come in: [3] = immunization group name, [30] = date given, etc. Since you want the lot number and I assume the manufacturer you will also want to add in [24], lot #[26] exp date [27] and maybe even administered by [29]
Try this code. You might need to clean it up a bit since the return looks a little sloppy but it will at least give you the results. (I would change the - to : personally).
{global hold = getfield(IMMUN_GETLIST("Influenza", "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[24] <> "" then " Manufacturer- " else "" endif + temp[24] + " " + if temp[26] <> "" then " exp date- " else "" endif + temp[26] + " " + if temp[29] <> "" then " given by- " else "" endif + temp[26] + " " + " - " + 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}
-Andria
Sorry I messed up the first code a bit. This might work better. Check for errors of course:
{global hold = getfield(IMMUN_GETLIST("Influenza", "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[24] <> "" then " Manufacturer: " else "" endif + temp[24] + " " + if temp[26] <> "" then " Lot #: " else "" endif + temp[26] + " " + if temp[27] <> "" then " Exp Date: " else "" endif + temp[27] + " " + if temp[29] <> "" then " Given by: " else "" endif + temp[29] + " " + if temp[7] == "Y" then "" 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}
-Andria
Thanks Andria!
Still learning
Mary