How to filter out duplicate message in mirth #5288
Replies: 2 comments 3 replies
-
Typically by creating a hash of each message and storing it, then comparing new messages to the stored value. That storage may be a database or some map in mirth, it depends on your particular problem. |
Beta Was this translation helpful? Give feedback.
-
Here's minimal code that will filter out duplicates by creating a hash map in your Deployment script and checking it in a source filter. You'd have to preserve the hash map across deployments, or release it upon undeploy, and you'd probably want a way to age out old message control ids. In your deployment script (Edit channel, Scripts tab):
In your source filter (Edit channel, Source tab, Create a filter and set Type to Javascript in dropdown):
This assumes that your intention is to reject a message arriving with an MSH.10.1 (Message Control ID) that the channel has already seen during its current deployment. It checks each incoming message's MSH.10.1 value to see if it is a key value for the hash map, and filters the message if its MSH.10.1 value is found, or adds that value to the hash map if it's not found, and allows the message to continue processing. |
Beta Was this translation helpful? Give feedback.
-
How to filter out duplicate message in mirth
Beta Was this translation helpful? Give feedback.
All reactions