Announcement

Collapse
No announcement yet.

Mirth Connect File Reader support

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    I think your best bet would be to create JavaScript Reader that will pull from the database and move the files.

    Comment


    • #3
      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?

      Comment


      • #4
        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.

        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.

        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.

        Comment

        Working...
        X