Hello,
I have the following code I would like to use to identify all of the Diabetic problems on my problem list but the result only shows the first Diabetic problem on the list. I know I am missing something easy but, I am not seeing it.
{fn Diabetes(strList){
local dmprobsArray
local tmpstr
dmprobsArray = getfield(prob_after("delimited"), "|", "")
for c = 1, c 0 or match(tmpstr,"TYPE") > 0 AND match(tmpstr,"FH") == 0 AND match(tmpstr,"PRE") == 0) then
return tmpstr
endif
endfor
}}
thank you
cdh
I think your cut/paste did not display correctly.
Below is an example I just did to find Prevner in the immunization list. Same concept of using an IF to determine inclusions. The IDATE thing was to just grab the date and not the date-time.
Key to this is the line under the IF and Prevnar...
Note that I accumulate data into RSLT, and add HRET (carriage return),
I then return the RSLT
{!fn fnImmunHxPrevnar() {
local hold = getfield(IMMUN_GETLIST("", "all"), "|", "")
local temp
local idate
local idatep
global rslt = ""
for i = 1, i <= size(hold), i = i + 1 do
temp = getfield(hold[i], "^", "")
idatep = match(temp[30]," ")
if idatep>7 then
idate = sub(temp[30],1,idatep)
else
idate = temp[30]
endif
if match(temp[4],"Prevnar")>0 then
rslt = rslt + idate + ": " + temp[7] + " : "+ temp[3] + " - " + temp[4] + HRET
endif
endfor
if rslt="" then
rslt = "n/a"
endif
return rslt
}}