logical and in a smat search

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf logical and in a smat search

  • Creator
    Topic
  • #55159
    John Bonnie
    Participant

      Hello all,

      On cloverleaf 5.8 I’m trying to search a single day of smat to find all messages that contain two conditions.  the first is MDM^T08  and the second is TXA|1|25|

      The search tool seems to be able to search for either of these conditions.  How do you search for the AND of these conditions?

      Thanks,

      John

    Viewing 4 reply threads
    • Author
      Replies
      • #84373
        Jim Kosloskey
        Participant

          I am sure there is a regular expression that can do that but that is not my forte so what I do is to first select messages with the first condition, then remove messages (using ‘exclude’) while using the second condition.

          So the first search gives me all of the messages with MDM^T08, then in that set are some messages which do not have TXA|1|25|. The second search says find all from the MDM^T08 set except those that contain TXA|1|25|.

          Example 3 messages (all MDM^T08):

          TXA|1|1

          TXA|1|2

          TXA|1|25

          The second search says remove all messages ‘except’ those which match TXA|1|25|.

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

        • #84374
          Charlie Bursell
          Participant

            A regexp like:

            {MDM.T08.*?TXA|1|25|} should work

            You could use a look-ahead expression like (?=.*value) but it requires a lot of regex knowledge plus is extremely slow

          • #84375
            Robert Kersemakers
            Participant

              Hi all,

              To start: I normally use Jim’s method by searching twice in a SMAT. You would think Charlie’s regexp would work, but it doesn’t: the carriage returns are the culprits, as far as I can see.

              Twiddled a bit with it and this regexp works for me:

              Code:

              MDM^T08(.*r)*?TXA|1|25

              So first search for MDM^T08, then a repetition of random characters ending with a carriage return, followed by TXA|1|25. This works for me, at least when I did a similar search on ORM^O01 messages with more than 1 OBX segment:

              Code:

              ORM^O01(.*r)*?OBX|1

              Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

            • #84376
              Robert Kersemakers
              Participant

                Oh, I now see another thread referencing an old thread <a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=7501&highlight=regular+expressions&#8221; class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=7501&highlight=regular+expressions where the problem is explained.

                Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

              • #84377
                Charlie Bursell
                Participant

                  As I said I did not try it using the SMAT GUI.  However using my hcismatdb script it works as-is without CR.  The script simply uses the regex passed to it.

                  So perhaps we can surmise it works OK with Tcl but not with the Java that underlines the GUI

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