TransactionValidationException

May 9, 2013 at 9:24 PM
First off, thanks for the outstanding work on this project! This has been a lifesaver on a critical time-sensitive project.

I'm currently having issues with some 837i files from one provider. I get a "Segment 'OIYY' in segment position 5672 within transaction 'XXXX' cannot be identified within the supplied specification for transaction set 837 in any of the expected loops: 2000A[195],2000B[196],2300,2310A.

I have run the 837 files through validation tools, and they appear to be valid, but I get the above exception trying to parse any of them. I haven't had any luck with the throwExceptionOnSyntaxErrors option. Maybe I don't understand how to use it correctly, but even when I pass False to the constructor, it still throws the exception. I'm not sure what section of the source file to post here. How do I attach a de-identified file attachment?
Coordinator
May 9, 2013 at 9:39 PM
According to the generic X12 standard for 837 and the 837I implementation guide for 5010, the OI segment (Other Insurance Coverage Information) should appear within loop 2320 (Other Subscriber Information) which is indicated by an SBR segment. The last loop that the parser was able to identify was 2310A which is the attending physician name. The 2320 loop would be a sibling of the 2310A loop, but must have the SBR segment to indicate it's start.

If the sender of the x12 does not think they have an error, than you would have to inject your own specification that would allow the OI segment in the position it is occurring, but since that would be non-standard, it is better to get the sender to correct this.
May 9, 2013 at 9:45 PM
Thanks for the quick response! Your are fantastic.

These are the lines that immediately precede the OI segments:

SBRP18*MA~
AMTD999.99~
OI
Y
Y~

Wouldn't that indicate that it does have the 2320 loop?
Coordinator
May 9, 2013 at 9:56 PM
Your delimiters are getting scrambled. Can you insert using the "Insert Code" (Ctrl+K), so that the site doesn't treat them as wiki markup?
Also, is this happening in a 5010 or 4010 file? Does this correspond to the 5672 position in that file from the error message?
May 9, 2013 at 9:59 PM
Sorry about that. This is 5010. I'm not sure how to find position 5672 exactly. Is there documentation out here that you could point me to?
SBR*P*18*******MA~
AMT*D*999.99~
OI***Y***Y~
Coordinator
May 9, 2013 at 10:03 PM
Position 5672 is just the segment position.
If you have a text editor that will allow you to take the ~ segment delimiter and put a carriage return after each, then it should show up in the 5672nd line of the file. I double checked the spec that's embedded in the code and didn't see any problems. It might be possible that some of the OI segments are correct and some of them aren't.
May 9, 2013 at 10:09 PM
Ah, OK. I already had it with carriage returns, but it looks like it counts beginning with the ST segment and not with the ISA. Here is the OI segment at 5672 and the lines preceding it back to the nearest SBR loop.
SBR*P*18*******CH~
NM1*IL*1*XXXX*XXXX****MI*999999999~
N3*9999 9XX XXX XX~
N4*XXXXX*ND*99999~
DMG*D8*19670302*M~
NM1*PR*2*XXXXXXX XXX*****PI*9999999~
N3*XX XXX 99999*XXXX XXXXXX XXXXXX~
N4*XXXXXXX*WI*99999-9999~
CLM*99999999*12003.30***99:X:9**A*Y*Y~
DTP*434*RD8*20120801-20120831~
CL1*3*2*01~
REF*G1*99~
REF*EA*999999~
REF*D9*9999999-9~
HI*XX:X999~
HI*XX:X999~
HI*XX:9999*XX:99999*XX:9999*XX:99999*XX:99999*XX:9999*XX:99999*XX:9999*XX:99999*XX:99999*XX:99999*XX:X9999~
HI*BF:V1209~
HI*XX:99*XX:XX~
NM1*71*1*XXXXXXXXX*XXXXXX***MD*XX*9999999999~
OI***Y***Y~
Coordinator
May 9, 2013 at 10:22 PM
I see the problem.
The SBR that you are showing me as at the top of LOOP 2000B, which indicates the Subscriber Heriarchical Loop.
The OI segment that you are showing me needs to be after an SBR that is a child of the Loop 2300 Claim Loop. (Basically it needs to occur after the CLM segment but before the OI segment.

The first SBR is indicating the Primary subscriber, whereas the 2nd SBR after the CLM segment typically indicates a secondary subscriber.

It seems like the file sometimes has this correct, but in this case it does not.
May 9, 2013 at 10:26 PM
Thank you so much for identifying the issue. At least now I can take it up with them and understand the issue.