HL7 Starter Kit – Free Project Tools HL7 Starter Kit

PassDataChannelWriter

Mirth Connect – Pass Data Between Two Channels February 23, 2016


PassDataChannelWriter


PROBLEM

Today I spent waaaaay tooooo long trying to pass data between Mirth Channels.

So, I had two channels: Channel 1 and Channel 2 (Put Orders 7B).

Channel #1 had a user’s identification that Channel #2 absolutely needed! I didn’t want to send it in the template area. I wanted that user id to be sent on its own – for Channel #2 to easily access.

RESEARCH

I did find the following Mirth forum posts related to this task – but that’s it. It just wasn’t 100% clear on how to do this – though it was helpful.

  1. http://www.mirthproject.org/community/forums/showthread.php?t=14595
    1. I want to send a file’s original filename thru it to the next channel in the chain. In Channel Writer Settings I’ve been trying to add variable originalFilename in the Message Metadata section, but I can’t get it to stick.
  2. http://www.mirthproject.org/community/forums/showthread.php?t=11813&highlight=channel+writer+metadata
    1. If you want to pass metadata from channel to channel, that’s what the source map is for. In 3.1 you can easily add source map variables in the Channel Writer. However in 3.0.3 or earlier, you can do the same thing, just with “router.route” in JavaScript instead. As always, look at the User API for more info.

So, number 2 above had an image – which finally led me to the answer! Yaaaaaayyyyy…..!!!!

SOLUTION

Ok, here’s how I did it – finally :-) It was actually easy…lol!

My source channel:

  • Destination Connector: Set to channel writer:
  • Channel ID: Set this to the channel that you will be sending data to (Put Orders 7B).
  • Message Metadata: Added my channel’s variable as new entry (outUserID). This variable was set in my destination’s source transformer. This also works with a variable set in the channel’s source transformer.

PassDataChannelWriter

I sent a message through my source channel, then checked my destination channel’s source mappings.

PassDataDestinationThat’s it!

So, just have to configure your source channel settings. Once you send a message through, the destination channel will receive that data in the Mappings tab > Source scope!

Now, I can use this user ID in my destination channel!

Hope this helps!

 


For more cool tips like this, visit HL7 Starter Kit School. FREE Real-World Integration Tasks in class format :-)

Free HL7 Classes

close
PassDataChannelWriter

Mirth Connect – Pass Data Between Two Channels

Leave a Reply

ViSO Tech

ViSO Tech

Thank you for visiting! Click Facebook icon above and let's connect.
PassDataChannelWriter

Mirth Connect – Pass Data Between Two Channels February 23, 2016

Search