#Business Rules

0 Followers · 126 Posts

Business rules are the part of InterSystems Ensemble production solution which allow nontechnical users to change the behavior of Ensemble business processes at specific decision points.

Question Thomas Haig · Oct 21

Hi all,
Recently we were experimenting with having a variable target on a routing rule and noticed some interesting behaviour, code below.

<rulename="My Rule"disabled="false"><constraintname="docCategory"value="Generic.2.3.1"></constraint><whencondition="((Document.{MSH:MessageType.triggerevent}=&quot;A43&quot;))"><sendtransform=""target="To&quot; _(pContext.Document.GetValueAt(&quot;MSH:SendingFacility&quot;))_&quot;FromServiceTCPOpr"></send></when></rule>
0
0 0
Question PaulSomebody · Oct 3

How do you assign a property in a RUL (not a DTL or BPL) from a function value?  I've tried with the package/classname, without, with .., without and even looked all the way down to the parser but still can't see how.  There is no examples and the documentation doesn't help

So this works

<assign property="RuleActionUserData" value="&quot;A01&quot;"></assign>
 

This doesn't complile

<assign property="RuleActionUserData" value="##class(SomePackage.SomeClass).EventTypeToHL7Type(Document)"></assign>

SomePackage.SomeClass extends EnsRules and the method is a classmethod and final

0
0 0
Question Scott Roth · Aug 28

I had a need for a Filter, but did not want to recreate the wheel by creating another Data Lookup Table, so instead I created a Linked Table that points to a MS SQL Table outside of IRIS.

Once I had the Linked Table, I created a Class Method Function that would query the Linked Table and return a 1 if a result came back.

0
0 0
Question Lewis Houlden · Jul 8

Hi Community

I'm working on a complex piece of rules that needs to check each OBX and evaluate if 3 of the fields match certain criteria. I've tried to achieve this using a Foreach loop, which does work, however it is not as clean as I wanted it. I was hoping I could assign temp variables inside the foreach loop to make the rules more easier to read, for example @testCode @resultText. This is not support as you can only assign inside a when condition. Before I raise this as an idea, i wondered if there was an alternative way to achieve the same thing?

0
0 0
Question Mark OReilly · Oct 25, 2024

We have a scenario where we use the best practice article of a BP and DTL to split up HL7 messages mainly ORUS 

https://community.intersystems.com/post/splitting-oru-messages-using-ob…

It is really useful but we have this code in many places that we are trying to consolidate it in one place. 

We do not want to split it at the first stage in our rules as there is a lot of messages that go to sink. So we are trying for specific rules and the incoming hl7 matches certain rules and classified for certain downstream systems that it is then split and transformed. 

0
0 0
Question Juan Mota Sanchez · May 3

Hi,

I've been working on a very basic Interoperability production in my computer. I followed one of the examples in the courses and created a TEST.FileRouterRoutingRule, but when trying to edit this rule, it takes me to the Rule Editor Login Page, where I can't get in (Not even with the _SYSTEM credentials) - Is this functionality unavailable in the community edition?

0
0 0
Question Scott Roth · Apr 9

I have a segment within a Group (grp) that needs to be validated that it is populated within the message. 

When you use a Foreach within a Business Rule how should you account for the counter in the group?

For example, Epic sends their MFN message in the following format.

MSH~MFI~[~{~MFE~STF~PRA~[~ZPR~]~[~ZLK~]~[~CER~]~[~ZMG~]~[~ZTF~]~[~ZGP~]~[~ZDD~]~}~]

so, the ZLK segment might not exist until the last MFEgrp that is in the message. I need to verify if there is an Employee ID associated with the Provider in the HL7 message before I run it through the translation.

0
0 0
Question Yuhong Snyder · Dec 23, 2024

We have a customized doctype with iterated PIDgrp, so I have a rule that needs to evaluate the pv1:3.1 value to decide which operation the HL& message should go, so I debugged the value in the rule and it definitely should go to the when #2 but it just won't.  so did I do anything wrong or it is just the InterSystems doesn't like the iteration value here? I only need to evaluate the first pv1:3.1

0
0 0
Question Colin Brough · Jan 10

Is it possible to generate INFO level logging events from within a routing rule?
TRACE level events and debugging are easy enough, but we have a case where we have a rule where we want to log messages that are not routed for further processing in the event log as INFO events - in production tracing will be turned off, so TRACE level events won't be visible.

0
0 0
Question Anthony Master · Dec 18, 2024

Very similar question posed here: https://community.intersystems.com/node/467496, but I am missing a piece of this:

How do I correctly call a EnsLib.HL7.MsgRouter.RoutingEngine class from the BPL?I can successfully call the BPL from the EnsLib.HL7.Service.TCPService, and I have the BPL created to delay then call the rule. And I set the context and the result location.

