Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   How to filter and process different message types? (http://www.mirthcorp.com/community/forums/showthread.php?t=430)

tintinn 09-24-2006 06:38 AM

How to filter and process different message types?
 
How do I go about configuring an inbound channel (LLP listener) to process different type of messages ?

Suppose my channel at LLP port 8080 listens to various type of ADT messages. I'd like to process each type of messages differently depending on the event code. How do I go about doing it ?

As a novice, my plan is that i would create a filter that recognize the ADT event type, and use Destination to resend the message to various Mirth channels (eg A01, A04, A13 etc) i created in order to handle the different message types. Doing it this way ensures that I can create customized transformers, database destinations for the different message types.

Is there a better way of doing this ?

-badrul

chrisl 09-24-2006 11:27 AM

Re: How to filter and process different message types?
 
Yes, there is a better way.

All you need is a single channel with all of your destinations, set in Router mode.

You can define a filter on each destination that checks the message type:

Code:

var messageType = msg['MSH']['MSH.9']['MSG.1'].text() + msg['MSH']['MSH.9']['MSG.2'].text();
if (messageType == "ADTA04"){
    return true;
}else{
    return false;
}

The destination will only be processed if the message Type matches (this is for HL7 v.2.3 or greater - the mapping is a bit different for 2.2 and 2.1). You can define a seperate transformer and database destination for each "destination" in Mirth. It will only be run if the filter returns true.

tintinn 09-24-2006 09:51 PM

Re: How to filter and process different message types?
 
thanks.

i wasn't aware that each destinations have separate filters and transformers. *doh*


All times are GMT -8. The time now is 12:32 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation