web stats
x12 to HL7 channel template?? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2015, 10:56 AM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default x12 to HL7 channel template??

I need to know if MIRTH (or anyone) has an example channel for reading a x12 (837) file and creating an HL7 message.

I see that in the Source Transformer I can set the Inbound Message Template to EDI / X12 and the Outbound Message Template to HL7 v2.x.

Do I need to have a bunch of field mapping in there? I assumed I would create a Javascript transformer with something like where tmp = the outbound HL7 and the msg = the inbound X12:

//Map the fields
tmp['MSH']['MSH.3']['MSH.3.1'] = msg['GS']['GS.02']['GS.02.1'].toString(); //Sending Appl
tmp['MSH']['MSH.4']['MSH.4.1'] = msg['GS']['GS.03']['GS.03.1'].toString(); //Sending Facility
tmp['MSH']['MSH.7']['MSH.7.1'] = msg['GS']['GS.04']['GS.04.1'].toString() + msg['GS']['GS.05']['GS.05.1'].toString(); //Date and time of Message
tmp['MSH']['MSH.10']['MSH.10.1'] = msg['GS']['GS.06']['GS.06.1'].toString(); //Message conrtol ID


Has anyone created a channel to map the fields? I don't want to reinvent the wheel if there is help available...and I was given this today and basically have 2 weeks to get it into production.
Reply With Quote
  #2  
Old 01-05-2015, 05:09 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,362
cory_cole is on a distinguished road
Default

I worked on it a little bit once for somebody else on the forum. Yes, you will need to map the fields if you are going to use tmp make sure that you do...

tmp = msg.copy();

instead of

tmp = msg;

The latte will create a pointer the memory and every change that you make to tmp will be made to msg as well. The former will create a new instance.
Reply With Quote
  #3  
Old 01-05-2015, 06:09 AM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default

Thanks. Looks like I will have to do this all from scratch. Glad to hear I'm not the only one who's had to do this though.

Now I'll need to work on the looping of the claims within the X12.
Reply With Quote
  #4  
Old 01-10-2020, 12:11 PM
stormcel stormcel is offline
OBX.3 Kenobi
 
Join Date: Mar 2010
Location: Phoenix
Posts: 173
stormcel is on a distinguished road
Default

now I have to do it too.
Any hints would be nice. and tia
I am parsing x12 837 and outputting either BAR or DFT.
Specifically, does anyone have some sample code, or preferably a sample channel?

Last edited by stormcel; 01-17-2020 at 02:58 PM.
Reply With Quote
Reply

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 12:39 PM.


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