web stats
Message builder for different kind of messages (SIU, ADT, etc...) - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2017, 06:45 AM
Bougie Bougie is offline
What's HL7?
 
Join Date: Jan 2017
Posts: 5
Bougie is on a distinguished road
Default Message builder for different kind of messages (SIU, ADT, etc...)

Hi,

Here is my case :
I'm receiving SIU and ADT messages from an application on my Mirth. I need to process those messages before sending them to my application. I thought about using transformers (message builder) but here is the problem, I can only transform one kind of message. So if I set my transformations to handle SIU and I receive an ADT it's a fail.

Is there a way to have different transformers depending on the type of messages received?
Should I create different destination channels and use a filter on them to sort messages then transform them?

Thanks for your advice
Reply With Quote
  #2  
Old 01-05-2017, 09:03 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

Don't use Message builder.

Use a Javascript step.
Reply With Quote
  #3  
Old 01-05-2017, 11:22 PM
Bougie Bougie is offline
What's HL7?
 
Join Date: Jan 2017
Posts: 5
Bougie is on a distinguished road
Default

Surely that would be a solution but I hoped message builders could do the job.
What are they for then? They can only be used when one type of message go through the channel?
Reply With Quote
  #4  
Old 01-06-2017, 01:15 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

Well, Message builder is for doing mappings.
What you can do with a Javascript, is done with relative ease in case of message builder, because it is just drag and drop.

So if I want to do this

tmp['MSH']['MSH.3']['MSH.3.1']=msg['MSH']['MSH.4']['MSH.4.1'].toString();

I can just drag and drop 2 fields in the message builder and it would work.

However, If I have 100s of mapping to be done, Message builder is not the best way to go. Instead, do it in a JS transformer step to have more control.

In your case, you should have 2 destinations with filter on both of them, one for ADT and one for SIU and do your mapping and transformation inside JS step.
Reply With Quote
  #5  
Old 01-06-2017, 03:33 AM
Bougie Bougie is offline
What's HL7?
 
Join Date: Jan 2017
Posts: 5
Bougie is on a distinguished road
Default

My mapping is quite simple, that's why I want to use message builder to do it (20 to 30 steps maximum) but definitely JS would be a good solution for a big amount of changes.

Thanks for your answers.
Reply With Quote
Reply

Tags
message builders, transformer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:29 AM.


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