Search code examples
javastringparsingedix12

How to parse EDI 837 file in java?


Is there any java code for parsing this EDI 837 file format.Anyone here can tell me how to parse this file .

i have tried this but it is for EDI 835 :

https://media.readthedocs.org/pdf/x12-parser/latest/x12-parser.pdf

**strong text**   ISA*03*          *00*          *ZZ*P4888          *01*330897513      *160709*0256*^*00501*141000000*1*P*:~GS*HC*P4888*330897513*20160709*0256*141*X*005010X222A1~ST*837*0001*005010X222A1~BHT*0019*00*0001*20160709*0256*CH~NM1*41*2*ererwr*****46*P4888~PER*IC*deditrt Companies*TE*3053968271*FX*3053968271~NM1*40*2*330897513*****46*330897513~HL*1**20*1~PRV*BI*PXC*282NC0060X~NM1*85*2*ABC*****XX*1205886280~N3*5429 College Drive~N4*Graceville*FL*324401858~REF*EI*596139709~HL*2*1*22*0~SBR*P*18*******ZZ~NM1*IL*1*swain*sitansu*sekhar***MI*1234~N3*123~N4*banglor*DC*75424~DMG*D8*20160703*M~NM1*PR*2*ghfhg*****PI*9999~N3*PO BOX 741107~N4*HOUSTON*TX*77274~CLM*147*2427.50***81:B:1*Y*A*Y*Y~HI*ABK:F0390~NM1*DN*1*Ligotti*Michael****XX*Ligotti~NM1*82*1*JohNMike*John****XX*12121212~NM1*77*2*SR4*****N3~N4~LX*1~SV1*HC:80053*126.25*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*155~LX*2~SV1*HC:80061*160.00*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*156~LX*3~SV1*HC:81003*30.00*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*157~LX*4~SV1*HC:84436*82.50*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*158~LX*5~SV1*HC:84443*201.25*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*159~LX*6~SV1*HC:84479*77.50*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*160~LX*7~SV1*HC:84480*170.00*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*161~LX*8~SV1*HC:85025*92.50*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*162~LX*9~SV1*HC:87086*96.25*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*163~LX*10~SV1*HC:80048*101.25*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*164~LX*11~SV1*HC:80061*160.00*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*165~LX*12~SV1*HC:82306*355.00*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*166~LX*13~SV1*HC:82607*181.25*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*167~LX*14~SV1*HC:82746*176.25*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*168~LX*15~SV1*HC:84443*201.25*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*169~LX*16~SV1*HC:84450*61.25*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*170~LX*17~SV1*HC:84460*62.50*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*171~LX*18~SV1*HC:85025*92.50*UN*1*81**1~DTP*472*RD8*20160704-20160704~REF*6R*172~HL*3**20*1~PRV*BI*PXC*282NC0060X~NM1*85*2*cvcv-dfdf*****XX*1205886280~N3*5429 College Drive~N4*Graceville*FL*324401858~REF*EI*596139709~HL*4*3*22*0~SBR*P*18*******ZZ~NM1*IL*1*swain*sitansu*sekhar***MI*1234~N3*123~N4*banglor*DC*75424~DMG*D8*20160703*M~NM1*PR*2*heuyuyu*****PI*9999~N3*PO BOX 741107~N4*HOUSTON*TX*77274~CLM*141*120.00***81:B:1*Y*A*Y*Y~REF*F8*123~HI*ABK:F0390*ABF:F1020~NM1*DN*1*Ligotti*Michael****XX*Ligotti~NM1*82*1*JohNMike*John****XX*12121212~NM1*77*2*SR41*****N3~N4~LX*1~SV1*HC:12001*120.00*UN*1*81**1:2~DTP*472*RD8*20160703-20160703~REF*6R*144~HL*5**20*1~PRV*BI*PXC*282NC0060X~NM1*85*2*vbvfgfgg*****XX*1205886280~N3*5429 College Drive~N4*fhfh*FL*324401858~REF*EI*596139709~HL*6*5*22*0~SBR*P*18*******ZZ~NM1*IL*1*test*test*test***MI*3333~N3*test~N4*test*AS*11111~DMG*D8*20160630*M~NM1*PR*2*fdf PPO MEDICAL*****PI*9999~N3*PO BOX 742567~N4*dfdf*TX*77274~CLM*140*20.00***81:B:1*Y*A*Y*Y~HI*ABK:F1120~NM1*DN*1*asasas*asasas*asasas***XX*asasas~NM1*82*1*erer*John****XX*12121212~NM1*77*2*SR4*****N3~N4~LX*1~SV1*HC:99202*20.00*UN*1*81**1~DTP*472*RD8*20160630-20160630~REF*6R*141~SE*150*0001~GE*1*141~IEA*1*141000000~

Thanks

Sitansu


Solution

  • Try this repo. Be mindful that this is still work in progress. 837 is a message on the milestone. https://github.com/xiaoerge/X12Healthcare