web stats
EDI X12 837 File Parse Error Mirth Connect 3.0 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2014, 02:55 AM
kbrao826 kbrao826 is offline
Mirth Newb
 
Join Date: Aug 2010
Posts: 11
kbrao826 is on a distinguished road
Default EDI X12 837 File Parse Error Mirth Connect 3.0

Hi,

I am trying to convert an 837 file to a CSV formatted file. I put my inbound as EDI/x12 and outbound as Delimited text. I haven't written any code in the Transformer yet. Just wanted to test if an 837 is parsed properly. When I send my 837 message for processing I get the following error.

The content of elements must consist of well-formed character data or markup.

I am attaching my 837 file. Could you guys send me a valid 837 if something is wrong with my sample file?

Thanks
brao
Attached Files
File Type: txt Document1.txt (1.4 KB, 190 views)

Last edited by kbrao826; 01-20-2014 at 02:57 AM. Reason: forgot attachment
Reply With Quote
  #2  
Old 01-20-2014, 05:56 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,117
narupley is on a distinguished road
Default

The issue is that you have an error in your channel configuration. If you want to transform an X12 message into delimited text, you actually need to do the transformation in your transformer.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 01-20-2014, 08:49 PM
kbrao826 kbrao826 is offline
Mirth Newb
 
Join Date: Aug 2010
Posts: 11
kbrao826 is on a distinguished road
Default

Hi Narupley,

Thanks for the response. I know that I need to write the transformation code in the transformer. But I was just trying to parse the EDI file and it is giving me an error. In the transformer I just hard coded the temp value just to see if my 837 file is getting validated. But Mirth is erroring out.

I did this through delimited text input and delimited text output. I handled the code in the transformer using Javascript. I was able to convert 837 to CSV. But I am not validating the 837 messaging by using delimited text as input .
Reply With Quote
  #4  
Old 01-21-2014, 06:46 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,117
narupley is on a distinguished road
Default

Quote:
Originally Posted by kbrao826 View Post
Hi Narupley,

Thanks for the response. I know that I need to write the transformation code in the transformer. But I was just trying to parse the EDI file and it is giving me an error. In the transformer I just hard coded the temp value just to see if my 837 file is getting validated. But Mirth is erroring out.

I did this through delimited text input and delimited text output. I handled the code in the transformer using Javascript. I was able to convert 837 to CSV. But I am not validating the 837 messaging by using delimited text as input .
Can you post your channel? I'm confused as to how exactly your channel is set up.

Try this. Create a completely new channel and change all data types to EDI/X12. Then edit the source transformer, and add a blank JavaScript step. Deploy the channel and send a message through. You'll be able to see the serialized XML in the transformed data section.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #5  
Old 08-20-2014, 03:51 PM
ajavvaji ajavvaji is offline
What's HL7?
 
Join Date: Aug 2014
Posts: 1
ajavvaji is on a distinguished road
Default Processing 837 files using Mirth

We are planning/trying to use Mirth Connect to process 837P or 837I files. I know that Mirth only supports X12 and doesn't support processing 837 directly and doesn't have a mapping tool.

The questions I have are
1. Has anyone did process the 837 files using mirth?
2. Has someone done this earlier and can you help us?
3. What is the approach?
4. 837 files can have regular or custom segments and have looping.
5. We are going to receive the 837 files on a ftp location and be able to process and load to a flat table in oracle?

thanks for your help.
Reply With Quote
  #6  
Old 02-11-2015, 11:01 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

I'm surprised that no has been willing to post a sample channel for this. It seems to be in demand right now.

I've been able to (with MIRTH Support) create a source transformer that parses the 837 file into nice XML segments. This code will break the entire file into "chunks" of HLs. ie a chuck for the HL 20, HL 22 and so forth.


// Create XML to makes things easier
var claims = <claims></claims>;
var sub_section = null;
var first_hl = msg['HL'][0].childIndex();

