Xlate IF Contains

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Xlate IF Contains

  • Creator
    Topic
  • #53622
    Johnny Anderson
    Participant

      CL v5.8, Sun Solaris 10, HL7 v2.3.1

      I’ve searched the online help and the forum, can’t find an example of the “contains” operator.

      Example: If abc ct ?? ?? ?? ??  <---I need 01,02,03,etc

    Viewing 6 reply threads
    • Author
      Replies
      • #78322
        Jim Kosloskey
        Participant

          Johnny,

          IF ct =12

          would check the contents of the Source and if it contains ’12’ anywhere the result would be true.

          You can alos use the or connectors (or the and connectors) and I think parentheses as well to relate and order the conditions.

          If you need more detail, email me and I will work with you.

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

        • #78323
          Johnny Anderson
          Participant

            Thanks Jim.  I still need the “?? ?? ?? ??” part.  Just type it here please.

          • #78324
            Jim Kosloskey
            Participant

              Johnny,

              What exactly do you want to check for? The actual charactrs “?? ?? ?? ??” or something else?

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

            • #78325
              Johnny Anderson
              Participant

                This is my first post:

                Example: If abc ct ?? ?? ?? ??  <—I need 01,02,03,etc

                The ?? ?? ?? ?? means I don’t know the format for ct.

                The 01,02,03 is an example of the multiple values I want to put there.

                For example:

                If abc ct ={01,02,03}

                If abc ct [01/02/03]

                If abc ct 123

                If abc ct ____________ <— fill in the blank

              • #78326
                Jim Kosloskey
                Participant

                  Johnny,

                  OK so you want to see if some piece of data (field, temp variable, etc.) contains one of many sets of characters.

                  Such as ‘Does @myvar contain 01 or 02 or 03’.

                  Your IF would look like this:

                  IF @myvar ct =01 || @myvar ct =02 || @myvar ct =03

                  The ‘||’ is obtained by selecting ‘LOGICAL’ from the ‘Category’ pull-down in the IF Action Properties.

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

                • #78327
                  Johnny Anderson
                  Participant

                    That works Jim, Thanks.

                  • #78328
                    Jim Kosloskey
                    Participant

                      Johnny,

                      Another way to do this (mostly with more items) is to populate a Lookup Table with the velues and each of the values returns something like a ‘Y’ with the default being ‘N’.

                      Then do a Table with the data item foloowed by and IF eq =Y and if that is true your data value was one of the table items – if not you did not match.

                      Simpler to change a Lookup table and purge caches than to change an Xlate and a long list of elements can run out of the display pane in the properties.

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

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