Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this questionI 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. :)
开发者_JAVA百科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. Create XML Nodes based on XPath?
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.
I would definitely explore using bots!
http://bots.sourceforge.net/en/index.shtml
精彩评论