Business Rule for HL7 message with implicit AND condition

32 views
Skip to first unread message

FJaffer

unread,
Sep 7, 2016, 1:08:59 PM9/7/16
to InterSystems: Ensemble in Healthcare
Friends,

I need to be able to pass a message only if both these conditions are true, but am not successful, please advise?

If OBR 2 is not null AND OBR 4 is not equal to "PAPFP".... my rule is not working because one condition is true and the other is not, and both need to be true.

Here is what I have in the business rule:
 

(HL7.{PIDgrpgrp(1).ORCgrp(1).OBR:PlacerOrderNumber(1).entityidentifier}!="")&&(HL7.{PIDgrpgrp(1).ORCgrp(1).OBR:UniversalServiceIdentifier.identifier}!="PAPFP")


My message is not crossing because the test code in OBR 4 is PAPFP but OBR 2 is null.


Also, can someone assist me or provide me the syntax with examples for using an IF in the business rule?


Thanks again,

Femina

Lawrence Harris

unread,
Sep 7, 2016, 3:27:31 PM9/7/16
to InterSystems: Ensemble in Healthcare
I am not sure you have worded this correctly?  You say it does not go because OBR 2 is null but that is exactly what you said was the behavior you wanted.  Your condition as written does what you described in the textual description.  Maybe you can clarify what you are trying to achieve.

OBR 2  |  OBR 4       | Result

null       | don't care   | Message is not forwarded
!null      | PAPFP       | Message is not forwarded
!null      | ! PAPFP     | Message is forwarded

This is how I read what you described.

Lawrence

Raghu

unread,
Sep 7, 2016, 3:43:52 PM9/7/16
to Ensemble-in...@googlegroups.com
I don't think '!" works to negate a condition. Try using " '  ". Also, make sure entire condition is wrapped with ()

Thanks
Raghu

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in-Healthcare@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healthcare+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


Thanks & Warm Regards,
Raghu Kodumuri
Sun JavaCAPS Principal Consultant
SSG Technologies
Mobile: 302-897-0096

"I'm a great believer in luck and I find the harder I work, the more I have of it."

"Health is the greatest gift, contentment the greatest wealth, faithfulness the best relationship. by Buddha"

Chat Google Talk: rkodumuri Y! messenger: kodumuri AIM: rkmuri
Contact Me Linkedin


FJaffer

unread,
Sep 7, 2016, 4:25:07 PM9/7/16
to InterSystems: Ensemble in Healthcare
Sorry Lawrence,

The HL7 message has PAPFP (true) in OBR 4, but OBR 2 is null.  The message should pass through.  Do not pass the message on if both conditions are TRUE.  Hope this makes sense now.

Femina

Lawrence Harris

unread,
Sep 7, 2016, 6:35:40 PM9/7/16
to InterSystems: Ensemble in Healthcare
So does that mean if OBR 4 is PAPFP then you always want to forward it but if it's not then only forward it if OBR 2 is not null?

If so then the logic would be:
(HL7.{PIDgrpgrp(1).ORCgrp(1).OBR:UniversalServiceIdentifier.identifier}="PAPFP")||(HL7.{PIDgrpgrp(1).ORCgrp(1).OBR:PlacerOrderNumber(1).entityidentifier}!="")

Lawrence Harris

unread,
Sep 7, 2016, 6:37:18 PM9/7/16
to InterSystems: Ensemble in Healthcare
In the business rules expression editor != is the correct operator.  See http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=EBUS_rulesets#EBUS_ruleset_editor_expression_operators

It's not the Cache operator so they must translate it when the code is compiled, maybe both work?

Lawrence


On Wednesday, September 7, 2016 at 12:43:52 PM UTC-7, Raghavulu Kodumuri wrote:
I don't think '!" works to negate a condition. Try using " '  ". Also, make sure entire condition is wrapped with ()

Thanks
Raghu
On Wed, Sep 7, 2016 at 1:08 PM, FJaffer <femina...@gmail.com> wrote:
Friends,

I need to be able to pass a message only if both these conditions are true, but am not successful, please advise?

If OBR 2 is not null AND OBR 4 is not equal to "PAPFP".... my rule is not working because one condition is true and the other is not, and both need to be true.

Here is what I have in the business rule:
 

(HL7.{PIDgrpgrp(1).ORCgrp(1).OBR:PlacerOrderNumber(1).entityidentifier}!="")&&(HL7.{PIDgrpgrp(1).ORCgrp(1).OBR:UniversalServiceIdentifier.identifier}!="PAPFP")


My message is not crossing because the test code in OBR 4 is PAPFP but OBR 2 is null.


Also, can someone assist me or provide me the syntax with examples for using an IF in the business rule?


Thanks again,

Femina

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com

To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healthcare+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages