tags:

views:

83

answers:

2

I was asked how you would parser a x12 837 (medical claims). It was the first time I have see a file format like it. A little time on Google and I learned that the file contains 3 types of delimiters at 103,104,105 and that the first element in the file is fixed length.

Next I learned the elements I parsed out, are ordered in a XML like way, but with no closing tags. This site http://pyx12.sourceforge.net/doc/maps/ has a explanation of the order of the elements. I also found a PDF file that go into 750 pages of details about the format of the file.

At this point I realize that it's not a simple task to put this information into a database. I eventually get the idea to covert the x12 file into XML, and use xpath as a query tool to get the information out of the file. That works great I can get all the claims, line items, and the people attached to the claim.

My company wrote it's own medical claims system. Now, I'm trying to understand how to make a 835 Claim Payment response to a 837, with our system in the middle.

I'm a noob here so be kind. :)

Update

My code can now parse/validate x12 files based on a grammar from a few XML files. Take an existing x12 file covert it into XML then back to x12. I also wrote a few classes to make an x12 in XML form. It uses xPath to find elements, and if not found create the missing elements. I got the idea from here. http://stackoverflow.com/questions/508390/create-xml-nodes-based-on-xpath

A: 

I would definitely explore using bots!

http://bots.sourceforge.net/en/index.shtml

mellerbeck
I had to learn python to read the source code. I got the idea of using a grammar file to parser and validate the x12 files, from bots.
Slow Slosh
Looking at the bots discussion group at http://groups.google.com/group/botsmail/topics I got lots of information about working with x12 files in general. I also was pointed at the web site http://www.altova.com/mapforce.html they sell a program for mapping different file types to each other, one of them being x12. Their software also contains a directory of (I think) all x12 message types and versions of those messages in XML files. Which was very helpful in understanding the structure of the 835, 837.
Slow Slosh
A: 

Perhaps the biggest challenge you will have with the 835 is balancing. The total payment must balance with the remittance details for that payment. The amounts also have to balance at three different levels: the transaction level, the claim level and the service level. For example, at the claim level, the Total Claim Charge Amount (CLP03) minus the sum of all the Adjustment Amounts (CAS segments) must equal the Claim Payment Amount (CLP04). Balancing at the different levels is explained in detail in the 835 X12 standards.

For the most part, X12 is loop driven, so, at a minimum, you might want to start with creating tables that match up with each loop. Think about what keys you'll want to use, perhaps based on your internal claim numbers and sequence numbers. It will be important for traceability and, simply, to keep things straight.

Joe Suarez
Thanks for the advice Joe, I'll keep that in mind. The PDF file I'm looking at is called.WPC COMBINED IMPLEMENTATION GUIDE 835 May 2000 - Oct 2002I'm trying to understand the difference between IMPLEMENTATION / STANDARD, and how they relate to HIPAA. The implementation seems to be an example of how to make a X12 file, and the standard is describing everything that could be in the X12 file. So how do you know what HIPAA wants?
Slow Slosh
The implementation is a subset of the standard. There is a general X12 standard and and implementation of that standard defined by the HIPAA community. In order to be compliant, follow the implementation. See the beginning of Section 3.1 of your Implementation Guide for details.
Joe Suarez