PID;3 cleanup

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf PID;3 cleanup

  • Creator
    Topic
  • #49436
    Mike Christiana
    Participant

      I’m getting the following value from a vendor in PID;3 – 000225^^^^MR~123455698^^^^SS – all I want is  000225, the actual MRN – any ideas?  I’ve tried variations of reexp, regsub and even csubstr to no avail

    Viewing 2 reply threads
    • Author
      Replies
      • #61960
        Keith McLeod
        Participant

          If you use Xlates, you can:

          copy 0(0).PID.00106(0).[0] –> 0(0).PID.00106(0)

          if you only want the first value.  The .[0] at the end addresses the first subcomponent.

          If you are using tcl, you can work thru splitting the message down to the subcomponent and grab the first subcomponent of PID:3 and replace the PID:3 value with this value only before putting the message back together to sending on.

        • #61961
          Greg Eriksen
          Participant

            One approach would be to:

            treat the field content as a list, split on the component separator, and lindex the first element.

            usually component seperator is “^”, but safer to grab it from MSH by something like:

            set compSep [string index $msg 4]

            after getting the PID segment, and splitting it into fields, and getting PID.3:

            set extID [lindex [split $pidFld3 $compSep] 0 ]

          • #61962
            Michael Hertel
            Participant

              We deal with this all the time.

              If you can get down to extracting PID-3 then:

                     set id MR

                     set PIDlist [split $pid3 [cindex $msg 5]]

                     set MRN [lindex [split [lindex $PIDlist [lsearch -regexp $PIDlist $id]] [cindex $msg 4]] 0]

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