This project has moved and is read-only. For the latest updates, please go here.


May 9, 2013 at 10: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?
May 9, 2013 at 10: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 10:45 PM
Thanks for the quick response! Your are fantastic.

These are the lines that immediately precede the OI segments:


Wouldn't that indicate that it does have the 2320 loop?
May 9, 2013 at 10: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 10: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?
May 9, 2013 at 11: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 11: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.
N3*9999 9XX XXX XX~
NM1*PR*2*XXXXXXX XXX*****PI*9999999~
May 9, 2013 at 11: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 11:26 PM
Thank you so much for identifying the issue. At least now I can take it up with them and understand the issue.