Good morning All,
Can someone help a very novice MEL/form builder,
I want to be able to populate an OBSTERM with "Y" if the patient has ever had a Cardiac EF <40.
What OBSANY gives me is if the most recent Cardiac EF is <40. Is there a way I can look at any Cardiac EF <40?
{If OBSANY("CARDIAC EF")<40 THEN OBSNOW("EJECTION FX", "Y") ELSE OBSNOW("EJECTION FX", "N") ENDIF}
Thank You in advance for any and all suggestions!
Rosemary Lust RN
Ambulatory Systems
Management Information Systems
North Mississippi Health Services
Cardiology Associates of North Mississippi
662.620.6806
I don't have a function handy but maybe someone else does. What you need to look at is LIST_OBS. This gives you all the values and dates for a particular obs term. You will want to loop through the results and test to see if the value is less than 40 and if it is, set a value.
Good luck!
Hi there. Not exactly your answer, but a start.
This quicktext will display the date and value for prior LDL results.
I think in your case, substitute your desired OBS code for "LDL" in the second line. Make sure this returns data. Then, you can experiment with analyzing the a1[1] near the bottom to see if it matches. If matches, then set a new variable.
Then, I think using a val command to convert your variable to a number, do what you had as your final statement.
{local sA1, a1, a2=0, a3="", s1="", i=0, imax=0, j=1
sA1 = getfield(LIST_OBS("LDL","signed","list","valuedate"),")",HRET)
if size(sA1)<=10 then imax = size(sA1) else imax = 10 endif
s1=""
for i=1,i<imax,i=i+1 do
a1 = getfield(str(sA1[i])," ","")
a1[2] = sub(a1[2],2)
s1 = s1 + a1[2] + ", " + a1[1] + HRET
endfor
s1}