Just starting to use VFE and wanted to test some of our EFE forms. I have imported one that uses a page close handler, but it won't work in VFE. This is a global rule, so it has to function properly.
I do have the Include page close handlers check marked in the Program Options.
Any help would be appreciated. Below is my code.
{if PATIENT_AGE()>="13" and (OBSANY("SMOK STATUS")=="" or (OBSANY("SMOK STATUS")<>"Current every day smoker" and OBSANY("SMOK STATUS")<>"Current some day smoker" and OBSANY("SMOK STATUS")<>"Former smoker" and OBSANY("SMOK STATUS")<>"Never smoker" and OBSANY("SMOK STATUS")<>"Smoker-Current status unknown" and OBSANY("SMOK STATUS")<>"Unknown if ever smoked") or DURATIONDAYS(LASTOBSDATETIME("SMOK STATUS"),str(DOCUMENT.CLINICALDATE)) > 180) then closepage("FALSE") + userok("YOU ARE REQUIRED TO UPDATE SMOKING STATUS") else closepage("TRUE") endif}
{if OBSNOW("Adv to quit")=="" and (OBSNOW("SMOK STATUS")=="Current every day smoker" or OBSNOW("SMOK STATUS")=="Current some day smoker" or OBSNOW("SMOK STATUS")=="Smoker-Current status unknown") then PRINTHANDOUT("Handouts\TOC\Smoking Cessation Resources") endif}
{if OBSNOW("Adv to quit")=="" and (OBSNOW("SMOK STATUS")=="Current every day smoker" or OBSNOW("SMOK STATUS")=="Current some day smoker" or OBSNOW("SMOK STATUS")=="Smoker-Current status unknown") then userok("PATIENT IS A SMOKER" + HRET + HRET + "PROVIDE PATIENT WITH SMOKING CESSATION RESOURCES HANDOUT") + OBSNOW("Adv to quit","Yes") else "" endif}
Thanks,
Sheri
Hi Sheri,
If you look in the VFE help file you can find the following example and note regarding the page close syntax:
NOTE: Unlike the documentation within Centricity® EMR, the proper
syntax to prevent the page from closing is closepage("FALSE"), not
closepage(FALSE). However, the return value from the expression to prevent
closing the page should be the boolean value FALSE, NOT the string. See the
example above which shows proper syntax for both of these expressions.
Also, if you're using CPS10, the page close functions don't work correctly and will kick users out if it's set up to force the page to stay open (you can still use the page close handlers to contain pop up messages and/or set obsterms, but without the closepage function).
Hope that helps!
Thanks for your reply. I had already fixed that part of my code waiting for reposonses. If all I have is the first part, the page will not close until the smoking status is updated. Which is what the expected result. But, when I add any other part of the code, the whole thing stops functioning.
I could really use some help for all the VFE wizzards and miracle workers out there.
Try removing all of the curly braces except the first one and the last one. {if PATIENT_AGE()>="13" and (OBSANY("SMOK STATUS")=="" ....
... "PROVIDE PATIENT WITH SMOKING CESSATION RESOURCES HANDOUT") + OBSNOW("Adv to quit","Yes") else "" endif}
Thank you Paul! That was the trick.