If I want to pull in the last 2 or 3 of the same observation from a flowsheet into a form how can I do that or can I do that?
Here is a function I use along with one example of the translation. You may want a different format, but maybe this will help. The basis is the Centricity function List_OBS
{!fn PrintObs(a){
local b = getfield(a,"|","")
local c = size(b)
local f = ""
?
for i = 1, i <= c, i = i + 1
do
local d = getfield(b[i],"^","")
local g = size(d[1])
local e = (If g == 3 then " " Else If g == 2 Then " " Else If g == 1 Then " " Else "" Endif Endif Endif) + fmt(d[1],"B") + " " + d[2] + " "
f = f + e
if i == 4 then
break
endif
endfor
return f}}
{fmt("PRE-VISIT LABORATORY: ","B")}
{!cfmt(PrintObs(LIST_OBS("HGBA1C","signed","delimited","value")),"","A1C: \t\t\t","B","
")}
Thanks I will try that
Try this -
{fn PrevObs(name,num){
local temp = List_Obs(name,"SIGNED","DELIMITED","VALUE")
if temp == "" then return "" endif
local hold = getfield(temp,"|","")
local count = 0
local rslt = ""
if size(hold)<num then count = size(hold) else count = num endif
for i = 1, i<=count, i = i + 1 do
temp = getfield(hold[i],"^","")
if rslt <> "" then
rslt = rslt + hret
endif
rslt = rslt + temp[1] + " (" + temp[2] + ")"
endfor
return rslt
}}{PrevObs("Height",3)}
Sorry late to the party
Thanks Michael. Looks like a nice function you wrote.