Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Messages not routing with proc in place
- This topic has 8 replies, 4 voices, and was last updated 15 years, 2 months ago by
Tom Rioux.
-
CreatorTopic
-
October 8, 2008 at 3:59 pm #50358
Scott Smith
ParticipantI am using 5.6 on AIX. -
CreatorTopic
-
AuthorReplies
-
-
October 9, 2008 at 11:36 am #65743
Bob Richardson
ParticipantGreetings, I do not see any return of your dispList list of message handles.
There is a commented out line – part of your debug?
Anyway, a good coding practice is to set the dispList variable to null
at the top of your proc and return its contents just before the last line
in your proc. If you don’t return this list of message dispositions you get leaky handles and of course the engine doesn’t know what to do with these messages.
In running the tester always check the “leak detection” box – a good habit to get into for testing tcl, xlates, whatever. By running your code you should see leaking handles warning messages idisplayed by the tester.
-
October 9, 2008 at 2:20 pm #65744
Scott Smith
ParticipantThanks Bob. I fixed that error, now I getting
[0:TEST] ‘CONTINUE’ (returned by ‘tpsfilterdoccw_tbl ‘) does not match {
} [0:TEST] ‘message0’ (returned by ‘tpsfilterdoccw_tbl ‘) does not match {
} I don’t think I have seen this one before, do you know what it means?
-
October 9, 2008 at 2:28 pm #65745
Bob Richardson
ParticipantScott, You need to change the “set” command to “lappend” for your
variable dispList. The engine expects a list of “disposition message handle”.
This will fix the problem.
Enjoy.
BobR
-
October 9, 2008 at 2:44 pm #65746
Scott Smith
ParticipantBob, It must be one of those weeks. I changed both “sets” to lappend and now I get the “bogus msgStrId…: error.
Could it have something to with that I am killing the message by default and if it is found in table to continue the msg?
-
October 9, 2008 at 3:13 pm #65747
Bob Richardson
ParticipantScott, If you are killing the message by default, you need to unset the dispList
variable and reset it to your continue dispostion. Yes, if you killed the message first then you cannot continue it.
Logic like so:
set dispList {} ;#create and initialize to the empy set
run { lappend dispList “KILL $mh” ;#default disposition
(after some logic you decide to continue this message)
unset dispList
lappend dispList “CONTINUE $mh”
[before exiting proc]
return $dispList
Check the flow of control in your procedure – desk check – run a message through the logic manually and see what happens to it.
I hope this proves useful for you.
BobR
-
October 9, 2008 at 3:42 pm #65748
Michael Hertel
ParticipantScott, can I make two suggestions? 1) Forget about using dispList
2) As you step thru the proc and you know you want to kill the message, return a kill there, otherwise let the message fall thru the rest of the logic and end with a continue.
Code:proc tpsfilterdoccw_tbl { args } {
keylget args MODE mode ;# What mode are we in
switch -exact — $mode {
start {
return “” ;# Perform special init functions
}run {
keylget args MSGID mhset msg [msgget $mh]
set fieldSeparator [crange $msg 3 3]
set OBRsegment [getHL7Segment $msg OBR]
set drNumber [lindex [split [getHL7Field $OBRsegment 16 $fieldSeparator] ^] 0]
set drNumber [crange $drNumber 0 3]if {[cequal [tbllookup tblphysicians_cw $drNumber] KILL]} {
return “{KILL $mh}”
}shutdown {
# Doing some clean-up work
}default {
error “Unknown mode ‘$mode’ in tpsfilterdoccw_tbl”
return “” ;# Dont know what to do
}
}return “{CONTINUE $mh}”
}
-
October 9, 2008 at 3:46 pm #65749
Scott Smith
ParticipantMike, I like those. I was trying to use a already proc and modify it. That looks much better.
And Bob thanks for the debugging help – I finally got it going.
-
October 9, 2008 at 6:06 pm #65750
Tom Rioux
ParticipantOne thing I would suggest with Michael’s code is to get rid of the “getHL7Segment” commands. As Charlies always preaches, stay away from looping, which is what I believe this command does. Replace it with an “lsearch” command. You should be able to find many good examples on here of how to use this command. Thanks…
Tom Rioux
Baylor Health Care
-
-
AuthorReplies
- The forum ‘Cloverleaf’ is closed to new topics and replies.