Help for this novice needed please....
What is wrong with this code that results in 'FALSE' appearing after 'Check Protocols' in the patient banner? We are CPS 12 SR3
{PATIENT.LABELNAME} {if PATIENT.PSTATUS
= "X" then "DECEASED: " + PATIENT.DATEOFDEATH else
"" endif}{if PATIENT.PSTATUS = "I" then "INACTIVE"
else "" endif}{if PATIENT.PSTATUS = "O" then "OBSOLETE"
else "" endif} Resp. Provider: {PATIENT.RESPPROVID} {if
(PATIENT.PSTATUS = "A") AND (listprotocolshort() <> '') then 'CHECK
PROTOCOLS' else '' endif} {if (PATIENT.PSTATUS =
"A") AND (listprotocolshort() <> '') then 'CHECK PROTOCOLS'
userok(""+PATIENT.LABELNAME+" meets criteria for one or more
protocols. To view details click the
'Protocol' tab the left.") else '' endif} Patient ID: {PATIENT.PATIENTID}
{PATIENT.FORMATTEDAGE} -
{PATIENT.SEX} DOB: {Patient.DateOfBirth} Insurance: {INS_PLAN()}
Group: {INS_GRP()} Contact
By: {if PATIENT.CONTACTBY = "" then "None" else
PATIENT.CONTACTBY endif} Home: {if
PATIENT.ALTPHONE = "" then "None" else PATIENT.ALTPHONE
endif} Work: {if
PATIENT.WORKPHONE = "" then "None" else PATIENT.WORKPHONE
endif}
FALSE displaying is normally the result of an IF statement without a matching ELSE.
Suggest changing your two "CHECK PROTOCOLS" to "CHECK PROTOCOLS1" and "CHECK PROTOCOLS2". That way, you will know which IF function is having issues.
[The MEL coding has both in CAPS, but your email note has it cased - so hard to discern which IF is the culprit.]
Thanks for the tip joeg1962. I made the edit and the flase is appearing as a result of the "CHECK PROTCOLS1'.
{PATIENT.LABELNAME} {if PATIENT.PSTATUS = "X" then "DECEASED: " + PATIENT.DATEOFDEATH else "" endif}{if PATIENT.PSTATUS = "I" then "INACTIVE" else "" endif}{if PATIENT.PSTATUS = "O" then "OBSOLETE" else "" endif} Resp. Provider: {PATIENT.RESPPROVID} {if (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> '') then 'CHECK PROTOCOLS1' else "" endif} {if (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> '') then 'CHECK PROTOCOLS' userok(""+PATIENT.LABELNAME+" meets criteria for one or more protocols. To view details click the 'Protocol' tab the left.") else "" endif} Patient ID: {PATIENT.PATIENTID}
{PATIENT.FORMATTEDAGE} - {PATIENT.SEX} DOB: {Patient.DateOfBirth} Insurance: {INS_PLAN()} Group: {INS_GRP()} Contact By: {if PATIENT.CONTACTBY = "" then "None" else PATIENT.CONTACTBY endif} Home: {if PATIENT.ALTPHONE = "" then "None" else PATIENT.ALTPHONE endif} Work: {if PATIENT.WORKPHONE = "" then "None" else PATIENT.WORKPHONE endif}
I added a statement between the else "" and does appear when the if evaluates as not true. However, when the if evaluates as true the FALSE still appears following the CHECK PROTOCOLS1. I can't figure out where is it coming from????
{PATIENT.LABELNAME} {if PATIENT.PSTATUS = "X" then "DECEASED: " + PATIENT.DATEOFDEATH else "" endif}{if PATIENT.PSTATUS = "I" then "INACTIVE" else "" endif}{if PATIENT.PSTATUS = "O" then "OBSOLETE" else "" endif} Resp. Provider: {PATIENT.RESPPROVID} {if (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> '') then 'CHECK PROTOCOLS1' else "No Protocol applies" endif} {if (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> '') then 'CHECK PROTOCOLS' userok(""+PATIENT.LABELNAME+" meets criteria for one or more protocols. To view details click the 'Protocol' tab the left.") else "" endif} Patient ID: {PATIENT.PATIENTID}
{PATIENT.FORMATTEDAGE} - {PATIENT.SEX} DOB: {Patient.DateOfBirth} Insurance: {INS_PLAN()} Group: {INS_GRP()} Contact By: {if PATIENT.CONTACTBY = "" then "None" else PATIENT.CONTACTBY endif} Home: {if PATIENT.ALTPHONE = "" then "None" else PATIENT.ALTPHONE endif} Work: {if PATIENT.WORKPHONE = "" then "None" else PATIENT.WORKPHONE endif}
I separated the commands to make easier to read, below.
Are you sure as the problem is with PROTOCOLS1? I am thinking that your next command has single quotes around the word Protocol; try without those single quotes as a first step.
Why single quotes in a couple of places, and not double quotes? One little gotcha is sometimes the single quote and apostrophe characters become mixed. ` vs. '
{PATIENT.LABELNAME}
{if PATIENT.PSTATUS = "X" then "DECEASED: " + PATIENT.DATEOFDEATH else "" endif}
{if PATIENT.PSTATUS = "I" then "INACTIVE" else "" endif}
{if PATIENT.PSTATUS = "O" then "OBSOLETE" else "" endif}
Resp. Provider:
{PATIENT.RESPPROVID}
{if (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> '') then 'CHECK PROTOCOLS1' else "" endif}
{if (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> '') then 'CHECK PROTOCOLS' userok(""+PATIENT.LABELNAME+" meets criteria for one or more protocols. To view details click the 'Protocol' tab the left.") else "" endif}
Patient ID:
{PATIENT.PATIENTID}
{PATIENT.FORMATTEDAGE} - {PATIENT.SEX} DOB: {Patient.DateOfBirth}
Insurance: {INS_PLAN()} Group: {INS_GRP()}
Contact By:
{if PATIENT.CONTACTBY = "" then "None" else PATIENT.CONTACTBY endif}
Home:
{if PATIENT.ALTPHONE = "" then "None" else PATIENT.ALTPHONE endif}
Work:
{if PATIENT.WORKPHONE = "" then "None" else PATIENT.WORKPHONE endif}
hard to tell if correct, I would change all single quotes to double quotes. looks like you could have 1 double quote in a couple of places when you want 2, but could be 2 single quotes.
Ok....I have it narrowed down to this statement.... the patient name and the userok pop up appears as expected but so does the dagblasted FALSE....
PATIENT.LABELNAME}
{if (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> "") then "CHECK PROTOCOLS" userok (" "+PATIENT.LABELNAME +"meets criteria for one or more protocols. To view details click the Protocol tab the left.") else " " endif}
What happens if you put text in the else, so instead of " " try "Protocols Met"
Just an experiment
Cecil
I tried that and the added statement appears but the FALSE is still there when the Protocol applies
{PATIENT.LABELNAME}
{if (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> "") then "CHECK PROTOCOLS" userok (" "+PATIENT.LABELNAME +"meets criteria for one or more protocols. To view details click the Protocol tab the left.") else "No Protocols apply " endif}
This is the section that is causing the false. If you remove it, it stops. I will keep playing with it. I know this stops your popup and you need that.
Cecil
Try this it works for the true but not sure about the false. Haven't found a patient that is false.
{PATIENT.LABELNAME}
{IF (PATIENT.PSTATUS = "A") AND (listprotocolshort() <> "") then if userok (" "+PATIENT.LABELNAME +"meets criteria for one or more protocols. To view details click the Protocol tab the left.") = 0 or FALSE then "CHECK PROTOCOLS" else "" endif ELSE "No Protocols apply " endif}
Cecil
YEAH!!!!!
It worked!! Thanks a milion.
No problem, glad I could help.
Cecil