Steven Lindsey

Forum Replies Created

Viewing 15 replies – 1 through 15 (of 22 total)
  • Author
    Replies
  • in reply to: Removing ~ #73469
    Steven Lindsey
    Participant

      Ok that does get them all to come out.  What Im trying to do is run those numbers against a table.  The current way seems to group the numbers together.  Here is the full tclproc: I want to run each of those number against the table.  Thanks for your help.

      proc tpsKillAlls_ORC_OBR { args } {

      #########################################################################################

      # Get the Connection/Proc Name for Error/Debug Messages

      #########################################################################################

      global HciConnName

      set myname “$HciConnName/[lindex [info level 1] 0]”

      set nowis [clock format [clock scan now] -format “%D – %T”]

      #########################################################################################

      # Initialize Variables Used

      #########################################################################################

      set dispList {} ;# Disposition List Returned to Engine

      set fldSep “” ;# Field Seperator – get from MSH

      set subSep “” ;# SubField Seperator – get from MSH

      set repSep “” ;# Repeating Field Seperator – get from MSH

      set ORCpos -1 ;# Position of ORC Segment in msg

      set OBRpos -1 ;# Position of OBR Segment in msg

      set ORCList

    • ;# ORC Segment Fields in List Form

      set OBRList

    • ;# OBR Segment Fields in List Form

      set ORCDrList

    • ;# ORC subfields in List Form            

      set OBRDrList

    • ;# OBR subfields in List Form

      set defaultvalue {} ;# Value in table when no his is found

      set ORCDrLocation 12 ;# Dr name

      set OBRDrLocation 16 ;# Dr name

      et OBRDrCC 28 ;# Dr name that is cc for result

      set table “Alls_EHR_Dr”  ;# Table with Dr. number in it.

       

      #########################################################################################

      # Switch based on what mode the engine was in when it called the procedure

      #########################################################################################

      keylget args MODE mode   ;# The mode the engine called from

      switch -exact — $mode {

       start { }

        run {

          set mh [keylget args MSGID] ;# Get message handle from args

          set msg [msgget $mh] ;# Get a copy of the message

           set fldSep [string index $msg 3] ;# Field Seperator

           set subSep [string index $msg 4] ;# Sub-Field Seperator

           set repSep [string index $msg 5] ;# Repeating Field Seperator

           set segList [split $msg r] ;# Split message into segList

      #########################################################################################

      # Find Position of Segments – If missing -> Error out Message and Return

      #########################################################################################

      set ORCpos [lsearch -regexp $segList {^ORC}]

      set OBRpos [lsearch -regexp $segList {^OBR}]

      #########################################################################################

      # Pull out the dr fields and get the Affinity Dr. code

      #########################################################################################

      set ORCList [split [lindex $segList $ORCpos] $fldSep]

      set ORCDrList [split [lindex $ORCList $ORCDrLocation] $subSep]

      set ORCDr [split [lindex $ORCDrList 0] $subSep]

       

      set OBRList [split [lindex $segList $OBRpos] $fldSep]

      set OBRDrList [split [lindex $OBRList $OBRDrLocation] $subSep]

      set OBRDr [split [lindex $OBRDrList 0] $subSep]

      set OBRList [split [lindex $segList $OBRpos] $fldSep]

      set OBRDrList [split [lindex $OBRList $OBRDrCC] $repSep]

        echo $OBRDrList

       

      foreach Dr $OBRDrList {

      set DrNumber [lindex [split $Dr $subSep] 0]

      lappend DrCCList $DrNumber

        }

      echo $DrCCList

         msgset $mh [join $segList r]

      #########################################################################################

      # Check the Dr. Code with the Alls_Dr.tbl and see if it is a match. If there is a match

      # then the message would pass, else kill it.

      #########################################################################################

       

        set value [tbllookup $table $ORCDr]

       

        set value2 [tbllookup $table $OBRDr]

       

        set value3 [tbllookup $table $DrCCList]

        if {

        [string equal $value “YES”]

          || [string equal $value2 “YES”]

          || [string equal $value3 “YES”]

          } then {

            lappend dispList “CONTINUE $mh”

         } else {

           lappend dispList “KILL $mh”

           }  

           

      }

         time { }

         shutdown { }

      } ;# End Switch

      return $dispList

      } ;# End Proc

      Now it just groups the numbers:

      0839 6061 6061

    in reply to: Removing ~ #73466
    Steven Lindsey
    Participant

      Why is that.

      sorry

      in reply to: Removing ~ #73465
      Steven Lindsey
      Participant

        That wroks and shows the values that I need but if i echo the DrNumber out side the brackets it only gives me the last Dr.  I was it that.

        set OBRList [split [lindex $segList $OBRpos] $fldSep]

        set OBRDrList [split [lindex $OBRList $OBRDrCC] $repSep]

        echo $OBRDrList

         

        foreach Dr $OBRDrList {

         

        set DrNumber [lindex [split $Dr $subSep] 0]

        echo $DrNumber

        }

        echo $DrNumber

        msgset $mh [join $segList r]

        Here is what it echo’s

        0839^JUDY^JANE^^^^     6061^JONES^BOB^^^^     6061^KEVIN^COOL^^^^

        0839

        6061

        6061

        6061

        in reply to: Removing ~ #73464
        Steven Lindsey
        Participant

          That worked!

          Thanks

          in reply to: Keying off the first two letters #71837
          Steven Lindsey
          Participant

            Ok. I’m new with the Tcl and I have tried what you said and still having some issues.  Do you have an example that I could see?

            in reply to: Duplicating same message and sending to two venders #71357
            Steven Lindsey
            Participant

              Check to make sure your Wild Card Route is not checked

              in reply to: Sequence Number #70892
              Steven Lindsey
              Participant

                I got it to work.  The pathcopy was causing me the issue and once I switched it to copy it all started to work.  Thanks for everyone

                in reply to: Sequence Number #70889
                Steven Lindsey
                Participant

                  Ok, I think I got it the way you said but I did that before but I guess the reason I didn’t keep that way was because of this error I get.  I don

                  in reply to: Sequence Number #70887
                  Steven Lindsey
                  Participant

                    I think I did what you told me to and I’m still having the same problem.  Here are some screen shoots of the Xlate and Results.  It keeps filling out the GT1 that should not be coming across.

                    in reply to: Sequence Number #70885
                    Steven Lindsey
                    Participant

                      Ok, I’m still having a small issue.  It keeps picking up the GT1 that i nulled out.  Here is my xlate and what it keeps doing.  Can anyone hlep with this.  As you can see it keeps putting the 1 in the null GT1.  I have moved all these areound trying to get this to work and have had no luck.

                      Thanks,

                      Steven

                      in reply to: Sequence Number #70884
                      Steven Lindsey
                      Participant

                        Thanks Russ

                        It works.  Thanks for everyones help.

                        in reply to: Sequence Number #70882
                        Steven Lindsey
                        Participant

                          Thanks Robert,

                          I’m still getting an error.  Here is a screen shot of my Xlate and the error.

                          Thanks,

                          Steven

                          in reply to: Nulling GT1 that has a * #70870
                          Steven Lindsey
                          Participant

                            can you give me an example

                            in reply to: Nulling GT1 that has a * #70868
                            Steven Lindsey
                            Participant

                              The hole GT1 segment

                              in reply to: Nulling GT1 that has a * #70866
                              Steven Lindsey
                              Participant

                                It is a repeating field.  Here is what the message looks like and I want to delete the GT1 if it as a *

                                Viewing 15 replies – 1 through 15 (of 22 total)