Hi,
I need to add a MEL expression in a handout.
patients aged 20 years and older who do NOT have an active diagnosis of hypertension
how do i write this?
I tried doing like below but getting compiler error.
{IF (PATIENT_AGE()>=18 and match(PROB_AFTER("delimited"),1,"ICD-401.9") == 0) THEN "yes" ELSE "no" ENDIF}
i'm getting below compiler error:
{IF (PATIENT_AGE()>=18 and match(PROB_AFTER("delimited"),1,"ICD-401.9") == 0) <-COMPILER ERROR NEARBY: Expect THEN keyword or COMMA. Instead had IDENTIFIER after RIGHT PAREN
can you suggest something please?
You know, I have never seen "AND" or "OR" used in MEL syntax. I wonder if you need to nest the IF statements to create that logic?
Worked fine for me in a quick text after replacing all the quotes from the copy with quotes in Notepad++
{IF (PATIENT_AGE()>=18 and match(PROB_AFTER("delimited"),1,"ICD-401.9") == 0) THEN
"yes" ELSE "no" ENDIF}
I tried the same.. re-typed everything in notepad and copy pasted in EMR, then everything worked. strange! but thank you.
The issue is smart quotes. Those are the fancy quotation marks the text editor pulls in to make it look nicer, which are NOT the same generic quotation marks in standard text. This is a problem that drives me crazy in writing scripts. If there's a nonprinted character in there, or something else nonstandard, it gives you unhelpful error messages. I've had occasion where I couldn't figure out what was wrong with my code, so I just erased the original and retyped it, and it worked fine, with no apparent difference between the texts.
One caveat with the above script - I'd use "ICD-401", rather than "ICD-401.9". ICD-401.9 is only one subset of hypertension, with the rest being 401.x
Dave
My code is actually working with "ICD-401.9" as well. like you said, when i typed the whole expression in notepad and copy pasted in EMR, it works.