Good morning, we have started printing the Clinical Visit Summary that was provided by GE and have noticed that we are getting lab results, not just for the last 3 days, but looks like it's giving any lab results. I have one from a patient where it printed lab results for as far back as 2006. We haven't made any changes to the logic on the handout so I don't understand why this is happening.
Any ideas?
Here is what is on the handout:
Labs and Tests received in the past 3 days: {fn fnCVS_LabTestResults() {local list = "" local sz, i, dt, tody, lab, dtbegin, dur local lablist local labs = GET_FLOWSHEET_VALUES('Enterprise\Interfaces\CCD\Diagnostic Results') if labs <> "" then lablist = getfield(labs, "\n", "") sz = 0+size(lablist) for i = 1, i <= sz, i = i + 1 do dt = "" tody = str(._todaysdate) lab = lablist[i] if size(lab) > 0 then dtbegin = match( lab,"/") -2 dt = sub(lab, dtbegin, 10) dur = durationdays(dt, tody) if dur < 4 then list = list + lab +"\r\n" else list = list endif else list = list endif endfor if list == "" then list ="No lab results." endif else list="No lab results." endif return list }}{fnCVS_LabTestResults()}
I can't see anything wrong with the code. Have you tried running a trace?
No, not yet. Will try that though.
We noticed this was happening on our printouts as well - it is a known GE issue:
SPR # 47910: CCC *Patient Education Handout / Clinical Visit Summary pulls values outside the 3 day window specified when "/" is present either in the OBSTERM or the value of the OBSTERM.
then change the function from:
dtbegin = match( lab,"/") -2
to:
dtbegin = match(lab, match(lab,"("), "/") - 2
this should start the matching for the date after the obs value, unless the obs value has a '(' in it.
Thanks so much! That fixed it.
lkeith said:
Thanks so much! That fixed it.