I've been working on a form to help chart prep. In one of the sections i am pulling immunizations and recently it has stopped working. Below is the code I'm using. If anyone has been more successful in pulling a list of immunizations into a letter please let me know and thank you.
{ procs = ""
immunList = IMMUN_GETLIST()
immunListArray = getfield(immunList,"|","|")
if size(immunListArray) > 0 then
for i=1, i<=size(immunListArray), i=i+1 do
immunComponents = getfield(immunListArray[i],"^","")
global pos = match(immunComponents[30], 5, " ")
global tmpstr = ", Not Given - "
if immunComponents[8] == "" then
tmpstr = ", Not Given"
endif
if immunComponents[6] > 0 then
if immunComponents[7] == "N" then
if pos > 0 then
procs = procs + toupper(immunComponents[3]) + ", Series " + immunComponents[6] + tmpstr + immunComponents[8] + ", " + sub(immunComponents[30], 1, pos-1) + "\r\n"
else
procs = procs + toupper(immunComponents[3]) + ", Series " + immunComponents[6] + tmpstr + immunComponents[8] + ", " + immunComponents[30] + "\r\n"
endif
else
if pos > 0 then
procs = procs + toupper(immunComponents[3]) + ", Series " + immunComponents[6] + ", " + sub(immunComponents[30], 1, pos-1) + "\r\n"
else
procs = procs + toupper(immunComponents[3]) + ", Series " + immunComponents[6] + ", " + immunComponents[30] + "\r\n"
endif
endif
else
if immunComponents[7] == "N" then
if pos > 0 then
procs = procs + toupper(immunComponents[3]) + tmpstr + immunComponents[8] + ", " + sub(immunComponents[30], 1, pos-1) + "\r\n"
else
procs = procs + toupper(immunComponents[3]) + tmpstr + immunComponents[8] + ", " + immunComponents[30] + "\r\n"
endif
else
if pos > 0 then
procs = procs + toupper(immunComponents[3]) + ", " + sub(immunComponents[30], 1, pos-1) + "\r\n"
else
procs = procs + toupper(immunComponents[3]) + ", " + immunComponents[30] + "\r\n"
endif
endif
endif
endfor
immunListArray2 = getfield(procs,"\r\n","\r\n")
sort(immunListArray2, TRUE)
procs = ""
for i=1, i<=size(immunListArray2), i=i+1 do
procs = procs + immunListArray2[i] + "\r\n"
endfor
procs
else
procs = ""
global obsstr =
GET_FLOWSHEET_VALUES_PRIOR('Enterprise\Printing\Chart_Summary\Immunizations')
if size(obsstr) > 0 then
procs = "(Immunizations from observation terms) \r\n"
procs = procs + obsstr
endif
procs
endif }
Posted : October 6, 2020 3:15 am