Work / Day job
Two-way EDI for a claims system
A Python integration that builds outbound X12 files from the claims system and loads what vendors send back into it.
The problem
A claims administrator trades files with a lot of outside parties: enrollment (834), claims (837), and remittance (835), plus the acknowledgments and response files that come back for each of them. Without an integration, every one of those exchanges means pulling data out of the claims system, sending it, and getting the responses back in by hand.
What I built
An end-to-end integration in Python that handles both directions. Outbound, it reads from the company claims system and generates the files each vendor expects. Inbound, it picks up the files vendors send back and loads them into the claims system.
Both directions of the trading-partner exchange are now automated.
The part that takes judgment
X12 is strict about format and surprisingly loose in practice. Every trading partner reads the implementation guide a little differently, so a real share of the work is reading acknowledgment and response files, working out why a payer rejected something, and fixing it at the source instead of patching the file.
ISA
Interchange header. The envelope around everything: who is sending, who is receiving, when, the X12 version (00501), and a control number. The 1 asks for an acknowledgment; P means production.
All segments explained
- ISA
- Interchange header. The envelope around everything: who is sending, who is receiving, when, the X12 version (00501), and a control number. The 1 asks for an acknowledgment; P means production.
- GS
- Functional group header. HC says this group holds health care claims. 005010X222A1 names the exact implementation guide: the 837 Professional.
- ST
- Transaction set header. Starts one 837 inside the group, with its own control number that the SE segment has to match.
- BHT
- Beginning of hierarchical transaction. 00 means this is an original submission, and CH marks it as a chargeable claim.
- NM1
- Entity name. 85 is the billing provider, 2 means an organization rather than a person, and XX says the identifier that follows is an NPI.
- CLM
- Claim information. The patient control number, the total charge ($150), and the place of service: 11 is an office visit, and the trailing 1 says this is an original claim, not a correction.
- SV1
- Professional service line. HC:99213 is the procedure code (an established-patient office visit), billed at $150 for 1 unit.
- SE
- Transaction set trailer. 6 is the segment count from ST to SE. If it does not match, the receiver rejects the transaction, which is one of the first things to check in a rejection.
- GE
- Functional group trailer: one transaction set in group 101.
- IEA
- Interchange trailer: one functional group, closing control number 000000101 to match the ISA.
Related: CMS Section 111
I also create and submit the CMS Section 111 mandatory insurer reporting files and reconcile the response files CMS returns.