Route Regular Expressions

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Route Regular Expressions

  • Creator
    Topic
  • #48847

    I’ve heard talk about using one route for multiple events when the xlate code is the same for each event. How exactly is this done in the Route Properties? What are the rules for using regular expressions in this context?

    -- Max Drown (Infor)

Viewing 6 reply threads
  • Author
    Replies
    • #59897
      Mike Grieger
      Participant

        I try to do this more and more – even if the Xlate conditions are not exactly the same for different ADT events, I still like to build only one Xlate and put the event-specific translations in IF statements (checking message type).  Makes maintenance easier when working with only one Xlate file.  **One thing to watch is that the variant layout for each message type is the same.  Even though an Xlate file is configured for a specific message type (A01, for example), I believe the message types are validated against the variant for it’s message type (ie. an A04 message would still be checked for validation against the variants A04 message layout, even though the Xlate is configured for A01).

        Examples of route reg expressions (make sure to check the Wild Card box in Route Config):

        ADT_A(01|04|08)   ADT A01’s, A04’s, A08’s

        ADT_.*                  all ADT events

        reg expressions building here is the same as reg expressions in tcl

      • #59898

        That’s exactly what I’ve been doing except I’ve been copying the xlates for each event.

        -- Max Drown (Infor)

      • #59899
        Charlie Bursell
        Participant

          Max:

          The rules are simple.  When you check “Wild Card Route” in route properties you can then specify a regular expression for the TRXID which will be applied against whatever you specified as the TRXID Determination format.  

          For example if you selected HL7 as the TRXID Determination Format, the regular expression ADT_A0?  would route any ADT_A01 through ADT_A09.

          You can test your regular expressions in a hcitcl prompt by setting a variable to the TRXID and applying the regular expression

          For example

          hctcl> set pat {ADT_A0?}

          hcitcl> set TRXID ADT_A01

          hcitcl> regexp — $pat $TRXID

          hcitcl> 1

          hcitcl> set TRXID ADT_A11

          hcitcl> regexp — $pat $TRXID

          hcitcl> 0

          I hope this helps

        • #59900

          That’s what I needed. Thanks!

          -- Max Drown (Infor)

        • #59901

          So, this is legitimate?

          Code:

          ADT_A(01|02|03|04|06|07|08|09|11|13|31|32|33)

          How do you route invalid events properly (ex. ADT_A05)?

          -- Max Drown (Infor)

        • #59902

          Another question along the same lines … how do you configure the xlate? Here’s what I have currently. It’s set up as an A01, but it actually processes all ADT events.

          Code:

          prologue
             xlt_infile: hl7 2.3 hmis ADT_A01
             who:        mjd2527
             date:       October 19, 2006 2:20:55 PM CDT
             xlt_outfile:        hl7 2.3 hmis ADT_A01
             type:       xlt
             version:    5.0
          end_prologue

          -- Max Drown (Infor)

        • #59903
          Charlie Bursell
          Participant

            Your regexp will work.  It could also be like:

            ADT_A((0[1-46-9)|(1[13])|(3[1-3]))

            Your xlate is OK as long as you either do a bulkcopy or copy MSH.9 and EVN.1 to the output.

        Viewing 6 reply threads
        • The forum ‘Cloverleaf’ is closed to new topics and replies.