Resending msgs with multiple routes

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Resending msgs with multiple routes

  • Creator
    Topic
  • #50037
    Gary Atkinson
    Participant

    Is it possible to resend messages from one inbound thread that has multiple outbound threads, but only have the messages go to one of the outbound threads?  For example I have one inbound ADT connection that routes the different ADT message types to varies outbound threads.  If I want to resend a few days of smat ADT data to only one of the outbound threads, but resend it through translation again without going to all the other outbound threads; is that possible?  I need to resend inbound pre-tps, because there are some tcl procs and then the translation.  Since I will be resending “old” data I do not want it to go to the other outbound threads, just the one.

Viewing 14 reply threads
  • Author
    Replies
    • #64643
      Greg Eriksen
      Participant

      Gary,

      I haven’t done this as much as some of my coworkers, so maybe others can explain it better than I, but I think what you need to do is create a new temporary thread in that same process group.  Configure it with the route details for just the outbound thread you want to re-send to.  You need to duplicate the same transaction IDs, tcl procs, and Xlates for those routes.  Then you can feed your inbound smat file into the temporary thread and it will re-send to only the outbound connection you want.

      Of course you’ll have to bounce the process once to pick up the configuration of the new thread, and then again when you get rid of it.

      Hope that helps,

      Greg Eriksen

    • #64644
      Gary Atkinson
      Participant

      Greg-

      First thanks for the idea, it sounds promising.  Question though, for the inbound temp. thread, what do I use for the protocol?  I will be resending through the smat tool.

      Thanks!

      Gary

    • #64645
      John Hamilton
      Participant

      Just use the default File with /dev/null.

      It will not pick up any messages and you can send to it using smat. Or you can use the control->full->resend and pick a file to send.

      Or you could use route test. process them to a file and send them as outbound data on the destination thread.

    • #64646
      Gary Atkinson
      Participant

      Thanks all for the help and ideas.

    • #64647

      I could have sworn I added an enhancement request for this exact thing awhile ago, but I can’t find it. May have to add it again.  ðŸ˜ˆ The ability to resend messages only to a specified route would be a HUGE time saver and productivity enhancer.

      But, that being said, this is how I do it. There’s always more than one way to do things. Your mileage mat vary. Yadda yadda yadda …

      Copy the send thread to a new, temporary thread. Remove the routes that you don’t need from the temporary thread. Change the protocol to file (/dev/null). Create a file of HL7 with newlines delimiting each message. I use a little script I wrote that converts smat files to nl files for HL7 messages. Then resend the messages in the file to the new temporary thread using the hcicmd.

      Ex. hcicmd -p conn -c “conn1_in resend ib_pre_tps data 5120 test.txt nl”

      Or, you can resend the file using the NetMonitor by right clicking on the thread and navigating to Control->Full->Resend and filling in the dialog boxes.

      Here’s the perl script I use to convert HL7 smat files to nl files.

      Code:

      #!/hci/quovadx/qdx5.6/integrator/bin/perl

      # msgExtract.pl

      #$/ = “”;

      while (<>) {
         s/rMSH/rnMSH/g;
         s/$/x0A/;
         print;
      }

      Usage: msgExtract.pl smat.file | egrep ‘mrn or something’ > test.txt

      -- Max Drown (Infor)

    • #64648
      Gary Atkinson
      Participant

      Max would you be willing to share your “little script”

    • #64649

      By the way, I use that heck out of that script for all sorts of things. It’s very, very handy when combined with egrep. I have another script that parses the HL7 into fields, too. It does a couple of nice little things like number the MSH field correctly (lines the output up nice and neat) and pads 1-digit numbers with a zero (makes usig grep more easier at times).

      Code:

      #! /usr/bin/perl -lw

      #
      # Name: hl7_list_simple
      # Purpose: Parse HL7 into fields
      #

      # Field delimiter is carriage return for segments
      $/ = “r”;
      $msgnum = 1;

      # Iterate over segments
      while (<>) {
        tr/n//d;
        @fields = split ‘|’, $_;
        $name = shift @fields;
        exit unless $name;
        $name =~ tr/x0B//d;
        $flag = 0;
        $n = 0;

        # Iterate over fields
        for (@fields) {
           tr/x0D//d;
           tr/x1C//d;
           $n++;
           if ($name eq “MSH”)
           {
              if ($flag == 0)
              {
                 print “nMessage $msgnumn”;
                 print “MSH.01: |”;
                 $flag = 1;
                 $msgnum++
              }
              if ($n < 9)         {            $msh_n = $n+1;            print "$name.0$msh_n: $_" if $_;         } else         {            $msh_n = $n+1;            print "$name.$msh_n: $_" if $_;         }         $flag = 1;      }      else      {         if ($n < 10)         {            print "$name.0$n: $_" if $_;         } else         {            print "$name.$n: $_" if $_;         }      }   } }

      Note: I have msgExtract aliased to “me”, hl7_list_simple aliased to “hl7l”, and grep aliased to egrep.

      Ex1. me smat.file | hl7l | egrep ‘^$|Mess|MSH.10|PID.05|PID.18’

      Code:

      Message 1

      MSH.10: 2008051500090355
      PID.05: TEST1^TEST^T
      PID.18: 280741240

      Message 2

      MSH.10: 2008051500090365
      PID.05: TEST2^TEST^T
      PID.18: 280741240

      Message 3

      MSH.10: 2008051500090465
      PID.05: TEST3^TEST^T
      PID.18: 280741141

      Ex2. me bno31cerner_in.tin.msg | hl7l | egrep ‘OBR.04’ | sort -u

      Code:

      me bno31cerner_in.tin.msg | hl7l | egrep ‘OBR.04’ | sort -u
      OBR.04: 0200213^RHCT^HEMATOCRIT – REFERENCE FOR BTB
      OBR.04: 0237107^UA^URINALYSIS W/MICROSCOPY
      OBR.04: 0237206^UDIP^URINE DIPSTICK ONLY
      OBR.04: 0237214^UMICRO^URINALYSIS MICROSCOPIC ONLY
      OBR.04: 0297168^ABORH^ABORH TYPE ECHO
      OBR.04: 0297176^ABS SCREEN^ANTIBODY SCREEN – ECHO
      OBR.04: 0297184^BBCOM^BLOOD BANK TECHNOLOGIST COMMNT
      OBR.04: 0297200^ADMORPH^RBC ADDITIONAL MORPHOLOGY
      OBR.04: 0297341^LUPUSIN^LUPUS INHIBITOR SCREEN

      This is a bit off topic, sorry!

      -- Max Drown (Infor)

    • #64650
      Gary Atkinson
      Participant

      Awesome! Thanks… 😉

    • #64651
      Kevin Kinnell
      Participant

      John Hamilton wrote:

      Or you could use route test. process them to a file and send them as outbound data on the destination thread.

      We do that, and it works pretty well.

    • #64652
      Kevin Scantlan
      Participant

      Another possibility would be to:

      1.  send data from SMAT to a file.

      2.  use the test tool and use Routes tab.  You must designate the an output filename prefix.  The test too will send data to a file for each outbound thread in a post-xlate status (state 7).  

      3.  Pick the file that has the thread name where you want to resend, and resend that file to the outbound thread in a outbound pre-TPS state.  The file is in a length encoded output.

      4.  Delete all the other output files created by the test tool.

    • #64653
      Gary Atkinson
      Participant

      Kevin-

      I tried your method with a test file and it worked great!  One question though.  Can you use the smat file directly in the route tester or do you have to send the smat to file?

      Gary

    • #64654
      Kevin Scantlan
      Participant

      My opinion is that you have save it to a file (either new line delimited or length encoded) first.

    • #64655
      Kevin Kinnell
      Participant

      Gary,

      What I usually do is send the SMAT to a file and just use the len10 output.

      Sometimes  when I need to do more processing than simple include/exclude,

      I’ll use a Perl one-liner (actually, sometimes I remember to use the script

      I wrote for this) to turn the whatever.msg file into a  .nl file:

      Code:

      $ perl -ne ‘s/x0d|MSH/x0dx0a|MSH/g;print’ whatever.msg | do_something_else > testroutethis.nl


      I really don’t recommend that, but it can be alright in a pipeline (as above) if you

      plan to process it a little further before you send it to the route test.  It’s a bit dicey,

      and it doesn’t put a “n” (x0a) at the very end of the file.  Don’t get the ‘|’ chars

      escaped where they shouldn’t be or unescaped where they should…

      that will ruin your day.

      What I should do is learn to use the command line smat and test tools,

      but there are only so many hours in the day…

      –kk

    • #64656
      John Hamilton
      Participant

      In the contrib directory there is a script that will conver smat files to new line files.  It is called smat_to_nl.sh I think. I modifed it so I may have add the .sh.

    • #64657
      Kevin Kinnell
      Participant

      Hum.  Actually, you could Max’s script (Hi, Max) from a few posts back, too…

      –kevin (I really should remember to reread the thread before replying) kinnell

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

Forum Statistics

Registered Users
5,125
Forums
28
Topics
9,294
Replies
34,439
Topic Tags
287
Empty Topic Tags
10