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

Multiple Filters --- what's the preferred way?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple Filters --- what's the preferred way?

    so I'm testing out Mirth and seeing what I can do with it. So far so good, playing with destinations. right now I'm feeding live data in from another interface engine (dgate), and have enough to work with filters, transforms, etc. I'm doing the simple stuff first - filters .

    So, here's what's up: I've filtered on PV1(3.1) (Location), and looking for Meditech specific locations. In our outfit, they are like K.MAMM, H.MAMM, K.RAD, H.RAD, etc. Now, there are quite a few of them... For EACH one I've created a destination. this seems less than perfect, as a Case statement might be handy here - even an if/elseif/fi, something Not to mention that I'm only capping the ones that I have destinations for - and filtering everything else out - I'd like to have a catchall case if that's possible.

    So, is the idea of a case statement passing to multiple destinations allwrong? I'm sure there's a better way, I just haven't seen it yet.

    anyone help?


  • #2
    Re:Multiple Filters --- what's the preferred way?

    Not so sure if I understand correctly. Are you re-routing the data to different destinations based on the Location? then yes, create a location mapping variable in the source transformer, and use it in the filter for each destination.
    Chris Ro
    Sr. Software Engineer | Mirth Corporation


    • #3
      Re:Multiple Filters --- what's the preferred way?

      Uhm, well I'm just trying to learn how Mirth handles/works with hl7 messages. So far it's pretty cool, seems like it'll work as a replacement for DataGate.

      Anyway, I'm getting the raw hl7 feed from the Datagate engine - it's just sending any report that comes from the PACS guys over to Mirth. Right now all I'm doing is writing the reports out to files - grouping them as it were. Any report that's from Location H.MAMM I want to be appended into file H_MAMM.dat, same for K.ED, K.PAC, H.PAC, etc... down the line.

      So.. I don't have a catch all and am finding out about missed locations via the log.. it'd be nice to have a CatchAll.dat file indead for the cases that were missed by the other deliveries.

      Seems like this a situation for a Case statment or if/else setup to me:

      Case where PV1.3.1 equals
      write message to C:\test\K_MAMM.dat
      write message to C:\test\H_MAMM.dat
      write message to C:\test\K_ED.dat
      write message to C:\test\CatchAll.dat

      Granted that's not real javascript, but hopefully it's understandable. Of course the catchall should not operate unless none of the other locations match.

      This is not a real assignment, I'm just testing out Mirth and trying to do some of the same things in Sun's JCAPS setup.

      So, hopefully this makes a bit more sense now


      • #4
        Re:Multiple Filters --- what's the preferred way?

        You don't need the case statement.

        Create a variable that stores PV1-3.1 data in the source transformer.

        Create 4 destinations. Each destination would write out to a file. Create a filter for 3 of those destinations to only accept if PV1-3.1 is K.MAMM, H.MAMM, or K.ED.

        The 4th destination would have no filter, which means it'd 'catch all'.
        Chris Ro
        Sr. Software Engineer | Mirth Corporation


        • #5
          Re:Multiple Filters --- what's the preferred way?

          taking your idea, I created a variable pv131 in the source transformer with a default value of "Catchall"

          then in the destination filename I put the variable ${pv131}.dat

          It's works without all the destinations, etc. Exactly what I was looking for and without many manipulations.

          thought I'd share