regex in SMAT views

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf regex in SMAT views

  • Creator
    Topic
  • #51633
    Adrian Benson
    Participant

      We have an issue where we would like to search the HL7 ADTmessages in the SMAT file to find if segment PV1.18 is null.  I was wondering if anyone had regular expression that would perform this search?

      Basically I think what I need is an expression that will ‘count’ up to the 18th “|” character in a string, and then test to see if the immediately following character is also a “|”.

      -Adrian

    Viewing 5 reply threads
    • Author
      Replies
      • #71046
        Robert Milfajt
        Participant

          Now here is an excellent idea for a Cloverleaf enhancement.  Allow searching of SMAT messages by values within specified fields of the message.

          To answer your question, we convert the SMAT .msg file to new line using a couple of UNIX commands, then have TCL scripts read through each message.  Some of the TCL scripts dump txt files to be sucked in by Excel, some just dump matching messages or take counts.  I have provided the commands to convert an .msg file to a new line file.  I do not have a TCL example to search for null PV1.18.

          Code:

          perl -pi.bak -e “s/MSH/x0aMSH/g” ob_di_adt.67.1.msg
          echo >> ob_di_adt.67.1.msg

          Hope this helps,

          Robert Milfajt
          Northwestern Medicine
          Chicago, IL

        • #71047
          James Cobane
          Participant

            One little trick I’ll do if I need to search for a specific value in a field is create a two-statement Xlate (using the same inbound layout for input & output formats); the Xlate contains a BULKCOPY and then an IF condition on the specific field and CONTINUES if the condition is true.

          • #71048
            David Barr
            Participant

              This expression should work in SMAT:

              Code:

              rPV1(|[^|]*){17}||

            • #71049
              Adrian Benson
              Participant

                That worked perfectly David, thanks a lot!  I picked up the little O’Reilly reference book on regular expressions, but now I don’t have to read it. 😉

              • #71050
                Robert Milfajt
                Participant

                  David Barr wrote:

                  This expression should work in SMAT:

                  Code:

                  rPV1(|[^|]*){17}||

                  I keeping this one for a rainy day.  Thanks David!

                  Robert Milfajt
                  Northwestern Medicine
                  Chicago, IL

                • #71051

                  You might find these scripts helpful, too: https://usspvlclovertch2.infor.com/viewtopic.php?t=3097&highlight=useful+hl7+scripts

                  -- Max Drown (Infor)

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