Announcement

Collapse
No announcement yet.

How to filter and process different message types?

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

  • 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

  • #2
    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.
    Chris Lang

    Comment


    • #3
      Re: How to filter and process different message types?

      thanks.

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

      Comment

      Working...
      X