Defining Routing Rule Sets for HL7
When creating a routing rule set for an HL7 interface, your goal is to tell the production what to do with the source message based on the segments found within it. Sometimes it matters which segments are found; sometimes it matters which values are found within those segments.
In ordinary rule sets, each rule returns a value to the business process that invoked the rule set. In a routing rule set, a rule usually directs an HL7 message to a destination, possibly transforming the HL7 message before sending it.
When you create rule sets, do not use reserved package names; see Reserved Package Names in Developing Productions.
For information on using the rule editor, see Creating and Editing Rules Sets.
-
When you create a new HL7 routing process using the Business Rule Wizard, InterSystems creates a new, empty routing rule set to accompany the new routing process. Its information tables contain the following values:
-
Package Name — The package that contains the production class. For example, if you used the wizard to add a routing process to a production called TestRule.MyTest, the associated routing rule has a Package Name of:
TestRule
-
Rule Name — The simple Routing Rule Name that you chose in the wizard, such as:
MyRule
The combination of the Package Name and Rule Name identify the rule uniquely within the namespace. The full name for any rule definition is the Package Name and Rule Name connected by a dot (.) as in:
TestRule.MyRule
This full name, rather than the Rule Name, is the correct value to use in the BusinessRuleName field when configuring an HL7 routing process. The Business Process Wizard sets this up automatically.
-
Routing Engine Class — The default Router Class from the wizard; do not change it:
EnsLib.HL7.MsgRouter.RoutingEngine
-
-
You may also enter additional fields for your own rule reporting purposes:
-
Report Group — Value to be used to group rules for reporting
-
Report Name — Display value for the rule report group
-
Short Description — Optional short description of this Rule Definition.
-
-
See Using the Rule Constraint Editor for details on entering the constraints of a routing rule.
-
Once you have created a new rule, you may add Conditions and Actions to it. For details, see Creating and Editing Rule Sets. As you add Conditions to each rule, remember these tips:
-
Conditions evaluate AND operators first, then OR.
-
Conditions can refer to properties of the HL7 message object. Within Conditions, the special variable Document represents the HL7 message object, as in the following examples. For HL7 batch documents, you can use the special variable Document.Parent to represent the parent message object.
Document.Name Document.Parent.DocType Document.{PIDgrp.PV1grp.PV1:18} Document.{PIDgrp.PID:PatientName.familylastname} Document.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:4.3}
Note:For compatibility with past releases, the special variables HL7 and HL7.Parent are supported as alternatives to Document and Document.Parent.
A dot separates the Document variable from the property name. This name may be:
-
Any of the class properties: DocType, TypeCategory, BuildMapStatus, or Name.
-
A virtual property, referenced using any of the following conventions:
-
{segmentPath:field}
-
[segmentName:field]
-
Round brackets or parentheses
(multi-valued-property-path)
-
<context|expression>
Details are available in Syntax Guide section of Using Virtual Documents in Productions. However, you do not need to enter properties by typing; you can browse for properties as described in Creating and Editing Rule Sets.
-
-
-
-
Complete the instructions in the next several topics for creating any Source, Target, or Transform items that your routing rule set needs. The items might be:
-
An HL7 business service, to route messages to the rule
-
A DTL data transformation, to transform the message before sending it
-
An HL7 business operation, to route the message to an external application
-
An HL7 routing process may be either a Source or a Target
As you create items, return to the Message Routing Rule Editor to add them to the appropriate fields of the rule definition.
-
-
Return to the diagram on the Production Configuration page. Select the corresponding HL7 routing process. In the BusinessRuleName field, enter the full name of the new routing rule set.
Note that for Hl7 routing rules, the rule editor provides a test option where you can paste the raw text of an HL7 message.