How to negate the route

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How to negate the route

  • Creator
    Topic
  • #54503
    Yves Guerin
    Participant

    Dear,

    I have a thread that route (upoc  tclproc) the HL7 messages depending of the “sending facility” from the MSH segment.

    I have one route for AAA, a second route for BBB but for the remaining trxId I want to send them to a generate route with hcitpsmsgkill.  

    I try the _HCI_static_route_ but the messages for AAA and BBB are sent too to this route detail (and the others too), great but I would like to do it more cleanly (no wasting cpu time to kill the AAA and BBB messages)

    I just want to route the messages that aren’t from AAA and BBB to be send to this route

    I try the following pattern routes without any success:

    Code:

    !AAA|!BBB
    [^AAA]|[^BBB]
    .[^AAA]|[^BBB]
    .[^AAA]|[BBB] + wild card on


    but I got “No routes defined…”

    Need help, thx

    Yves

Viewing 3 reply threads
  • Author
    Replies
    • #81758
      Elisha Gould
      Participant

      If there are no cases where the routing will start with the text that is being excluded you could use:

      (?!AAA|BBB).*

      This particular expression excludes routing starting with AAA or BBB, but will allow anything else.

      ie it will exclude

      AAA

      BBB

      AAADDDD

      BBBAAA

      but will include

      BAAA

      ABBB

      DDD

      for info anything inside of (?!REGEX) not equal to REGEX.

      .* will allow match the rest of the text.

    • #81759
      Charlie Bursell
      Participant

      Elisha:

      Be careful with look-ahead either positive or, in this case, negative.  It can be very slow.  Also when use the | symbol you must ambiguosly define what you mean.  The expession you have: (?!AAA|BBB).* would mean do a negative look ahead for a string starting with AA followed by A or B followed by BB.

      It would be better defined as (?!(AAA)|(BBB)).*  which would say do a negative look ahead for a string that starts with AAA or BBB

    • #81760
      Yves Guerin
      Participant

      Dear,

      Thank you for your help, my trxid is only 3 characters and I have AAA, BBB or CCC or DDD but never BAA, ABB.  The trxid is the MSH.3 “sending facility” so the facility name is uniq in my case

      I will test it right away 🙂

      Regards,

      Yves

    • #81761
      Yves Guerin
      Participant

      Dear Everyone,

      Thank so much for your help, it’s work great:

      I use:

      Code:

      (?!(AAA)|(BBB)).*

      with “Wild Card Route” on

      😆  ðŸ˜€  ðŸ˜›

      Regards,

      Yves

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,435
Topic Tags
286
Empty Topic Tags
10