Filter blank hl7 field

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Filter blank hl7 field

  • Creator
    Topic
  • #51494
    Andrew Deters
    Participant

      Does anybody have the tcl code called tpsFilterBlankHL7Field?  I saw it referenced on here but can’t find it.  Any help is appreciated.  I need to filter out messages with a PID 18 field that is either set to “” or blank.

      Thanks,

      Andrew

    Viewing 1 reply thread
    • Author
      Replies
      • #70508
        Mike Campbell
        Participant

          Andrew,  

           I have this code in a pre-proc to filter out messages where both the PID-7 and PID-8 are empty.  I’m sure there might be an easier/cleaner way but I know this code works.

          # Have to find PID

                      set EMPTY 1

                 # Get PID segment fields

                      set PID [split [lsearch -inline -regexp $SEGMENTS {^PV1}] $fldSep]

                      set PID_7 [split [lindex $PID 7] $subSep]

                      set PID_8 [split [lindex $PID 8] $subSep]

                      set Len_PID_7 [llength $PID_7]

                      set Len_PID_8 [llength $PID_8]

                      if {($Len_PID_7 < $EMPTY) && ($Len_PID_8 < $EMPTY)} {return KILL}

        • #70509
          Andrew Deters
          Participant

            Thanks Mike for the reply.  I ended up writing my own tcl proc.  I posted it to the tcl proc library if you want to take a look.

            Thanks,

            Andrew

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