for(i=first_hl; i<msg.children().length(); i++){

var claim_child_name = msg.child(i).name().toString();

if(claim_child_name == "HL")
{
//then you have a new claim
if(i!=first_hl){
claim.appendChild(sub_section);
claims.appendChild(claim);
}
var claim = <claim></claim>;
sub_section = claim;
}

//The rest are sub sections of HL
else if(claim_child_name == "SBR")
{
if(sub_section!=claim){
claim.appendChild(sub_section);
}
sub_section = <SBR></SBR>;
}

else if(claim_child_name == "NM1")
{
if(sub_section!=claim){
claim.appendChild(sub_section);
}
sub_section = <NM1></NM1>;
}
else if(claim_child_name == "LX")
{
if(sub_section!=claim){
claim.appendChild(sub_section);
}
sub_section = <LX></LX>;
}

if(sub_section == null)
{
//Then there's a subsection that's
//not SBR, NM1, or LX
claim.appendChild(msg.child(i));
}
else
{
sub_section.appendChild(msg.child(i));
}
}

claim.appendChild(sub_section);
claims.appendChild(claim);
channelMap.put("claims", claims);

for(h=0; h<claims.children().length(); h++){

//Create a blank HL7 XML
var HL7_message = <HL7Message></HL7Message>;
//Append an MSH segment to the HL7 XML
HL7_message.appendChild(new XML(SerializerFactory.getSerializer('HL7V2').toXML ('MSH|^~\&|company|company|company|company|'+dateS tring+'||ADT^A01||P|2.5|')));

var h20 = <h20/>;
try{h20['h20.1']['h20.1.1'] = claims['claim'][claimsCount]['NM1'][0]['NM1'][1]['NM1.01']['NM1.01.1'].toString();}catch(err){h20['h20.1']['h20.1.1'] = '';}

try{h20['h20.1']['h20.1.1'] = claims['claim'][claimsCount]['HL']['HL.01']['HL.01.1'].toString(); }catch(err){h20['h20.1']['h20.1.1'] = '';}
try{h20['h20.2']['h20.2.1'] = claims['claim'][claimsCount]['HL']['HL.02']['HL.02.1'].toString(); }catch(err){h20['h20.2']['h20.2.1'] = '';}
try{h20['h20.3']['h20.3.1'] = claims['claim'][claimsCount]['HL']['HL.03']['HL.03.1'].toString(); }catch(err){h20['h20.3']['h20.3.1'] = '';}
try{h20['h20.4']['h20.4.1'] = claims['claim'][claimsCount]['HL']['HL.04']['HL.04.1'].toString(); }catch(err){h20['h20.4']['h20.4.1'] = '';}
try{h20['h20.5']['h20.5.1'] = claims['claim'][claimsCount]['NM1'][0]['NM1'][1]['NM1.01']['NM1.01.1'].toString(); }catch(err){h20['h20.5']['h20.5.1'] = '';}
try{h20['h20.6']['h20.6.1'] = claims['claim'][claimsCount]['NM1'][0]['N3']['N3.01']['N3.01.1'].toString(); }catch(err){h20['h20.6']['h20.6.1'] = '';}
try{h20['h20.7']['h20.7.1'] = claims['claim'][claimsCount]['NM1'][0]['N4']['N4.01']['N4.01.1'].toString(); }catch(err){h20['h20.7']['h20.7.1'] = '';}
try{h20['h20.7']['h20.7.2'] = claims['claim'][claimsCount]['NM1'][0]['N4']['N4.02']['N4.02.1'].toString(); }catch(err){h20['h20.7']['h20.7.2'] = '';}
try{h20['h20.7']['h20.7.3'] = claims['claim'][claimsCount]['NM1'][0]['N4']['N4.03']['N4.03.1'].toString(); }catch(err){h20['h20.7']['h20.7.3'] = '';}
try{h20['h20.8']['h20.8.1'] = claims['claim'][claimsCount]['NM1'][0]['REF']['REF.01']['REF.01.1'].toString(); }catch(err){h20['h20.8']['h20.8.1'] = '';}
try{h20['h20.9']['h20.9.1'] = claims['claim'][claimsCount]['NM1'][0]['REF']['REF.02']['REF.02.1'].toString(); }catch(err){h20['h20.9']['h20.9.1'] = '';}
try{h20['h20.10']['h20.10.1'] = claims['claim'][claimsCount]['NM1'][1]['N3']['N3.01']['N3.01.1'].toString(); }catch(err){h20['h20.10']['h20.10.1'] = '';}
try{h20['h20.11']['h20.11.1'] = claims['claim'][claimsCount]['NM1'][1]['N4']['N4.01']['N4.01.1'].toString(); }catch(err){h20['h20.11']['h20.11.1'] = '';}
try{h20['h20.11']['h20.11.2'] = claims['claim'][claimsCount]['NM1'][1]['N4']['N4.02']['N4.02.1'].toString(); }catch(err){h20['h20.11']['h20.11.2'] = '';}
try{h20['h20.11']['h20.11.3'] = claims['claim'][claimsCount]['NM1'][1]['N4']['N4.03']['N4.03.1'].toString(); }catch(err){h20['h20.11']['h20.11.3'] = '';}
HL7_message.appendChild(h20);

router.routeMessage("HL7_file_creation", SerializerFactory.getSerializer('HL7V2').fromXML(H L7_message));

}

}
Reply With Quote
  #7  
