Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

How to let file reader pick up certain files?

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

  • How to let file reader pick up certain files?

    How to let a file reader channel only pick up ADT A05 files? I put a source filter to Accept only when the header is ADT A05 but it picks up files with other types too and put them into the 'done' folder. Is there a way do it?

    Thanks

    Post edited by: yywind, at: 11/09/2008 08:03

  • #2
    Re:How to let file reader pick up certain files?

    I'm sorry, but You can only filter files by its file nane or extension

    Comment


    • #3
      Re:How to let file reader pick up certain files?

      I think I could just disable the automatically move of files to 'done' or 'error' folders and run a system command to move the files to a particular folder. How to get the source file name being processed?

      Thanks!

      Comment


      • #4
        Re:How to let file reader pick up certain files?

        Yes. You're right. But be aware than this could give some problems (ie: if an error happens during the process of a file, the file will not be moved and the error will be launched each time the file is readed).

        BTW, You can find the file name with "${ORIGINALNAME}". To move it you can use a system call or a Java method.

        Good luck and please, keep us informed with your progress

        Comment


        • #5
          Re:How to let file reader pick up certain files?

          Hi yywind !

          Maybe it could help you ... :
          Code:
          var OriginalMsgFilenameString="/myserver/mypath/"+${ORIGINALNAME};
          var MyDeleteAction=Packages.java.io.File(OriginalMsgFilenameString);
          var DeleteSuccessState=MyDeleteAction["delete"]();
          if(DeleteSuccessState) logger.info("Oh great my file was deleted :-D : ["+OriginalMsgFilenameString+"]");
          else logger.info("Oooops did not delete my file ... sh*t !"«»);
          Good luck !
          Best Regards

          Antaris

          Post edited by: Antaris, at: 11/12/2008 07:29

          Comment


          • #6
            Re:How to let file reader pick up certain files?

            Thanks for the inputs, can I use ${ORIGINALNAME}inside the destination filter?

            Why can't I use source filter to let Mirth ignore certain files? Even though I let source filter to accept only ADT-A05 message but it moves everything else into 'done' folder too. What does source or destination filter do? I am not very clear about them, there are not much information I can find from internet.

            Thanks for your time.

            Post edited by: yywind, at: 11/12/2008 21:57

            Comment


            • #7
              Re:How to let file reader pick up certain files?

              "How I've come to believe things work", in a few short sentences.

              A channel source points to one or more destinations, each with it's own filters and transformers. The destinations (and their filters) don't really have any control over the source. Think of it in this context: if your source was an incoming TCP connection, what you're trying to do right now is filter messages based on their content before the message is even received. (Can someone think of a better way to explain that?)

              In this case, what you may want to do is set up a channel with a file reader source and two destinations. The source would be close to what you currently have - the directory where the incoming HL7 files are being stored. Only change here is instead of moving them to your "done" directory, either move them to a "processed" directory, or delete them entirely. (At this point, each read message is inside Mirth - outside the control of the source, and subject to what the destinations decide to do with them.) Destination filters basically decide if a particular message makes it to the destination. The first destination will be similar to what you have - include a filter that identifies only ADT A05 files, and use a file writer to copy those messages to your "done" directory. The second destination will be the inverse - include a filter that identifies messages that are *not* ADT A05, and copy those messages to a "still_pending" directory.

              You'll end up with four directories:

              "incoming" - messages before Mirth looks at them (messages deleted as they're read)
              "processed" - messages moved here from "incoming" in the channel source (optional)
              "done" - messages that match the A05 filter
              "still_pending" - messages that match the "not A05" filter

              Does that help?

              Mike

              Post edited by: mnowlin, at: 11/13/2008 00:26

              Comment


              • #8
                Re:How to let file reader pick up certain files?

                (grrr - double-POST)

                Post edited by: mnowlin, at: 11/12/2008 23:24

                Comment


                • #9
                  Re:How to let file reader pick up certain files?

                  MNOWLIN,
                  So I can set multiple destination filters to accept msgs based on criteria? But if I set a channel source filter to accept msgs on certain criteria, those msgs not meeting criteria are rejected and never make it to the destinations?

                  hugh
                  little rock, ar

                  Comment


                  • #10
                    Re:How to let file reader pick up certain files?

                    Pretty much...

                    Each destination in a channel can have a filter applied to it. The filter needs to return either true or false. If it returns true, the message continues along to it's destination. If the filter returns false, the message is dropped for that destination.

                    Comment

                    Working...
                    X