I am attempting to setup a source connector, database reader. I have run a simple test that selects rows from the DB based on a status value and sends the raw (XML) data to the destination filewriter to write a file. This work perfectly, the SQL that did the selection was simply done in the Database reader config screen in the SQL window. What I REALLY want to do is Select rows from the DB, join various tables based on certain columns and then format the results into HL7 messages. Upon completion update the status to "Complete".
Should this be done in the Transformer using JavaScript ? (I am not a javascript developer but have coded in VB, Ansi C, and plenty of SQL). I'm sure I can hack away using javascript but not being familiar with Mirth I wanted to know where the most suitable place to do this would be.

Thanks