Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   EDI X12 837 File Parse Error Mirth Connect 3.0 (http://www.mirthcorp.com/community/forums/showthread.php?t=9906)

kbrao826 01-20-2014 02:55 AM

EDI X12 837 File Parse Error Mirth Connect 3.0
 
1 Attachment(s)
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

narupley 01-20-2014 05:56 AM

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.

kbrao826 01-20-2014 08:49 PM

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 :(.

narupley 01-21-2014 06:46 AM

Quote:

Originally Posted by kbrao826 (Post 36948)
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.

ajavvaji 08-20-2014 03:51 PM

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.

appsbyaaron 02-11-2015 11:01 AM

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));

}

}

appsbyaaron 02-12-2015 04:30 AM

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);

tpkinc 06-02-2015 12:04 PM

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

tpkinc 06-20-2015 10:56 AM

Quote:

Originally Posted by tpkinc (Post 48592)
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 :D. I am surprise more peeps aren't scrambling like me to find solutions for their legacy customers on 4010. Where is everyone?

charan 07-09-2015 03:48 AM

Ncpdp d.0
 
I am having same issue with 5010 , can some one please help here . :(


All times are GMT -8. The time now is 11:39 PM.

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