I have some code that works in a text component as long as it is not continuously evaluated. The code looks like this and it works:
CFMT(MED_LIST_CHANGES(), "", "Medications Updated or Added at Today's Visit" + HRET, "B", HRET + HRET)
This alternate code also works:
{If (MED_LIST_CHANGES() <> "") Then
FMT("Medications Updated or Added at Today's Visit","B") + HRET + FMT(MED_LIST_CHANGES(),"")
else
""
endif}
But if I put either of the blocks of code inside of the continuous evaluation brackets {''} I get a mel parse error that looks like this:
MEL Parse Error: \{'\{CFMT(MED_LIST_CHANGES(), "", "Medications Updated or Added at Today's Visit" + HRET, "B", HRET + HRET)\}'\}\plain\fs20\par} <-EXPECTED RIGHT CURLY BRACE
What am I missing?
Try copying and pasting the text into NOTEPAD, then copy from NOTEPAD back into the text component. It appears that you may have some hidden formatting commands embedded in the text component that is causing the MEL interpreter to fail.
That was my first thought as well, but I have done that a good dozen times so far and even went as far as creating a new text component and pasting from notepad.
Would you mind testing the code on your system?
I even went and tested it in my Live 9.8 as well as test 9.10 system with the same results.
Can you try typing it in again manually? Sometimes that helps - things like the double quote and single quote sometimes are not interpreted correctly.
Also, the following statement does not appear to be a properly constructed if statement; did you mean to put an equal sign or not-equal symbol before the set of double quotes?
{If (MED_LIST_CHANGES() "") Then
I just tried creating a new component and manually typing every character in (no pasting) without luck.The code that I pasted in had a less than followed by greater than sign (not equals) right there. The forum removes it because it interprets it as HTML.I just fixed it by putting < and > in the code.
Would you mind testing this code on your system and see if you get the same result?
Having some pc difficulties (ugh, story for another day), but I do have similar working code in a couple of forms:
{if (MED_LIST_CHANGES()="") then "No Changes to Medication List"
else CFMT(MEDS_AFTER("LIST"), "", "Medications (after today's visit):
", "B", "
")
endif
}{IF OBSNOW("NKMED") = "T" THEN "No Known Medications" ELSE " " ENDIF}
{CFMT(OBSNOW("MEDS REVIEW"), "", "Medications Reviewed: ", "B", "
")}
I found the issue. It is the apostrophe in Today's. I tried escaping it with a \ and with a second apostrophy and I can't get it to print. I guess I will reword it at this point.
You could try numtoascii(039) for the apostrophe.