web stats
Mirth Connect File Reader support - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 07-09-2013, 06:23 AM
vasanth.v vasanth.v is offline
What's HL7?
 
Join Date: Jul 2013
Posts: 2
vasanth.v is on a distinguished road
Default Mirth Connect File Reader support

Hello,

Below is our scenario, please help

1. We have a database table containing a list of file paths. We created a channel whose source is a Database reader. We need to create another source to read all the files from that database table and move it to another path. It is possible to create multiple sources like one database reader and one file reader. If so how can we achieve it. If not what are the other possibilities to read files whose paths are in the database.

2. Is it possible to create a file reader whose path can be changed dynamically.

3. How do I create a file reader which can read all files recursively from the inside folders.

Thanks in advance
Reply With Quote
  #2  
Old 07-09-2013, 06:52 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,310
cory_cole is on a distinguished road
Default

I think your best bet would be to create JavaScript Reader that will pull from the database and move the files.
Reply With Quote
  #3  
Old 07-11-2013, 12:43 AM
vasanth.v vasanth.v is offline
What's HL7?
 
Join Date: Jul 2013
Posts: 2
vasanth.v is on a distinguished road
Default

Quote:
Originally Posted by cory_cole View Post
I think your best bet would be to create JavaScript Reader that will pull from the database and move the files.
As I am new to Mirth can you please help me on how to achieve it with some code samples?
Reply With Quote
  #4  
Old 07-11-2013, 05:52 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

Quote:
Originally Posted by vasanth.v View Post
1. We have a database table containing a list of file paths. We created a channel whose source is a Database reader. We need to create another source to read all the files from that database table and move it to another path. It is possible to create multiple sources like one database reader and one file reader. If so how can we achieve it. If not what are the other possibilities to read files whose paths are in the database.
Selecting the file paths out of the database is easy enough with a Database Reader. Once you've done that, just iterate through the paths in a transformer, and use FileUtils to do whatever you need to.

Quote:
Originally Posted by vasanth.v View Post
2. Is it possible to create a file reader whose path can be changed dynamically.
It is; you can use Velocity template variables in the File Reader directory field. However that takes effect only when the channel is deployed, not for each polling window. If you need to use a different directory for every poll, you can use a JavaScript Reader instead.

Quote:
Originally Posted by vasanth.v View Post
3. How do I create a file reader which can read all files recursively from the inside folders.
This has been added in 3.0: MIRTH-1441. In 2.x, you would have to use a JavaScript Reader instead.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
file reader, mirth connect, multiple file read

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:10 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation