filter out messages with compound IF statement in XLATE

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf filter out messages with compound IF statement in XLATE

  • Creator
    Topic
  • #49313
    Duy Nguyen
    Participant

      I want to filter out messages that contain the red portion, which should be SCH-11.1 and SCH-11.2:

      SCH|||||||- ||0|MIN|^0^MINUTES

      Would you guys/gals please review my XLATE statement to see if it’s legitimate as far as syntax goes?  Do I need to add brackets/parentheses anywhere?  Thanks!

      >IF 0(0).SCH.00884(0).[1]  == 0 &&  0(0).SCH.00884(0).[2]  eq =MINUTES

      >SUPPRESS

    Viewing 16 reply threads
    • Author
      Replies
      • #61461
        Nora Katz
        Participant

          Did you try testing it?  Did you get errors?

        • #61462
          garry r fisher
          Participant

            Hi Duy,

            If possible I would filter out these transaction before you get to the XLATE. The xlate is the bottleneck is Cloverleaf and anything you can do to improve throughput by filtering out unwanted messages before your xlate will be beneficial.

            I’d use a TPS rather than an xlate.

            Regards

            Garry

          • #61463
            Duy Nguyen
            Participant

              I’m having no luck with figuring out how to construct a legal compound IF within the XLATE and also running it through the TESTING TOOL w/o problems.

              I will go ahead and code a TPS…but:

              Can you verify that I’m checking for the correct field components, if what I’m wanting to filter on is the portion in RED.  Thank you.

            • #61464
              Vincent Tran
              Participant

                maybe the 0 is a string

                try eq =0

                I was reading up on the Suppress command. Does it do what you want? I was reading the documentation and it said that it sends the message? So it was a bit confusing.

              • #61465
                Duy Nguyen
                Participant

                  It was set to string but still experiencing problems.  Does anyone know how to make a compound IF statement work?

                • #61466
                  Nora Katz
                  Participant

                    Try assigning the zero to a variable first, then use the variable in the if statement.

                    Copy      =0 –>  @zero

                    IF 0(0).SCH.00884(0).[1]  == @zero &&  0(0).SCH.00884(0).[2]  eq =MINUTES

                  • #61467
                    John Mercogliano
                    Participant

                      Try this

                      IF 0(0).SCH.00884(0).[1]  == =0 &&  0(0).SCH.00884(0).[2]  eq =MINUTES

                      Even though you are doing numeric comparison you still have to use the extra equal sign with the 0.

                      John Mercogliano
                      Sentara Healthcare
                      Hampton Roads, VA

                    • #61468
                      Duy Nguyen
                      Participant

                        Nora Katz wrote:

                        Try assigning the zero to a variable first, then use the variable in the if statement.

                        Copy

                      • #61469
                        Nora Katz
                        Participant

                          do you need single or double quotes or curly braces around MINUTES?

                        • #61470
                          Duy Nguyen
                          Participant

                            Here is the test data I’m using:


                            MSH|^~&|FLOWCAST|FLOWCAST|||200705300722||SIU^S15|60780_618_SC8|P|2.3|||AL

                            SCH|||||||- ||0|MIN|^0^MINUTES

                            PID|1||1055358||CHRISTIAN^SHERRIL^D||19310928|M||4|2891 TWIN ACRES DRIVE^^NORMAN^OK^73071||(405)329-1892|(405)325-2054||2||||||||||||||Y

                            PV1|1|O|-

                            NTE|1||NO COMMENT

                            AIP|1


                            XLATE file and testing tool results file are attached

                            Thanks for your help everyone…I’m still tackling what should be an easy issue.

                            [/img]

                          • #61471
                            Nora Katz
                            Participant

                              I only see MSH, I don’t see the rest of the message.  Perhaps you need to select EOF terminated instead of New Line Terminated?

                            • #61472
                              Duy Nguyen
                              Participant

                                I tested both ways…same result.

                              • #61473
                                Michael Hertel
                                Participant

                                  Your data file contains at the end of each segment.

                                  Please fix your data so the segments only end with

                                  then try your testing tool again.

                                  Also, your output contains “Error occurred at: ‘]

                                • #61474
                                  Duy Nguyen
                                  Participant

                                    Michael Hertel wrote:

                                    Your data file contains at the end of each segment.

                                    Please fix your data so the segments only end with

                                    then try your testing tool again.

                                    Also, your output contains “Error occurred at: ‘]

                                  • #61475
                                    Michael Hertel
                                    Participant

                                      Can you post the contents of the file Flowcast_SIU_EMR.xlt here instead of the picture?

                                      Also, did you make sure the file only contained carrage returns in the message?

                                    • #61476
                                      Nora Katz
                                      Participant

                                        Duy,

                                        Michael’s other comment also needs looking into.  “Your data file contains at the end of each segment.”

                                        In your testing tool, you should see all the segments of your message (MSH, SCH, PV1, NTE, AIP) not just the MSH segment.

                                        You should only have a after each segment.  You file appears to have a carriage return and a line feed character after each segment.

                                        Nora

                                      • #61477
                                        Duy Nguyen
                                        Participant

                                          Everything has worked itself out now.  I appreciate all the tips/suggestions!

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