› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Resending msgs with multiple routes
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
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
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.
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.
#!/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)
#! /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’
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
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)
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.
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.
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
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.nl
$ 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
but there are only so many hours in the day…
–kk
–kevin (I really should remember to reread the thread before replying) kinnell