Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Question on Regular Expression routing › Reply To: Question on Regular Expression routing
I’m thinking of using a regular expression in a route specification, not for HL7 but for file routing. I’m wondering if this is a bad idea.
I have a source FTP thread that picks up multiple files several times a day. There are seven different destination threads which will receive the files/messages based on the file name. The file names are all fixed length and have a naming standard that designates the type of file, the facility they belong to, if they are for physician billing etc.
Currently we use logic in a pre-translate filter to read DRIVERCTL to get the file name and then parse the components of the file name and KILL or CONTINUE the message based on the requirements for that destination.
it occurs to me that I could use a TRXID tcl to return just the file name, and then use a regular expression in the route specification. Seems a lot simpler, smaller code, and an administrator can just look at the route specification to know what the requirements are for each route, instead of opening up each filter tcl to find out how that destination is being determined.
Does this make sense?
Here is an example of a regular expression (I am not very good with it but this one seems to work):
^835.{6}01.*.08430.*
it is an 835 file (starts with 835), from SSI, and then six characters later I’m looking for ’01’ (billing type?) and then after that, one of the nodes (separated by periods) (the hospital facility id) is equal to ‘08430’.
Peter Heggie