This rule is really basic just sending the HL7 content to a EnsLib.HL7.Operation.TCPOperation

0
0 0
Question Colin Brough · Oct 5, 2023

Is there a difference in outcome between the two screengrabs below?

In both cases, when  certain conditions are met, a transformation is called and the output sent on to two targets. In the first case we surmise the transformation is called twice, and the output of the first run sent to the first target, the output of the second run to the second target. In the second case we surmise the transformation is called once, and the output duplicated and sent to the two targets. 

1
0 240
Question Thomas Vessiere · Sep 17, 2024

Hello.

I have a business process with an "ASTM" class : 

Inside this process i have a business rule. Inside this rule i want to get a specific field inside the message :

So i will use the same logic for HL7 messages. Here is the "path" to the segment and the field : 

So i will use this inside the routing rule like i did for HL7 messages. 

i have tried MUCH prefix like "ASTM" "X12" "ESI.X12" ..... I only got errors like << PROPERTY DOES NOT EXIST >> 

Can someone tell me what i'm doing wrong ?

Thanks.

Thomas.

0
0 0
Question Thomas Haig · Aug 20, 2024

I've been trying unsuccessfully to use a parameter function within a routing rule. I can see the function %GetParameter available in the WYSIWIG rule editor, but I cannot seem to get the inputs for it correct, e.g.

Which gives the error

I have also tried unsuccessfully in code

Is what I am doing possible, and I have a syntax issue? Or is getting a parameter like this not something that can be done in a class of type Ens.Rule.Definition
Thanks

0
0 0
Question Joshua Wigley · Jul 3, 2024

Hello,

I have a slight issue that's causing me some inconvenience when using the rule editor within Microsoft Edge (Version 126.0.2592.81).

Whenever I try to load up any ruleset, the ruleset displays an unhappy face like this:

This has only recently started, when opening up the rule editor in another browser e.g. Chrome, the problem disappears.

I've tried to remedy the situation by resetting Edge, Updating Edge Version, Clearing Cache/Cookies etc. but nothing seems to fix it.

0
0 0
Question Bukhtiar Ahmad · Sep 29, 2020

Hi

I want to check patient class in multiple rules, since the message structure is different to reach out to patient class value, i created a method to get the patient class and put it in a variable. This variable i can use in multiple rules. But somehow function is not able to read the HL7 message. Any tips.

In rules i have this assign line.

Function code looks like this, but in the msg pHL7 dont contain any. I tried getPatientClass(HL7) as well as getPatientClass(HL7.Source)

10
0 1030
Question John Steffen · May 23, 2024

Receiving HL7 messages from our EMR, and processing to send out to downstream system.  These are SIU_S12 messages, with a custom ZOR segment added by the EMR to include order information.  The purpose of including this segment is to allow us to only send messages to the vendor that contain a procedure ID that is included on the list of procedures desired by the vendor.  These values are in a LUT with the procedure ID in the key field, and a value of 1.

0
0 174
Question Krishnaveni Kapu · Apr 26, 2024

I am receiving an XML input to my router and in the routing rule I need to traverse through the xml data , apply a for loop and fetch data.

How can I do that ?

Input :

<?xml version="1.0" encoding="UTF-8"?>
<Input>
   <data>
      <Ids>
         <Id>
            <Type>A</Type>
            <Value>123</Value>
         </Id>
         <Id>
            <Type>B</Type>
            <Value>456</Value>
         </Id>
      </Ids>
   </data>
</Input>

I would like to read 123 from above xml in a rule ..

0
0 183
Question Smythe Smythee · Feb 17, 2024

Hi Community,

Is there a way to call HL7 Data transformation directly from Business service without using Rule functionality in the production

In this scenario i need to call a data transformation in directly in business service and give the transformed message to Business operation 

Please share if you have any ideas to implement this.

Thanks,
Smythee

0
0 241
Article Muhammad Waseem · Oct 15, 2021 2m read

In this article I will demonstrate the following :

  • Update ReferencesRange(OBX:7) against ObservationIdentifier(OBX:3.1)[TestCode] from database by using custom utility function
  • Update Abnormal Flag(OBX:8) against ObservationIdentifier(OBX:3.1)[TestCode]  and ObservationValue(OBX:5)[Result] from database utility function
  • Route Message based on Abnormal Flag(OBX:8)

Below is the primary and transformed HL7 2.5 ORU_R01 message:
 

6
0 894
Question Scott Roth · Jan 19, 2024

Ran into an issue this morning, that I am having a hard time trying to track down what might have caused the issue. We have a Business Rule that sends HL7 ADT to a Business Process that inserts the data into a MS SQL Server using a Custom Business Operation (SQL Outbound Adapter).

2
0 227