Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Use of Inbound and Outbound templates in transformer (http://www.mirthcorp.com/community/forums/showthread.php?t=2524)

dheeraj 05-05-2009 02:57 AM

Use of Inbound and Outbound templates in transformer
 
Hi folks,

I am a newbie to mirth and sincerely stucked with significance of inbound and outbound message templates in a channel. Also can anyone tell me the steps of provide an example for transforming an XML from one format to another. Any help will be highly appreciated.

Thanks and Regards,
Dheeraj Bansal

geraldb 05-06-2009 09:28 AM

Hi Dheeraj,

Mirth Connect helps you create message mappings and transforms "by example". The inbound template represents the incoming message. When you paste in a sample message, and drag the segments over from the tree to create mapping steps, you're essentially telling Mirth Connect that you are expecting to receive a message that looks like the inbound template (that is, has the same segments). Since the inbound template is just an "example", none of the data from the template is used, just the mappings that were created. You would use an inbound template when you want to extract segments or modify an incoming message.

The outbound template is used to specify the outgoing message format. By providing an outbound template, you are telling Mirth Connect that you want your outgoing message to look different from your incoming message. In this case, the content of the outbound template is exactly what is going to be sent, so you'll want to make sure that you clear out any data that you wouldn't want to be sent with every message. Once you've pasted in an outbound template, you can use the Message Builder step type to modify the message however you want. The most common way to do this is to paste in both an inbound and an oubound template, and then drag-and-drop from a segment in the inbound to a segment in the outbound. This will create a new step that takes the data from the incoming message and inserts it into the outgoing message.

In your case, since you're using XML, just paste your original structure into the inbound template and the desired structure into the outbound template. Then, drag-and-drop the desired segments from the inbound to the outbound. When the channel is deployed and receiving XML messages, it will create a new outbound message (based on the template), replace all of the segments with the incoming data (based on your mapping), and send it out to your destinations.

Hope this helps.

geraldb 05-06-2009 09:32 AM

Also, you can find an example of using the Message Builder step on the community wiki.

dheeraj 05-06-2009 10:46 PM

This is called as solution to a problem. Thanks it helped a lot and cleared the air.
Once again thanks.:)

Divs 07-27-2015 01:26 AM

Hi,

I suppose the above solution is for a fixed structure result message and not for the dynamic result.

I want to send a result with multiple segment of OBR and NTE and their numbers (OBR and NTE segments number) must be based on the number what I am receiving in my order message.

Can It be done using javascript without doing any manual mapping??

Please reply with some solution.

BDafoe 04-11-2019 07:19 AM

Quote:

Originally Posted by Divs (Post 50096)
Hi,

I suppose the above solution is for a fixed structure result message and not for the dynamic result.

I want to send a result with multiple segment of OBR and NTE and their numbers (OBR and NTE segments number) must be based on the number what I am receiving in my order message.

Can It be done using javascript without doing any manual mapping??

Please reply with some solution.



Does anyone have a solution for this, similar problem to what I am having right now....

BDafoe 04-11-2019 07:23 AM

Anyone have a solution for the previous post about a dynamic solution. I'm having the same issue...

cory_cole 04-11-2019 01:34 PM

NTE|this is a note
NTE|this is another note

If you drag drop, you will have something like this...

msg[NTE][NTE.1] ...

if you have multiple

foreach (ntecount in msg[NTE]) {
msg[NTE][ntecount][NTE.1]
}

syntax may be off a little. I have done this in awhile and I don't have complete access yet.

agermano 04-15-2019 08:01 AM

Recommended to start a new thread with information about your specific problem.


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

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