XLT If Statement Conditions

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf XLT If Statement Conditions

  • Creator
    Topic
  • #51069
    Susan Ferraz
    Participant

      I need to add an IF statement on the top of my XLT to filter messages that have certain Zip code.

      For instance, IF ZipCode in (02109,02129,02108,02118,etc…)

      I checked the document and the syntax in the If statement should be the following:

      IF (ZipCode == =A||ZipCode == =B)

      However, because the message is in XML the field name is very long, see example below:

      soap:Envelope.soap:Body.GetCasesInfoResponse.GetCasesInfoResult.Facility.Patients.0(%g1).Patient.FacesheetData.SiteDetailReply.PID.Address.&Zip

      and I’m supposed to add a very long list of zip codes to the condition.

      Is there a better way to write the syntax of this condition?

      something like for instance:

      ZipCode == =(02109,02129,02108,02118,etc…)

    Viewing 3 reply threads
    • Author
      Replies
      • #68670
        Tom Rioux
        Participant

          Depending on how many zip codes you have why not try the following

          1.  Put your zip codes that you want to filter out in a table with a IN value of the zip code and the OUT value as “KILL”

          2.  Have the Table copy statement take the inbound field and copy to a variable name like “@zipped” after translation.

          3.  Then have an IF statement that checks the value of your variable.  If the value is equal to KILL then suppress the message

             

          TABLE    ->  @zipped

          COPY  IF @zipped eq =KILL

                         SUPPRESS

          Hope this helps

          Tom

        • #68671
          Susan Ferraz
          Participant

            Hi Tom,

            I have a long list of zip codes so what you suggested will work for me.

            Thank you so much for your response.

            Susan

          • #68672
            Tom Rioux
            Participant

              If you have the zip codes in a spreadsheet, then you can create a 2 column spreadsheet.  The first column has the zip’s and the second column has “KILL” or “SUPPRESS” or whatever.  Save your file as a .csv file.

              If you search on here someone has posted a tcl proc that creates tables from .csv files.  

              Hope this helps…

              Tom Rioux

            • #68673
              Russ Ross
              Participant

                Here is a clovertech post

                <a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=1578&&#8221; class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=1578&amp;

                that illustrates something similar where I used tps_msg_action to KILL or CONTINUE messages based on what I defined in my lookup table.

                Russ Ross
                RussRoss318@gmail.com

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