Author |
Message
|
jrsetters |
Posted: Thu Sep 22, 2011 5:44 am Post subject: Using Filter module esql to direct messages to a node? |
|
|
 Acolyte
Joined: 24 Aug 2011 Posts: 72 Location: Cincinnati, OH
|
I am using the HL7 message set in toolkit version 7.0.0.2. I need to evaluate the facility identifier in the message and use that to direct the message to a proper topic.
The identifier will come in field 4 of the MSH segment, and will always be one of three values. I was thinking of ways to do this, and thought that the best way might be to create a filter module with three custom output nodes, then use esql to evaluate the content of the message and set the output node based on the value. Is this possible?
To get the value I would do something like this:
DECLARE hl7 NAMESPACE 'urn:hl7-org:v2xml';
DECLARE OutPutNode CHAR;
DECLARE MSHFacility CHAR;
SET MSHFacility =
input.hl7:MSH.hl7:"MSH.4.SendingFacility".hl7:"MSG.1";
Then based on he value of MSHFacility I would send the Output to either node "A", "B", or "C". I am not sure how to accomplish that in the esql though. Any advice?
Thanks! |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Sep 22, 2011 5:48 am Post subject: Re: Using Filter module esql to direct messages to a node? |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
jrsetters wrote: |
Then based on he value of MSHFacility I would send the Output to either node "A", "B", or "C". I am not sure how to accomplish that in the esql though. Any advice? Thanks! |
Code: |
IF <some criteria> THEN PROPAGATE TO TERMINAL 'A' DELETE NONE; ELSE IF <some alternate criteria> THEN PROPAGATE TO TERMINAL 'B' DELETE NONE; END IF; |
_________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 22, 2011 6:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Also read the documentation from the filter node.
Not all ESQL operations are permitted.
InputRoot is not in scope in the filter node, use Root.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Thu Sep 22, 2011 11:00 am Post subject: Re: Using Filter module esql to direct messages to a node? |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
lancelotlinc wrote: |
Code: |
IF <some criteria> THEN PROPAGATE TO TERMINAL 'A' DELETE NONE; ELSE IF <some alternate criteria> THEN PROPAGATE TO TERMINAL 'B' DELETE NONE; END IF; |
|
The DELETE clause is only applicable to the Compute node. There are no Output trees to delete or not delete in a Filter node. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 22, 2011 12:08 pm Post subject: Re: Using Filter module esql to direct messages to a node? |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
rekarm01 wrote: |
lancelotlinc wrote: |
Code: |
IF <some criteria> THEN PROPAGATE TO TERMINAL 'A' DELETE NONE; ELSE IF <some alternate criteria> THEN PROPAGATE TO TERMINAL 'B' DELETE NONE; END IF; |
|
The DELETE clause is only applicable to the Compute node. There are no Output trees to delete or not delete in a Filter node. |
Don't you just have the choice to return true, false or undefined in a filter node?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Thu Sep 22, 2011 2:14 pm Post subject: Re: Using Filter module esql to direct messages to a node? |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
rekarm01 wrote: |
The DELETE clause is only applicable to the Compute node. There are no Output trees to delete or not delete in a Filter node. |
... not to mention the much more relevant point that the PROPAGATE statement doesn't belong in a Filter node at all:
Quote: |
You can use the PROPAGATE statement in Compute and Database nodes, but not in Filter nodes. |
For simple routing, use either the Database, Route, or RouteToLabel node.
fjb_saper wrote: |
Don't you just have the choice to return true, false or undefined in a filter node?  |
Yes: true, false, or unknown. |
|
Back to top |
|
 |
|