I have a MEL function that pulls up the date of a signed obsterm and displays text if the last signed date is outside of a date range.
I would like to display a different text if the date is within the date range, and a different text if there is no signed obsterm. Seems the date within range function is giving the "within range" text even if the obsterm doesn't exist.
Would anyone know the MEL to use to do this?
This is what I have now:
1. Quarterly Hemoglobin A1C
{cfmt(LAST_SIGNED_OBS_DATE("HGBA1C"), "" , "Date of last: ", "", " . " ,"")}{if durationdays(last_signed_obs_date("HGBA1C"), str(._todaysdate))>=90 then "Please schedule your annual Diabetic Eye Exam." else if durationdays(last_signed_obs_date("HGBA1C"), str(._todaysdate))<90 then "Up to date." else "" endif endif}
I would like to display "Up to date" only if the date exists within the date range, and "Please schedule..." if the obsterm doesn't exist, meaning the patient has never had this test.
Anna
Anna
Test the lab for a null result in addition to the duration:
{cfmt(LAST_SIGNED_OBS_DATE("HGBA1C"), "" , "Date of last: ", "", " . " ,"")}{if obsprev("HGBA1C") == "" or durationdays(last_signed_obs_date("HGBA1C"), str(._todaysdate))>=90 then "Please schedule your annual exam." else "Up to date." endif}
cfrank said:
Anna
Test the lab for a null result in addition to the duration:{cfmt(LAST_SIGNED_OBS_DATE("HGBA1C"), "" , "Date of last: ", "", " . " ,"")}{if obsprev("HGBA1C") == "" or durationdays(last_signed_obs_date("HGBA1C"), str(._todaysdate))>=90 then "Please schedule your annual exam." else "Up to date." endif}
This works perfectly. Thank you.