We have a form where the nurses enter hemoglobin A1c. We would like to code the next A1c due in the obsterm HGBA1CNXTDUE
Our attempt:
{IF !OBSNOW("HGBA1C") <> "" THEN OBSNOW("HGBA1CNXTDUE", ADDDATES(str(._TODAYSDATE), "0", "0", "92")) ELSE "" ENDIF}
Can someone help us constantly evaluate the presence of a value for HGBA1C. We seem to be having trouble placing the bang (!) to properly constantly evaluate the data symbol HGBA1C
Thanks!
Jack
The Exclimation Mark should come immediately after the opening bracket. e.g.
{! IF OBSNOW(“HGBA1C”) <> “” THEN OBSNOW(“HGBA1CNXTDUE”, ADDDATES(str(._TODAYSDATE), “0″, “0″, “92″)) ELSE “” ENDIF}
It might actually cause MEL errors if you put it anywhere else.
One other note:
Be aware that you are using today's date, which means that if you started the update 2 months ago, put it on hold for some reason, then opened it again 'today', it would recalculate the date using 'todays' date. This would defeat the intended purpose, if I understand it correctly.
Instead, consider using:
{!
if OBSNOW(“HGBA1C”) <> "" then
OBSNOW(“HGBA1CNXTDUE”, ADDDATES(str(sub(str(DOCUMENT.CLINICALDATE),1,10)), "0", "0", "92"))
else ""
endif
}
This approach will 'lock' the date to the date of the document, which also will be the date of the obsnow value for the a1C.
Thanks
All working as desired
JJC