Old 02-12-2015, 04:30 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

This will create an XML record for each whole 837 message. For my project I am reading many messages in a file.

var claims = <claims></claims>;
var claim = <claim></claim>;
var first_ISA = msg['ISA'][0].childIndex();

for(i=first_ISA; i<msg.children().length(); i++){

if(i!=first_ISA && msg.child(i).name().toString() == "ISA")
{
//then you have a new claim
claims.appendChild(claim);
claim = <claim></claim>;
}

claim.appendChild(msg.child(i));
}

claims.appendChild(claim);
channelMap.put("claims", claims);
Reply With Quote
  #8  
Old 06-02-2015, 12:04 PM
tpkinc tpkinc is offline
Mirth Newb
 
Join Date: Jun 2015
Posts: 14
tpkinc is on a distinguished road
Default

Hello,

Has anyone here transformed ANSI X12 837i files 4010 version into 5010 version? That is my objective short term. Longer term I would like to take .CSV billing file and create ANSI 837i 5010 claims from it. I have not seen any postings on this topic specifically, but it sounds like Mirth would be a great tool for this. I am not sure Mirth supports X12 5010, but it may be similar enough to 4010 they are interchangeable. Any references or links would be greatly appreciated. First task is to drop the ANSI 4010 837 using X12 data typing and see if I can get a message tree to publish.
Thanks

Last edited by tpkinc; 06-02-2015 at 12:08 PM.
Reply With Quote
  #9  
Old 06-20-2015, 10:56 AM
tpkinc tpkinc is offline
Mirth Newb
 
Join Date: Jun 2015
Posts: 14
tpkinc is on a distinguished road
Default

Quote:
Originally Posted by tpkinc View Post
Hello,

First task is to drop the ANSI 4010 837 using X12 data typing and see if I can get a message tree to publish.
Thanks
Post falling on deaf ears, but here is a update in case some poor soul is in same boat as me. I had little trouble getting off the dime pasting a 4010 837i file in as Import Template leaving Output template blank. I have found Outbound templates to be too literal and more trouble than they are worth. I was able to get a modified 4010 to publish without doing anything fancy. I built a transformer adding extra fields like Country Code, PER email address to select segments, removed phased out segments, etc. Because my files are a predictable with one Pay to Provider Name I was able to subtract the SE segment counter by the number of segments I deleted.

A concern I have will be if I need to insert segments like the new Insurance Plan information. I don't have that info in my 4010 source file or CSV. I am using no Database and am just transforming source to destination. I suppose I could preload insurance plan information into an array from a spreadsheet in global template, and call it as a function to create these new segments. That could get tricky for me being new to javascript.

This has been fun brainstorming with myself . I am surprise more peeps aren't scrambling like me to find solutions for their legacy customers on 4010. Where is everyone?
Reply With Quote
  #10  
Old 07-09-2015, 03:48 AM
charan charan is offline
Mirth Newb
 
Join Date: Apr 2015
Posts: 24
charan is on a distinguished road
Send a message via Yahoo to charan Send a message via Skype™ to charan
Default Ncpdp d.0

I am having same issue with 5010 , can some one please help here .
Reply With Quote
Reply

Tags
837, error, mirth 3.0, x12

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 07:45 PM.


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