Hello!
I like to display the last two lab values of a pt's A1C. I like for this to appear in the Histories section and to print out on a handout.
Any help is greatly appreciated. Thank you!
You can try something like this: (this example is for bilirubin)
{fn fngetobsarray(obsname, position)
{local obsarr
if OBSPREV(obsname)"" then
obsarr = getfield(LIST_OBS(obsname,"signed","delimited","value"),"|","")
else
return ""
endif
local n,m,buf
n=""
m=size(obsarr)
for n=1, n<=m, n=n+1 do
obsarr[n] = getfield(obsarr[n], "^", "")
buf=(if buf"", buf+"^", "")+obsarr[n][1]+hret+"("+obsarr[n][2]+")"
endfor
local retarr, retsize
retarr = getfield(buf, "^", "")
retsize=size(retarr)
if position<=retsize then
return str(retarr[position])
else
return ""
endif
}}
Total Bilirubin: {fngetobsarray("BILI TOTAL",1)} {fngetobsarray("BILI TOTAL",2)}
We got this from a kind soul who posted a similar array years ago on this forum. Wish I knew who, as I would like to give credit!