Depends on who you talk with. Some prefer to KILL with tcl and some prefer to SUPPRESS with an Xlate. I personally would just make a tcl KILL script to KILL so it can be killed before any manipulation.
I suspect you also want to know how to do that in Tcl.
What I would do is to convert the current date and the PV1 date to internal date in Tcl (epoch time) then check to see if the PV1 date is greater than the current date. Use the Tcl clock command for the conversion.
As Kevin indicated, this can be done in Tcl pre Xlate or with Tcl inside the Xlate. If you feel comfortable with writing UPoC Tcl code then it is more efficient to do it pre Xlate. However, if you are more comfortable with xltp type Tcl (Xlate based) then do it there.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
In my examples at these URLs I show how I KILL messages that are older than 6 hours by using a trxID proc.
There is also an example by another poster of a very straight forward proc if that is your preference.
Here we try to only use argument driven reusable procs that go in the master site, which might seem excessive to look at them but in the long run we feel it pays off.
So I created a proc and tested it in TCLsh85 and it works perfect. But when I add it my Xlate and run it through testing tool I get the attached error. Am I using Clock wrong? I am on v5.8.5 of Cloverleaf.
Danny, when you pass an HL7 date to tcl clock, you must split the date and time up. Ex. “20130901 0901”. I use string range to do this.
Code:
set dateTime [lindex $xlateInVals 0]
set dateTime “[string range $dateTime 0 7] [string range $dateTime 8 11]”
set dateTime [clock scan $dateTime] ;# seconds since epoch, used for date logic
That’s what I ended up doing. I guess I should have replied back to this in case someone else had my same issue and came across this thread. I am attaching my XLTP if anyone else has a need for this. Thank you everyone for your help!
Author
Replies
Viewing 10 reply threads
The forum ‘Cloverleaf’ is closed to new topics and replies.