Hello All,
I am having trouble hiding text in a handout. I would like to hide a couple of items if obs terms have never been entered for a patient. For example:
{if(OBSANY("DATEOFSURG") == "") AND (OBSANY(“SUR PROCNAME”) == "") THEN
""
ELSE
Surgeries
Surgery #1 Date: OBSANY(“DATEOFSURG”) Procedure: OBSANY(“SUR PROCNAME”)
ENDIF}
{if(OBSANY(“SURG DATE#2”) == "") AND (OBSANY(“SURG PROC 2”) == "") THEN
""
ELSE
Surgery #2 Date: OBSANY(“SURG DATE#2”) Procedure: OBSANY(“SURG PROC 2”)
ENDIF}
When the these items are blank in the flowsheet everything works fine. When I populate them with data the area is still blank on the handout. Does anyone have any thoughts?
Thanks,
Brad
1) Have you tried to turn trace on, and verify your thoughts on process?
2) When I run into issues with if-then-else, I simplify to something like
If a>b then "1" else "2" endif
That way, I can verify the execution of statements.
Lastly, take a look at the following to better understand if-then-else with OBS commands mixed with text.
{if LASTOBSVALUE("CC GOAL#1") <> "" then "Goal #1: " +LASTOBSVALUE('CC GOAL#1') + STR(HRET) + "Barrier(s): " +LASTOBSVALUE('CC GOAL#1 TY') + STR(HRET) + "Plan: " +LASTOBSVALUE('CC GOAL#1 ST') + STR(HRET) + "Status: " +LASTOBSVALUE('MGMT PLAN 1') else "" endif}
I notice that after both of your ELSE statements, the text you want to display is not in quotes. I think that your MEL code is trying to run the text as MEL code, and so nothing happens (MEL trace will most likey show that as a failure.)
Try this code in your handout:
{if(OBSANY("DATEOFSURG") == "") AND (OBSANY(“SUR PROCNAME”) == "") THEN
""
ELSE
HRET +"Surgeries" + HRET +HRET +
"Surgery #1 Date: " + OBSANY("DATEOFSURG")+ "Procedure: " + OBSANY("SUR PROCNAME")+ HRET
ENDIF}{if(OBSANY("SURG DATE#2") == "") AND (OBSANY("SURG PROC 2") == "") THEN
""
ELSE
HRET + "Surgery #2 Date: " + OBSANY("SURG DATE#2")+ " Procedure: " + OBSANY("SURG PROC 2") + HRET
ENDIF}
Thank you both for the responses. Part of the issue I am having is with the formatting too. One of the requirements is to provide tables/grid for the handout. My process for creating those in handouts is to create them in Word, copy and paste to Word Pad and then into the handout to prevent an special character issues. So in the else clause I've also got a table as well.
I'd like to show a screen shot of what the handout setup looks like, but the add media tab is throwing an error for me.
We have a few tables in our handouts, and we have found that when you put a table in, you can use MEL in the cells to either show or hide data, but the table cannot be brought in with MEL logic.
Is this printed from the handouts tab, or from a button in a form?
Thank you,
Daniel Carpenter