Wild card routing example
A wild card route can route a set of messages to one destination. For example, all ADT messages to one destination would use a "ADT.*" wild card.
When a route is first created, a Create Message Route dialog box automatically opens.
After the route is created, double-clicking the route/reply route name on the Property panel opens the Route dialog box.
Consider a route configured to use wild card routing using one of these patterns:
- ORU_R01_2.(3.1)|4.*
- ORU_R01_2\.(3\.1)|4.*
- ORU_R01_2\\.(3\\.1)|4.*
- ORU_R01_2.{3.1,4}* (this is a valid glob pattern, not a valid regex)
Messages using one of these patterns are rejected in state 101 with this error:
[xlt :rout:ERR /0: SUBMIT_xlate:02/21/2008 11:35:58] No routes defined for TrxId 'ORU_R01_2.4_19460407STEF02'
The last expression gives this error:
Bad Regular Expression Route 'ORU_R01_2.{3.1,4}*' couldn't compile regular expression pattern: invalid repetition count(s)
When this TrxID is tested in hcitcl, all above variants match:
hcitcl>regexp -- {ORU_R01_2.(3.1)|4.*} ORU_R01_2.4_19460407STEF02 1
hcitcl>regexp -- {ORU_R01_2\.(3\.1)|4.*} ORU_R01_2.4_19460407STEF02 1
hcitcl>regexp -- {ORU_R01_2\\.(3\\.1)|4.*} ORU_R01_2.4_19460407STEF02 1
The only way to make this work is to remove the parentheses, in which case you must split up the expression into two routes:
ORU_R01_2.4.*
ORU_R01_2.3.1.*
You must also add the ".*" to the end.
This regular expression works:
{^ORU_R01_2\.((3\.1)|4).*}
This message was used with a MSH similar to:
MSH|^~\&|D|EH|PE|XYZ|20070214011500||ORU^R01_2.4_CSZIS|401150112333744|P |2.5|||A
In this example, you must use HL7 version 2.4 or higher. Earlier versions are limited to 7 bytes for MSH.9.