Forum Replies Created
-
AuthorReplies
-
Bumping an old thread because I’m encountering something strange with iterating into a flat file.
I am splitting a message with repeating FT1 groups into individual messages. Within the iterate on the FT1 basis, I have an iterate on a FT1.19. FT1.19 is empty, most of the time. However, once it is populated, every subsequent message that is split off becomes populated with the values from the FT1 instance that was valued.
For example, here is one message generated from the xlate:
[code]Max, thanks so much for these scripts. Where should these procs be placed? On the inbound/outbound tps? On the route?
Specifically, I am looking to take a message with a base64 encoded PDF and write the PDF file out to a directory using the decode function.
Sorry to have to bump this old thread, but I just noticed that the SMAT files for some of my FTP threads were empty, and the exec/processes/ftp directory had some large temp files in them. I stopped the threads, backed up the temp files and deleted them, and restarted the threads. I’ll be keeping an eye on the threads to see if the .idx and .msg files start populating. I also got a warning about opening SMAT files from an older version when I tried to open some of them.
What would cause the [thread]-FTP-temp files to get so large, and why would the messages not write to the SMAT files as expected? Is this an indication of something going wrong with the threads?
Thanks for your help, guys. I walked through the steps, and I still get errors on the script, even when using the testing tool.
I jumped over to try the testing tool on the Master site, and it worked as expected (since the proc is local, there). Running the testing tool on one of the non-master sites produces the error. I tried cycling the daemons, running mktclindex on all of the sites, bouncing all of the processes.
Finally, I cycled the host server. I feel like I already tried it, but it seems to have fixed it. Maybe the root proc was still there until the host server was cycled?
In any event, thanks again. Master Site should be good to go.
Having moved the tcl procs from root to master site in our Test environment, I now get tcl errors when the script is called.
Command Issued: hcitpstest -r run -x ASCII -f len10 -c sms_ib_data /qvdxdev/qdx6.0/cis6.0/integrator/test01/adt_a01_sample.txt “filter_msgs_continue3 {SEGFLD {PV1-2 PV1-10}} {VLIST {{I E S} {CVE CVI CVR END HBC IRP IVT LTH OSP OWC PAP PMG SDS SUR VAS}}} {OP {OR}}”
Command output:
[0:TEST] Tcl error:
msgId = message0
proc = ‘filter_msgs_continue3’
args = ‘{SEGFLD {PV1-2 PV1-10}} {VLIST {{I E S} {CVE CVI CVR END HBC IRP IVT LTH OSP OWC PAP PMG SDS SUR VAS}}} {OP {OR}}’
result = ”
errorInfo: ‘
invalid command name “filter_msgs_continue3”while executing
“filter_msgs_continue3 {MSGID message0} {CONTEXT sms_ib_data} {ARGS {{SEGFLD {PV1-2 PV1-10}} {VLIST {{I E S} {CVE CVI CVR END HBC IRP IVT LTH OSP OWC P…”‘
I have run mktclindex in all of the tclprocs directories, including root. I have cycled the daemons in the master site and the test site that I am using. I have checked file permissions on the script.
Does anything special need to take place since this script was previously in ‘root’? What am I missing?[/b]
Excellent information, as always, Jim.
One more question: If a site has an HL7 variant or tcl proc with the same name, will it override the master site, or will the master site override it?
Steve Williams wrote:John,
Gonna bump this ancient thread to see if there exists any way to edit root tcl procs via the Script Editor in 6.0.
I currently FTP from the server to my PC, editing in Notepad++, and FTP it back to the server. Being able to access it via the Script Editor would cut out some steps.
Thanks for the suggestions. I’ll make sure to initialize the variables.
As it turns out, I was missing a second set of brackets to specify that SMH MRN was a single list item, rather than two items in the same list.
I am trying to do something similar with a filter proc. Basically, I will pass field names along with wanted values, and it will kill any messages that do not have the desired values in the desired fields. I use a foreach loop to check all 3 arguments in parallel (SEGFLD1 + VLIST1 + SUBSTR1 | SEGFLD2 + VLIST2 + SUBSTR2 | etc).
For example, I would pass the following args:
{SEGFLD {PID-2 PID-2.5}} {VLIST {1074653 {SMH MRN}}} {SUBSTR {}}
It successfully checks for 1074653 in PID-2. My problem is that PID-2.5 contains MRN, so when I do an [lsearch -exact $value [string range $fvalue $subfirst $sublast], it finds MRN in {SMH MRN}, but I want it to match the entire string, “SMH MRN”. Is this a consequence of using the foreach? Is it an issue with the lsearch?
Code:proc filter_msgs_allow_test2 { args } {
global HciConnName
set mode [keylget args MODE]
set DebugOn 1set context [keylget args CONTEXT]
if { ![info exists HciConnName] } {
set HciConnName “UNKNOWN_TD”
}
set segflds [keylget args ARGS.SEGFLD] ;# User supplied list of fields
set values [keylget args ARGS.VLIST] ;# User supplied list of values
set substrings [keylget args ARGS.SUBSTR] ;# User supplied list of substringsset module “$HciConnName/ filter_msgs_ALLOW_test2” ;# for error reports
switch -exact — $mode {
start {
return “” ;# Nothing specific
}run {
set dispList {}
set mh [keylget args MSGID] ;# Message header
set msg [msgget $mh] ;# The message
set fldsep [csubstr $msg 3 1] ;# Field separator (|)
set subsep [csubstr $msg 4 1] ;# Subfield sep (^)
#
# Split the message into segments
#
set segments [split $msg r]
foreach segfld $segflds value $values substring $substrings {
set seg [lindex [split $segfld -] 0]
set fld [lindex [split $segfld -] 1]
set fldnum [lindex [split $fld .] 0] ;# and field…
set subfldnum [lindex [split $fld .] 1] ;# And subfield
set subfirst [lindex [split $substring] 0] ;# First index in substring
set sublast [lindex [split $substring] 1] ;# Last index in substring
if {$subfirst < " "} {
set subfirst 0
set sublast end
}if {$subfldnum < " "} {
set subfldnum 0
} else {
set subfldnum [expr $subfldnum – 1]
}#
# Get the desired segment location
#
set segnum [lsearch -regexp $segments ^$seg]if {$DebugOn} {
echo "seg-field: $seg-$fldnum.[expr $subfldnum + 1]"
echo "Wanted Values: " $value
echo "subfirst: {$subfirst} | sublast: {$sublast}"
}if {$segnum = 0} {
if {$DebugOn} {echo “$module: Based on criteria to this point, CONTINUE message”
echo “$seg-$fldnum.[expr $subfldnum + 1] value: $fvalue — GOOD: $value”
}
} else {
if {$DebugOn} {echo “$module: Message KILL’d”
echo “$seg-$fldnum.[expr $subfldnum + 1] value: $fvalue — GOOD: $value”
return “{KILL $mh}”
}
}
}
}
#
# If no criteria were met to kill the message, send it
#
return “{CONTINUE $mh}”
}shutdown {
# Doing some clean-up work
}default {
return “” ;# unknown mode
}
}
}I have created Xlates for all of our receiving systems and ran each message type through the testing tool, checking against the existing xlates for consistency. I am now looking to configure wildcard routing and begin testing the changes, but I would like to test one system at a time.
My question is if I can add receiving systems to the wildcard route as I go and leave the existing routes, or will the Wildcard Route supercede the other routes?
For example, if and A01 comes through and I have ADT^A[0-3][0-8].* as well as ADT^A01 defined, will Cloverleaf use both routes, or will it use the first one only?
bill bearden wrote:John,
Try this slight modification to Charlie’s code. lsearch with the -all switch will return a list of indexes when it finds multiple matches. You probably need to iterate through the result of the lsearch, just in case it returned a list and not a single value.
[code]set rmList {}set rmList {}
# Loop through each GT1.
# Loop through each GT1.I am trying to do something similar. I have a list of segments that need to be removed.
set seglist2
- I am searching through the message for each of these segments and copying their indices. A problem occurs when the segment repeats, as there are two indices in one member of the list, and the following error is thrown:
Code:[0:TEST] Tcl error:
msgId = message0
proc = ‘tps_adt_trim_segs’
args = ”
result = ”
errorInfo: ‘
expected integer but got “6 7”
while executing
“lsort -integer -decreasing $rmList”
(procedure “tps_adt_trim_segs” line 74)
invoked from within
“tps_adt_trim_segs {MSGID message0} {CONTEXT sms_ib_data} {ARGS {}} {MODE run} {VERSION 3.0}”‘When I try to split the entries in the list on spaces, I get a different error:
Code:[0:TEST] Tcl error:
msgId = message0
proc = ‘tps_adt_trim_segs’
args = ”
result = ”
errorInfo: ‘
expected integer but got “{6”What would be the most effective way to identify and split those values apart?
Max, is this a client patch, or a client-server patch? What I mean to say is can it be applied without having to bounce the server?
Ah, since it would create a new group, the addresses for all of the subsequent segments would be incremented. That does make sense.
As for the issue I’m having with A02/A03 and my custom segment, it is being translated into a FRL. The FRL is the same for all message types, but it appears that the inbound message is not mapping correctly to the input variant. I used A08 as the foundation, but I made some changes to accommodate for all message types (added an MRG segment to group 0, and a ZAC segment to group 6).
When I run through the testing tool, I do not get any messages about segments not being defined, or being out of order. It just doesn’t seem to find the ZJM segment and therefore doesn’t do anything with it.
Edit: After messing around a bit, I realized that it appears to be using the ADT_A02 variant definition for A02s, even though the xlate specifies that it should use the A08 input format. Within the A02 variant, the ZJM segment is in group 2. I guess I have to copy the modified A08 message structure to every message type? I thought that specifying that ADT_A08 was the input format within the xlate would force it to use it, regardless of what message type came in.
- I am searching through the message for each of these segments and copying their indices. A problem occurs when the segment repeats, as there are two indices in one member of the list, and the following error is thrown:
-
AuthorReplies