Hello All,
I have a fairly simple problem that I need a little assistance with. I am trying to get MEDS_REMOVED() and MEDS_NEW() to pull from a text component and display in a note. Currently I have the following below which works:
Text Component:
{fmt("Medications Removed:", "B")}
{'{MEDS_REMOVED("list")}'}
{fmt("Medications Added:", "B")}
{'{MEDS_NEW("list")}'}
Output:
Medications Removed:
<no value>
Medications Added:
<no value>
However, I am trying to have the text not show if a medication is not added or removed. I have tried this:
Text Component:
{IF (MEDS_REMOVED("list") <> "") THEN
{fmt("Medications Removed:", "B")}
{'{MEDS_REMOVED("list")}'}
else
""
ENDIF}
{IF (MEDS_NEW("list") <> "") THEN
{fmt("Medications Added:", "B")}
{'{MEDS_NEW("list")}'}
else
""
ENDIF}
I get the following error in the note. It indicates that it does not like the '{' directly after the THEN keyword. However, I have tried omitting the '{' and it does nothing when I add or remove the medication. Any thoughts?
{IF (MEDS_REMOVED("list") <> "") THEN
{ <-COMPILER ERROR NEARBY: LEFT CURLY BRACE was unexpected after THEN KEYWORD
Thanks,
Brad
Try this -
{IF (MEDS_REMOVED("list") <> "") THEN
fmt("Medications Removed: ", "B") + MEDS_REMOVED("list")
else
""
ENDIF}
{IF (MEDS_NEW("list") <> "") THEN
fmt("Medications Added: ", "B") + MEDS_NEW("list")
else
""
ENDIF}
Jenn,
Thanks for the suggestion. Unfortunately it does not pull the medications into the note if I add or remove one. That's where I'm in a bind with the braces.
Brad
I got this to work after sitting down and playing with it (THIS IS AWESOME BY THE WAY - OUR NURSES WILL BE SO HAPPY!). We do this in the Patient Instructions with Quicktext '.meds'
{if MEDS_REMOVED("list") <> "" then "Medications Stopped Today: \n\r" +MEDS_REMOVED("list")+"\r" else "" endif}
{if MEDS_NEW("list") <> "" then "Medications Started Today: \n\r" +MEDS_NEW("list")+"\r" else "" endif}
I think Jenn's will work except you will need to enclose each bracket set within another bracket set with an apostrophe at each end so it will evaluate continuously:
{'{ code here}'}