This is a bit of an abandoned project of mine. When I first started working on an internal system here at the office to process HL7 feeds I was using MySQL as a database and a couple of small Ruby scripts to handle the inputs and outputs. At one point I needed to see what I was storing, so I whipped up the original incarnation of this quickly to accomodate that need. I've since moved on to using MongoDB as the database and have an all in one HL7 router back and forth that is available in the repo MongoDB.
For the heck of it I've updated some of this code this morning in case anyone might fight it useful in the future.