Hello,
I am working on a text component that pulls the allergy list into the note. Currently this is what we use:
Allergies:
{'{ALL_AFTER()}'}
This works nicely because it will update during the visit if the allergy list is updated. The issue that I am trying to fix is if either no value has been entered into the allergy list or NKA has been entered. In these cases it returns: <no value entered>. This doesn't make sense for NKA because a value has been entered and it is confusing to the person reading it. It appears that it was never addressed.
I did a mel trace and ALL_AFTER() returns "" with no allergies. So I tried the following:
{IF ('{ALL_AFTER()}') == "") THEN "No Known Allergies" ELSE '{ALL_AFTER()}' ENDIF}
I continued to get <no value entered> and the subsequent mel trace didn't help. I remembered that when you indicate NKA it also writes to an obs term. So I also tried this:
{IF (OBSANY("NKA") == "T") THEN "No Known Allergies" ELSE '{ALL_AFTER()}' ENDIF}
This returns "No Know Allergies" as I would expect, but unfortunately it doesn't update if you add an allergy during the visit.
Does anyone have any thoughts?
Thanks,
Brad
We have this code on some letters that pull in the allergies. You could give this a try.
{IF ALL_AFTER("LIST")=="" AND OBSANY("NKA")<>"T" AND OBSANY("NKA")<>"FALSE"
THEN "Allergies have not been documented for this patient" ELSE IF
ALL_AFTER("LIST")=="" AND OBSANY("NKA")=="" THEN "Allergies have not been
documented for this patient" ELSE IF OBSANY("NKA") == "T" AND
ALL_AFTER("LIST")=="" THEN "No Known Allergies" ELSE IF
ALL_AFTER("LIST")<>"" THEN ALL_AFTER ("LIST") + "" ENDIF ENDIF ENDIF
ENDIF}
Thanks for your example. That is an improvement on what we use. What I needed to do to get it to update during the visit it to add the {' on either side of the if statement. So using your code it's like this:
{'{IF ALL_AFTER("LIST")=="" AND OBSANY("NKA")<>"T" AND OBSANY("NKA")<>"FALSE"
THEN "Allergies have not been documented for this patient" ELSE IF
ALL_AFTER("LIST")=="" AND OBSANY("NKA")=="" THEN "Allergies have not been
documented for this patient" ELSE IF OBSANY("NKA") == "T" AND
ALL_AFTER("LIST")=="" THEN "No Known Allergies" ELSE IF
ALL_AFTER("LIST")<>"" THEN ALL_AFTER ("LIST") + "" ENDIF ENDIF ENDIF
ENDIF}'}
It will update on a form change or hold. Whereas, similar code using MEDS_AFTER() will update as soon as a med is added to the med list. I guess that adding a med triggers an event that adding an allergy does not.