Closed mcpierce closed 4 years ago
It looks like you are constructing the reader and getting the list of loops correctly so it's not clear to me why the list size is 0. We have an X12ReaderTest class that has several examples of reading files and how to get the data. The X12ReaderTest.validate837Valid() method shows how it is getting data from the x12_valid.txt sample file that can be found in the test/resources/837_5010 directory. Hopefully these examples will help.
Here is the text that I'm trying to parse. It's a piece of sample data from my client:
ISA*00* *00* * * * * *190108*1501*^*00501*000000002*1*P*:~GS*HC***20190108*1501*190108003*X*005010X222A1~ST*837*0001*005010X222A1~BHT*0019*00*20190108030421*20190108*0304*CH~NM1*41*2*ATHENS DIAGNOSTIC CENTER*****46*~PER*IC*ADC*TE*7063163662~NM1*40*2*BCBS HMO*****46*~HL*1**20*1~NM1*85*2*ATHENS DIAGNOSTIC CENTER*****XX*1679523708~N3*1063 BAXTER STREET~N4*ATHENS*GA*306069998~REF*EI*582588390~NM1*87*2~N3*PO BOX 933237~N4*ATLANTA*GA*31193~HL*2*1*22*0~SBR*P*18*GA8039H1CS******BL~NM1*IL*1*SIMPSON*BART****MI*STHA111114884~N3*367 CHRISTIAN CHURCH RD~N4*COMER*GA*30629~DMG*D8*19751229*F~NM1*PR*2*BCBS HMO*****PI*601~N3*PO BOX 9907~N4*COLUMBUS*GA*31908~CLM*OSL97*600***11:B:1*Y*A*Y*Y*P~REF*D9*OSL78~HI*ABK:E042~NM1*DN*1*CLINEY*DUKE****XX*1992861900~NM1*82*1*DEWITTE*JON*J***XX*1760461313~PRV*PE*PXC*2085R0202X~LX*1~SV1*HC:76536*600*UN*1***1~DTP*472*RD8*20190102-20190102~REF*6R*OSL27~SE*33*0001~ST*837*0002*005010X222A1~BHT*0019*00*20190108030421*20190108*0304*CH~NM1*41*2*ATHENS DIAGNOSTIC CENTER*****46*~PER*IC*ADC*TE*7063163662~NM1*40*2*BCBS PPO*****46*~HL*1**20*1~NM1*85*2*ATHENS DIAGNOSTIC CENTER*****XX*1679523708~N3*1063 BAXTER STREET~N4*ATHENS*GA*306069998~REF*EI*582588390~NM1*87*2~N3*PO BOX 933237~N4*ATLANTA*GA*31193~HL*2*1*22*0~SBR*P*18*GA6140M301******BL~NM1*IL*1*HOLTNER*JACK*J***MI*XKL116A16015~N3*120 CABIN RD~N4*ATHENS*GA*30605~DMG*D8*19670206*F~NM1*PR*2*BCBS PPO*****PI*601~N3*PO BOX 9907~N4*COLUMBUS*GA*31908~CLM*OSL132*600***11:B:1*Y*A*Y*Y*P~REF*D9*OSL79~HI*ABK:E042~NM1*DN*1*FIRTHNER*MATT*R***XX*1710098496~NM1*82*1*DEWITTE*JON*J***XX*1760461313~PRV*PE*PXC*2085R0202X~LX*1~SV1*HC:76536*600*UN*1***1~DTP*472*RD8*20190102-20190102~REF*6R*OSL33~SE*33*0002~ST*837*0003*005010X222A1~BHT*0019*00*20190108030421*20190108*0304*CH~NM1*41*2*ATHENS DIAGNOSTIC CENTER*****46*~PER*IC*ADC*TE*7063163662~NM1*40*2*BCBS PATHWAY EXCHANGE*****46*~HL*1**20*1~NM1*85*2*ATHENS DIAGNOSTIC CENTER*****XX*1679523708~N3*1063 BAXTER STREET~N4*ATHENS*GA*306069998~REF*EI*582588390~NM1*87*2~N3*PO BOX 933237~N4*ATLANTA*GA*31193~HL*2*1*22*0~SBR*P*18**BCBS PATHWAY EXCHANGE*****BL~NM1*IL*1*HENSER*MOND*S***MI*JRQ111M94175~N3*71 FAIR RD~N4*LEXINGTON*GA*30648~DMG*D8*19980603*F~NM1*PR*2*BCBS PATHWAY EXCHANGE*****PI*00601~N3*PO BOX 9907~N4*COLUMBUS*GA*31908~CLM*OSL104*700***11:B:1*Y*A*Y*Y*P~REF*D9*OSL76~HI*ABK:N911~NM1*DN*1*GUL*AFAQ****XX*1548422280~NM1*82*1*CHERRY*PATRICK*W***XX*1528046877~PRV*PE*PXC*2085R0202X~LX*1~SV1*HC:76830*700*UN*1***1~DTP*472*RD8*20190102-20190102~REF*6R*OSL31~SE*33*0003~ST*837*0004*005010X222A1~BHT*0019*00*20190108030421*20190108*0304*CH~NM1*41*2*ATHENS DIAGNOSTIC CENTER*****46*~PER*IC*ADC*TE*7063163662~NM1*40*2*UHC UNITED HEALTHCARE MEDICARE D*****46*~HL*1**20*1~NM1*85*2*ATHENS DIAGNOSTIC CENTER*****XX*1679523708~N3*1063 BAXTER STREET~N4*ATHENS*GA*306069998~REF*EI*582588390~NM1*87*2~N3*PO BOX 933237~N4*ATLANTA*GA*31193~HL*2*1*22*0~SBR*P*18*99979******CI~NM1*IL*1*DAVIS*LARRY****MI*911104978~N3*558 ROSCOE ROAD~N4*MONROE*GA*30656~DMG*D8*19560629*M~NM1*PR*2*UHC UNITED HEALTHCARE MEDICARE D*****PI*87726A~N3*PO BOX 30883~N4*SALT LAKE CITY*UT*84130~CLM*OSL103*800***11:B:1*Y*A*Y*Y*P~REF*D9*OSL77~HI*ABK:N433~NM1*DN*1*SCHWENE*CATNISS*B***XX*1122628127~NM1*82*1*CHERRY*PATRICK*W***XX*1528046877~PRV*PE*PXC*2085R0202X~LX*1~SV1*HC:76870*800*UN*1***1~DTP*472*RD8*20190102-20190102~REF*6R*OSL30~SE*33*0004~GE*4*190108003~IEA*1*000000002~
Please make sure to not post any real names or addresses. If your sample has not been deidentified, please remove it.
@ctmay4 Of course. This is scrubbed sample data.
Thanks. Just wanted to make sure.
Calling reader.getFatalErrors() reveals that there is a problem with the structure of the file. The messaging is vague and could be improved, however, it looks like ISA07 is missing a code. If a segment is missing one of the required codes then it's not able to be validated and the parsing fails. The list of required codes for ISA07 (an all other elements) can be found in resources/mapping/837.5010.X222.A1.xml
Once I changed that first segment I was able to read the file. An example of the updated line is below. Note that I added in 01 in the 7th element.
ISA*00* *00* * * *01* *190108*1501*^*00501*000000002*1*P*:~
Okay, thank you. So it was definitely a case of the testing data was malform?
Yes, once I made that change I was able to extract values from the file similar to the unit tests.
Very good. Closing this issue as not a bug.
New to using x12-parser, this could be a case of user error (no documentation for the project, so I'm winging it).
I have a simple parser app:
and the following unit test:
But when I attempt to load my test document, I get the following output:
I don't understand why it says there are 0 loops, which I assume means there is no data (again, no documentation to go by). Am I doing something wrong? I see the file's been loaded, but I don't see any way of getting to the data.