I am trying to develop some code for our patient banner. I have written the following code.
Contact By: {
if (obsany("METHCONTACT")=="secmsg" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Messaging"
ELSE if (obsany("METHCONTACT")=="phone" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Phone"
ELSE if (obsany("METHCONTACT")=="cell" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Cell"
ELSE if (obsany("METHCONTACT")=="" THEN "No Method Chosen"
endif
}
The error I get is "<---COMPILER ERROR NEARBY: RT CURLY BRACE was unexpected after ENDIF Keyword" after the last endif.
What am I missing here?
Thanks for any help. Respond here or directly to my e-mail below.
Warren B. Scott, MD
Family Medicine of Mt. Pleasant, PC
A closing paranthesis and some endif's -
Contact By: {
if (obsany("METHCONTACT")=="secmsg" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Messaging"
ELSE if (obsany("METHCONTACT")=="phone" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Phone"
ELSE if (obsany("METHCONTACT")=="cell" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Cell"
ELSE if (obsany("METHCONTACT")=="") THEN "No Method Chosen"
endif endif endif endif
}
gibsonmi said:
A closing paranthesis and some endif's -
Contact By: {
if (obsany("METHCONTACT")=="secmsg" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Messaging"
ELSE if (obsany("METHCONTACT")=="phone" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Phone"
ELSE if (obsany("METHCONTACT")=="cell" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0 OR match(PATIENT.EMAIL,".")<>0) THEN "Cell"
ELSE if (obsany("METHCONTACT")=="") THEN "No Method Chosen"
endif endif endif endif
}
I tried your code modified as follows:
Contact By: {
if (obsany("METHCONTACT")=="e-mail" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0) OR (match(PATIENT.EMAIL,".")<>0) THEN "Messaging"
ELSE if (obsany("METHCONTACT")=="phone") THEN "Phone"
ELSE if (obsany("METHCONTACT")=="cell") THEN "Cell"
ELSE if (obsany("METHCONTACT")=="") OR if (obsany("METHCONTACT")=="none") THEN "No Method Chosen"
endif endif endif endif
}
When above code is used in the banner on a test patient the following is printed in the banner area...:
Contact By: {
if (obsany("METHCONTACT")=="e-mail" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0) OR (match(PATIENT.EMAIL,".")<>0) THEN "Messaging"
Nothing else shows up. The patient has an e-mail entered so I believe the phrase "Messaging" should print in the banner. At the present time I am using a "test banner" that contains only this code. I had tried all the endif code you suggested earlier. I did indeed miss the end ). I have gone through this code and as far as I can tell all the () balance out. Can you see any other fault in the code? I am admittedly not the best coder around (self taught) but this should not be so difficult.
You also have an extra if near the end, I used this in a test patient banner and it worked.
Contact By: {
if (obsany("METHCONTACT")=="e-mail" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0) OR (match(PATIENT.EMAIL,".")<>0) THEN "Messaging"
ELSE if (obsany("METHCONTACT")=="phone") THEN "Phone"
ELSE if (obsany("METHCONTACT")=="cell") THEN "Cell"
ELSE if (obsany("METHCONTACT")=="") OR (obsany("METHCONTACT")=="none") THEN "No Method Chosen"
endif endif endif endif
}
gibsonmi said:
You also have an extra if near the end, I used this in a test patient banner and it worked.
Contact By: {
if (obsany("METHCONTACT")=="e-mail" AND PATIENT.EMAIL<>"") AND (match(PATIENT.EMAIL,"@")<>0) OR (match(PATIENT.EMAIL,".")<>0) THEN "Messaging"
ELSE if (obsany("METHCONTACT")=="phone") THEN "Phone"
ELSE if (obsany("METHCONTACT")=="cell") THEN "Cell"
ELSE if (obsany("METHCONTACT")=="") OR (obsany("METHCONTACT")=="none") THEN "No Method Chosen"
endif endif endif endif
}
Well Duh. I couldn't see the forest for the trees (or snow or something). Thank you very much. It at least it just gave me "Contact by:" without the rest of the MEL. Now I just have to figure out the correct conditions to be checking for to get the rest of the display to work correctly.