I have a function with a watcher expression set to load if a certain order is entered. The problem is that it only works if the document is put on hold. If the order is entered and the document immediately signed, the function never loads. Here's the function:
{!IF ORD_DESCRIPTION( )=="Consult Request" OR "Eval and Treat" AND ORD_SERV_PROV_BUS_NAME( )<>"Brain and NeuroSpine Clinic Of Missouri LLC" AND ORD_SERV_PROV_BUS_NAME( )<>"" THEN OBSNOW("CARETRANSOUT","Care Transfer Out") ELSE "" ENDIF}
Any ideas??? How is everyone else recording care transfer for meaningful use?
kproffer said:
I have a function with a watcher expression set to load if a certain order is entered. The problem is that it only works if the document is put on hold. If the order is entered and the document immediately signed, the function never loads. Here's the function:
{!IF ORD_DESCRIPTION( )=="Consult Request" OR "Eval and Treat" AND ORD_SERV_PROV_BUS_NAME( )<>"Brain and NeuroSpine Clinic Of Missouri LLC" AND ORD_SERV_PROV_BUS_NAME( )<>"" THEN OBSNOW("CARETRANSOUT","Care Transfer Out") ELSE "" ENDIF}
Any ideas??? How is everyone else recording care transfer for meaningful use?
On the first IF clause I believe you should have ORD_DESCRIPTION( )=="Consult Request" OR ORD_DESCRIPTION( )=="Eval and Treat" AND ...etc
The interpreter needs to know what you are comparing "Eval and Treat" to.
Thanks for your reply. I tried your suggestion and it still works as it did before. The obs term is only recorded if I first put the document on hold. I thought that the watcher expression would take care of this, but it doesn't seem to make a difference. I'm stumped 🙁
One question: After you put it on hold and view the clinical list changes for that document, does the OBS term get populated? The reason I ask is, the exclamation(!) in front of the IF keyword causes the MEL code to run when the form is first opened. So this code will fire when you create the update, but since there is no order placed at that point in time, nothing happens.
My suggestion is to have a button that fires your code, or a checkbox tied to a document variable that is passed into a function. i.e.
{
RecordTransfer(document.IS_TRANSFER_CHECKED)
}
{
fn RecordTransfer(response)
{
If response == "Yes" then
Your code goes here
endif
}
}
Any time the document.IS_TRANSFER_CHECKED document variable is changed, it will fire the code.
Try:
{!IF (ORD_DESCRIPTION( )=="Consult Request"
OR ORD_DESCRIPTION( )=="Eval and Treat")
AND ORD_SERV_PROV_BUS_NAME( )<>"Brain and NeuroSpine Clinic Of Missouri LLC"
AND ORD_SERV_PROV_BUS_NAME( )<>"" THEN
OBSNOW("CARETRANSOUT", "Care Transfer Out")
ELSE
""
ENDIF}
Thanks for your help. I misunderstood how a watcher expression works. I thought that it would continually reevaluate the function, not force it when the form is opened. Anyway, I rearranged where it's called in the form and got it to work. 🙂 On to MU testing!