web stats
Mirth Community - View Single Post - Catch an event when a file reader source begins to read a file
View Single Post
  #4  
Old 05-04-2009, 01:26 AM
carles carles is offline
OBX.2 Kenobi
 
Join Date: Mar 2007
Location: Girona
Posts: 62
carles is an unknown quantity at this point
Thumbs up

Finally, I've done it.

As I promised, I've attached with this post these two channels if they could be useful for someone.

Summary:
The target is feed the hospital kitchen software with current hospital census. Census are provided by HIS with a delimited file which is updated periodically.
Before insert file rows in the census kitchen database table I have to delete all previous table records.

Channel Descriptions:
- "CensCuinaFitxer":
This channel retrieves the entire content of the file in a single message (by setting "Process batch files as 'no'"). It has 3 destinations:
-- "GuardarFitxerDeCens": This destination only saves the file in other place for backup purposes.
-- "EsborraLaTaulaDeCens": This destination deletes all the content of census table before I fill it again.
-- "PartirElFitxerEnMissatges": A JavaScript transformer step on this destination splits the incoming file in messages and send them to "CensCuinaLinea" channel.

var i=0;
while (msg['row'][i] != null) {
router.routeMessage('CensCuinaLinea',msg['row'][i].toString());
i=i+1;
}

"CensCuinalLinea":
This channel process every row sent by "CensCuinaFitxer" individualy.

thanks chrisr for your useful suggestions.

carles.
Attached Files
File Type: xml CensCuinaFitxer.xml (12.3 KB, 29 views)
File Type: xml CensCuinaLinea.xml (16.1 KB, 21 views)

Last edited by carles; 05-04-2009 at 01:34 AM. Reason: minor corrections
Reply With Quote