jeevz
jeevz

Reputation: 15

Move the files to a location only if filter condition satisfies in mirth

I am new to mirth and I want the "After processing Action" in source to perform only if the rule in the source filter satisfies for a channel.

Upvotes: 1

Views: 3252

Answers (2)

Sutirth
Sutirth

Reputation: 952

You can do this by applying a filter in Destination channel.

  1. Select destination connector on which you need to apply filter.
  2. From left side Select Edit filter from channel task.
  3. Add one new rule rule and select JavaScript as type.

Add JavaScript code as below.

For example you want to filter all message other than ADT then add a condition as below.

if(msg['MSH']['MSH.9']['MSH.9.1'].toString() != "ADT")
{
   return false;
}

So this code will send only ADT message to Destination and all other messages are filtered.

Upvotes: 2

HTTP 501
HTTP 501

Reputation: 126

I think you have two options. One, perform a check in the postprocessor script to see if your condition is met. Two, route your messages to a second channel whose function is to move the files, and set a filter on that channel.

Upvotes: 0

Related Questions