Paul Bishop

Forum Replies Created

Viewing 15 replies – 1 through 15 (of 112 total)
  • Author
    Replies
  • in reply to: PROTOCOL:fileset-local save file after processing #122050
    Paul Bishop
    Participant

      What David said is correct.  Here is a little more information.  In the Properties window for fileset-local in the TPS, there is a place to put a tcl proc for parsing the directory and for deleting the files.    For the parsing proc, it is a list of all the files that were found in the folder that is in the Directories field.  For the deleting proc, it is a list of files that were processed by the engine.  This is a proc that I use to move (rename) files to an archive folder after they have been processed.  I have a log file and echoes in the proc that you don’t necessarily need – I just had them there in case I had to do some research at a later point.

      proc move2archive_argument { args } {
      keylget args MODE mode ;# Fetch mode

      switch -exact — $mode {
      start {
      return “”
      }

      run {
      # Get message handle
      keylget args MSGID mh

      # get the user arguments
      set uargs {} ; keylget args ARGS uargs ;# fetch user-supplied arguments
      set arg_dest_dir “” ; keylget args ARGS.DESTDIR arg_dest_dir

      # Check for correct context
      keylget args CONTEXT ctx

      if {$ctx ne “fileset_ibdel”} {
      echo \nERROR proc used in wrong context
      echo Context should be fileset_ibdel
      echo Proc called in: $ctx\n
      return “{CONTINUE $mh}”
      }

      # In this context the message handed to this proc
      # by the driver in not a data message. Rather
      # it is a list of file names from the directory
      # the fileset driver is configured to read.
      #
      # The list of files to process is accessed
      # in the same way data messages in other contexts
      # are accessed.
      #
      # The list is manipulated and returned
      #
      # The fileset driver now processes the files in
      # order they appear in the returned message list.

      set msg_list [msgget $mh]
      set file_time_stamp [clock format [file mtime $msg_list] -format %Y%m%d%H%M%S]
      set current_date [clock format [clock seconds] -format %Y%m%d%H%M%S]
      set ofileid [open file_process.log a]
      puts $ofileid “$msg_list\t$file_time_stamp\t$current_date”
      close $ofileid
      echo \nmove2archive_argument: msg_list: $msg_list\n
      set destination_file $arg_dest_dir
      # echo \ndestination_file $destination_file\n

      file rename -force $msg_list $destination_file

      # Put modified list in the message handle
      msgset $mh $msg_list
      return {}
      }
      }
      }

      Paul Bishop
      Carle Foundation Hospital
      Urbana, IL

      in reply to: TCL function to get todays day minus 5 #122045
      Paul Bishop
      Participant

        you can use the clock command for something like that.  there are other ways too, but this is the way I usually do it:

        #current date minus 5 years

        set todays_date_minus_5 [clock format [clock scan ” – 5 years”] -format “%Y%m%d”]

        there is also a clock add command:

        set todays_date_minus_5 [clock format [clock add [clock seconds] -5 years] -format “%Y%m%d”]

         

        Paul Bishop
        Carle Foundation Hospital
        Urbana, IL

        Paul Bishop
        Participant

          It can be done in a translate.  You would use a temp variable to save the information before moving it to the OBR field.  Make sure the temp variable is initialized first (move @null into it at the top of the Xlate), then in the loop for the NTE segments, you would have the NTE field and the temp variable as the source, use the CONCAT action, and the temp variable as the destination.  If you want to have something between the fields, use the “Separator” field on the CONCAT properties.

          Paul Bishop
          Carle Foundation Hospital
          Urbana, IL

          in reply to: Help with xlateStrTrimLeft/Right #121854
          Paul Bishop
          Participant

            if you used string commands before, it would most likely have been the string range command.  The format is

            string range <string> <first> <last>

            where <string> is the value you are pulling from, either a variable or in quotes

            <first> is the position of the first character to pull (zero based index)

            <last> is the position of the last character to pull (zero based index)

            you can also use “end” as the index values and add adjustments to them if you want such as “end-2” which is the index for the third to last position.

            Paul Bishop
            Carle Foundation Hospital
            Urbana, IL

            in reply to: Enhancement Request: Option to wrap testing tool output #121697
            Paul Bishop
            Participant

              You just need to upgrade your monitor to a 72″ widescreen Jim!  ;-p

              Paul Bishop
              Carle Foundation Hospital
              Urbana, IL

              Paul Bishop
              Participant

                There are multiple ways to do it.  Off the top of my head, if you know that the input will ALWAYS be in that format (YYYYMMDDHHMMSS), then you can use the clock command (copy pre-proc):
                <pre>lassign $xlateInVals in_obx_5
                set out_obx_5 [clock format [clock scan $in_obx_5 -format “%Y%m%d%H%M%S”] -format “%m/%d/%Y %H:%M”]
                set xlateOutVals

                  </pre>
                  The problem with using the clock command is that if it doesn’t match the input format on the scan portion, it will fail.

                  Another way of doing it is to use string range commands to pull out each element of the date and time, and then set the output variable to what you need it to be.

                  There is also the format command, but I always have to look up all the options for it.  Those are the first ones I thought of off the top of my head, but I’m sure there are many other ways as well.

                  I would put coding before it to verify it matches the input format you are expecting (length, all numeric, etc).

                  Hope this helps!

                  Paul Bishop
                  Carle Foundation Hospital
                  Urbana, IL

                  in reply to: reset number of error in thread status #120821
                  Paul Bishop
                  Participant

                    Through the GUI (version 19 and above I believe?), you can double click on the thread in Network Monitor (or right click –> Control –> Full) and on the bottom right column is a “reset statistics” option.  This will reset ALL  statistics except times, not just the error count.

                    Or through a command line, use the hcimsiutil command.  Options are:

                    -X will zero all threads on the site and keep the times
                    -xt <thread> will zero the specific thread and keep the times
                    -xp <process> will zero the threads in the specific process and keep the times
                    -Z will zero all threads on the site including the times
                    -zt <thread> will zero the specific thread including the times
                    -zp <process> will zero the threads in the specific process including the times
                    -E will zero error counts on all threads in the site
                    -ep <proc> will zero error counts on all threads for the specific process
                    -et <thread> will zero error counts for the specific thread

                    I don’t know what version the -E/-e options became available.  entering hcimsiutil without arguments will display the options available in your version.

                    Paul Bishop
                    Carle Foundation Hospital
                    Urbana, IL

                    in reply to: Need to remove leading character #120816
                    Paul Bishop
                    Participant

                      As Jim says, if you are prior to 6.0, the translate string action isn’t available.  This code snippet will do the trick using the copy action in a translate and will remove the first character regardless of what it is.  If your original value happens to be only one character long, it will return a null value.

                      lassign $xlateInVals in_val
                      set out_val [string range $in_val 1 end]
                      set xlateOutVals

                        Source will be the field the data is coming from, and Destination will be where you want it to go.

                        Paul Bishop
                        Carle Foundation Hospital
                        Urbana, IL

                        Paul Bishop
                        Participant

                          What is the “Error:” setting set to on the copy or if command?  If it is set to “Skip”, then you’re correct, it won’t stop with an error.  If it is set to “Error”, you will get a “Fetch failure on ‘<variable name’” error and the process will stop.

                          • This reply was modified 1 year, 9 months ago by Paul Bishop.

                          Paul Bishop
                          Carle Foundation Hospital
                          Urbana, IL

                          in reply to: Unable to bind tcp/ip socket: Address already in use #120785
                          Paul Bishop
                          Participant

                            We have run into this also and it is because of the ephemeral ports (on AIX and same ranges as James’).

                            For AIX you can find what is using that port by using a couple of commands.

                            This returns the PID that is using the port:

                            lsof -i:<port>

                            This will then show what the process is:

                            ps -ef|grep <pid>

                            You can then top the process using the port, start the thread that needs the port, and then restart the process that you just stopped.  Again, this is AIX – not sure what Radhat would use.

                            Paul Bishop
                            Carle Foundation Hospital
                            Urbana, IL

                            in reply to: reset stats for status thread #120758
                            Paul Bishop
                            Participant

                              Look at the hcimsiutil command.  It has options to zero just the counts or the counts and the times, and you can do it by thread, process or the whole site.

                              Paul Bishop
                              Carle Foundation Hospital
                              Urbana, IL

                              in reply to: steps post moving threads to new site #120431
                              Paul Bishop
                              Participant

                                Really the only thing that you need to do after stopping the process and removing any threads in the process on the old site is to delete the process directory located in $HCIROOT/<old site name>/exec/processes/.  I would make sure there aren’t any files in the process directory you want to keep first (process log or error log files), or if you have a thread writing to a file in the process directory.

                                • This reply was modified 2 years, 2 months ago by Paul Bishop.

                                Paul Bishop
                                Carle Foundation Hospital
                                Urbana, IL

                                in reply to: remove \F\ or \T\ or \R\ or \T\ from an HL7 field #120417
                                Paul Bishop
                                Participant

                                  You can do it with a string map command without looping through and finding each occurrence.  I do question why they need to be removed – those are valid escape sequences in HL7 that should be replaced in the destination system when the message is filed.  For example, “\R\” would be replaced by “~” (assuming “|^~\&” on the MSH segment).  I do remember having to do this for a vendor’s embedded and encoded PDF one time because they went through and replaced all the delimiter characters in the encoded PDF – made for a magnificent crash when decoding the PDF.

                                  To do it properly, you should pull out the delimiter characters from the MSH field first and use those rather than hard-coding values.  Assuming this is done in a UPOC tcl:

                                  keylget args MSGID mh
                                  set msg [msgget $mh]
                                  #separator
                                  set fldSep [string index $msg 3]
                                  set subSep [string index $msg 4]
                                  set repSep [string index $msg 5]
                                  set escSep [string index $msg 6]
                                  set sb2Sep [string index $msg 7]

                                  set map_list

                                    # pull out the field from the message you want to change, for example an OBX-5 value, then use the string map command
                                    set obx_5 [string map $map_list $obx_5]

                                    # then replace the OBX-5 value in the message with the one you just fixed above.

                                    If you need more detail on the pulling out and replacing of fields, I can provide that information as well.

                                    Doing this within a translate is also possible, although I’ve never done it that way.  Same concept, just a TCL fragment on the OBX-5 copy.

                                    Paul Bishop
                                    Carle Foundation Hospital
                                    Urbana, IL

                                    Paul Bishop
                                    Participant

                                      There’s really not much you can do in a case like this since you don’t know how many pipes they put in the field.  You can try pushing back at the vendor who is creating the message and see if they can follow the HL7 standards for escaping any delimiter characters, which for the field separator would be “\E\” (assuming “|^~\&” in the MSH segment).

                                      I did get to thinking though, is this in the NTE segment?  If so, the number of fields is limited so you might be able to figure out which pipes are part of the comment.

                                      Paul Bishop
                                      Carle Foundation Hospital
                                      Urbana, IL

                                      Paul Bishop
                                      Participant

                                        this would be done through the route replies function on the outbound thread.  Say you’re routing messages from a vendor to epic with messages coming from thread f_vendor_t and routed to thread t_epic_t.  On the t_epic_t thread, Route Replies tab you would setup a static route back to f_vendor_t.  Make sure that the Outbound tab, Inbound Replies section does not have the hcitpsmsgkill proc setup in the TPS Inbound Reply field or it will kill the replies instead of routing them.

                                        We have this setup for our infusion orders/verifications between the IV pumps and Epic.  When we originally set it up, Epic was insisting that it couldn’t be done through an interface engine but we showed it could and have it working without issues.

                                        Paul Bishop
                                        Carle Foundation Hospital
                                        Urbana, IL

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