FIltering using translation

Clovertech Forums Cloverleaf FIltering using translation

  • Creator
    Topic
  • #121418
    Simon Jamison
    Participant

      Hi,

      I’m trying the following (have also tried = but makes no difference):

      IF 0(0).MSH(0).#3(0).[0] ct=TTK

             SEND

      ELSE

            SUPPRESS

      When I use the test tool with an input file with TTK I get MSH returned:

      MESSAGE 1
      0(0).MSH(0).#1(0).[0].[0] “Field Separator” : >|<
      0(0).MSH(0).#2(0).[0].[0] “Encoding Characters” : >^~\&<
      0(0).MSH(0).#3(0).[0].[0] “Sending Application” : >TTK<
      0(0).MSH(0).#4(0).[0].[0] “Sending Facility” : >disalpha<
      0(0).MSH(0).#7(0).[0].[0] “Date/Time Of Message” : >202405281440<
      0(0).MSH(0).#9(0).[0].[0] “Message Type” : >ADT<
      0(0).MSH(0).#9(0).[1].[0] “Message Type” : >A31<
      0(0).MSH(0).#10(0).[0].[0] “Message Control ID” : >1003237359.A31<
      0(0).MSH(0).#11(0).[0].[0] “Processing ID” : >P<
      0(0).MSH(0).#12(0).[0].[0] “Version ID” : >2.3.1<
      0(0).EVN(0).#1(0).[0].[0] “Event Type Code” : >A08<

      but when I use a file with, say, RTK, I just get:

      MESSAGE 1

      From the above I’m assuming that the translation is suppressing messages without TTK (could be wrong?) but in the ‘real world’ outside the testing tool, as the thired in a chain of translations it doesn’t suppress the message.

      Does anyone have any ideas please?

      For a couple of reason I can’t use gc_filterHL7msgUsingFieldValue

      Thanks,

      Simon

    Viewing 2 reply threads
    • Author
      Replies
      • #121419
        Jim Kosloskey
        Participant

          First, understand the difference between SEND and CONTINUE. SEND sends the message directly to the OB thread bypassing any post Xlate processing, whereas CONTINUE moves the message to the next stage in the engine processing.

          Probably makes no difference in your case, but if later on you want to add some additional processing post Xlate, that processing will be skipped and you are likely to bang your head against a wall trying to figure out why.

          In my ITERATE Class (shameless plug), I recommend always using CONTINUE unless you ABSOLUTELY KNOW you ALWAYS want to skip post Xlate processing.

          OK, the testing tool is showing you there is no message when suppression takes place. Are you saying this Xlate is the third in a chain of Xlates and it is not suppressing there?

          Typically, when I do Filtering in an Xlate and Chaining (I prefer it be chained – does not seem to cause any unacceptable overhead), I place the filtering Xlate first for a couple of reasons:

          1. I don’t want to do processing against the message just to throw it away.
          2. The field I am filtering on may be affected by other activity prior in the chain making my filter unreliable. By being first in the chain I am getting a ‘virgin’ copy of the message. This might be what is happening to you.

          If you still have issues and would like assistance off-line, email me.

          • This reply was modified 6 months, 4 weeks ago by Jim Kosloskey. Reason: first instead of forst

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #121422
          Paul Stein
          Participant

            I agree with Jim – i use xlate chain and put the filter xlate 1st so i don’t have to process a full message that i will throw away.

            Could you consider changing your logic to something like:

            IF 0(0).MSH(0).#3(0).[0] ne =TTK

                   SUPRESS

            *notice the space before the equal sign

            Also – I’d recommend Jim’s ITERATE class. Jim’s has worked with me on a few occasions and it has really helped my understanding of xlate logic, and capabilities.

          • #121441
            Simon Jamison
            Participant

              Jim/Paul,

              Thanks very much for your help. Moving the additional suppression Xlate to the start of the chain of three translations did the trick.

              This is only a temporary workaround so ignoring any downsides/sub-optimal coding 🙂

              Simon

          Viewing 2 reply threads
          • You must be logged in to reply to this topic.