Is there a way to pull in the GET_FLOWSHEET_VALUES of only the last obs values? I'm getting this to work from a flowsheet path but it pulls in all the flowsheet values. I would like to limit this to the last date.
Thanks,
Anna
This is what we use in the CVS, it pulls anything from the last three days you could alter this to fit your needs, I highlighted the 3 day filter for you below. If you wanted to do something like OBSPREV for each you could change the filter to something using match() with lab[1] (the observation name) and list, i think that would work
{fn fnCVS_LabTestResults(){
local list = ""
local i, lab, dur
local lablist
local labs = GET_FLOWSHEET_VALUES("Enterprise\ProCare\Labs","DELIM")
if labs <> "" then
lablist = getfield(labs, "|", "")
for i = 1, i <= size(lablist), i = i + 1 do
lab = getfield(lablist[i],"^","")
if size(lab) > 0 then
dur = durationdays(lab[3], str(._todaysdate))
if dur < 4 then
list = list + lab[1] + ": " + lab[2] + " (" + lab[3] + ")\r\n"
endif
endif
endfor
if list == "" then list ="No lab results." endif
else
list="No lab results."
endif
return list
}}{fnCVS_LabTestResults()}