Nirmitee.io
Delivery journal · The context behind the implementationDiscuss a similar challenge ↗

Clearinghouse Claims Integration: Hardening a Live X12 Pipeline for a US Behavioral-Health EHR

September 25, 2026
7 min read
Written by
Jitendra Choudhary
Jitendra Choudhary

CTO & Co-Founder

CTO & Co-Founder at Nirmitee.io. Architects healthcare integrations across FHIR, SMART on FHIR, ABDM and NHCX, writing from production experience taking hospital software from sandbox to go-live.


Summary

A US behavioral-health software company runs its own EHR and revenue cycle platform. Its claims go to a major US clearinghouse as X12 files over SFTP, and acknowledgements, eligibility responses and remittances come back the same way. The clearinghouse claims integration was already live when Nirmitee joined; a previous engineering team had built it. What the company had was a list of 38 problems its billing staff saw every day: claims shown as rejected after they had been fixed, remittance balances that did not add up, claims that failed to generate without saying why, and counts that differed from screen to screen.

Nirmitee worked inside the live pipeline and hardened it. The team read the company's real clearinghouse traffic, traced each problem to its cause in the code, and fixed it in small, tested pull requests that the company's own developer reviewed and merged. Between late August and 22 September 2026, code for 32 of the 38 items was merged into the live release branch, 5 items were shown by automated tests to be working already, and 1 was contained while its root cause stays open.

At a glance

  • Client: a US behavioral-health EHR and revenue cycle management company (name withheld)
  • Connection: SFTP batch exchange with a major US clearinghouse; no real-time API in the contract
  • Transactions in the live traffic: 837P professional claims out; 999 functional acknowledgements, 277CA claim acknowledgements, 271 eligibility responses (to 270 requests) and 835 remittances in; plus the clearinghouse's portal-edit reports
  • Stack: .NET 8 backend, Angular front end, SQL Server
  • Nirmitee's role: diagnosis and fixes inside an existing, live integration. Nirmitee did not build the original clearinghouse connection.
  • Period: defect list received 19 to 25 August 2026; first fix merged 1 September; all item fixes merged by 22 September

Who this is for

This case study is written for three kinds of reader. The first is a CTO or head of engineering at an EHR, practice-management or RCM software company whose claims already flow through a clearinghouse but whose billing team no longer trusts what the screens say. The second is a founder of a specialty EHR, behavioral health in particular, who inherited an X12 integration from an earlier team or vendor. The third is a revenue-cycle leader at a practice group whose staff fix claims by hand in the clearinghouse portal every day.

What was at stake

When a claims pipeline drifts out of step with the clearinghouse, the damage is quiet. A claim that was corrected and paid still shows as rejected, so staff chase it twice. A remittance balance that ignores the contractual write-off makes the patient appear to owe money they do not owe. A claim that fails to generate without a reason sits unbilled until someone notices. Each of these costs staff time, and some of them delay or put at risk money the practice has already earned.

The company's list had 38 items in seven groups: claims data integrity, claim generation, counts and status logic, the insurance expiry workflow, provider earnings, billing menu layout and interface. The claims and remittance items were the most urgent.

Explore our healthcare interoperability solutions for clearinghouse and payer data exchange.

What Nirmitee did

  1. Found the live code first. The main branch was months out of date. All recent work sat on a separate release branch, and some reported problems were already fixed there. Every fix was based on the branch that was actually deployed.
  2. Reproduced every defect before touching the code. Each problem was recreated in an isolated test environment first, so every fix could be proven against the actual failure rather than a guess.
  3. Worked from what the clearinghouse actually returns. With the company's approval, the team reviewed patterns across the acknowledgements and remittances coming back from the clearinghouse: file types, status codes and rejection reasons, never individual patient details. This showed how payers and the clearinghouse really behave, not only what the specification says they might do.
  4. Traced every item to a root cause and recorded it with the file and line before changing anything.
  5. Fixed in small pull requests with automated tests. The company's own developer reviewed and merged each one and runs the deployments. By 21 September this came to 72 pull requests and 558 new automated tests, across the listed items and extra work found along the way.

This follows the approach in our EDI 835, 837 and 277 developer guide, applied to a system already in production.

See our healthcare product engineering approach to hardening platforms that are already live.

What was found and what changed

What billing staff sawRoot causeWhat changed
Claims fixed at the clearinghouse still showed as rejectedA later, weaker acknowledgement could not replace a rejection correctly, and a replaced claim still counted as currentStatus now moves by rank, not by arrival time; replaced claims leave the current views; history is kept
Remittance "remaining balance" was wrongThe balance was charge minus paid and ignored the contractual (CO) write-offBalance and A/R now net contractual adjustments
Adjustments on remittances were mislabelledThe 835 parser read a quantity where the CAS group code belongs, from the second adjustment onwardOne CAS routine for claim and line level, tested against every real remittance file on hand
Payment dates in the futureThese were real scheduled EFT deposit dates, not bad dataFuture-dated remittances are held and shown for review; the date-parsing root cause is still open
Signed sessions failed to produce claims, silentlyFailures were swallowed; demographic and insurance checks ran too lateChecks run before the claim is built, and every failure names its reason
"Retry all" retried errors that could never passPermanent data errors were treated like temporary onesPermanent errors are skipped with the reason shown
$0 claims reached Ready to BillAn ungated status changeBlocked, with the missing charge named

What the client got

  • A closed defect list. Code for 32 of the 38 items merged into the live release branch by 22 September 2026. Five items (patient payments in provider earnings) were already correct, and automated tests now prove it. One item, future-dated remittances, is contained but not fully fixed.
  • Evidence about where claims really fail. Every one of the 1,728 functional acknowledgements (999) in the first review was accepted, and all 609 received after 11 September were accepted too. The claim files were syntactically clean, so every failure was about content. Diagnosis coding was the largest single content problem: it was the field billers corrected most often in the clearinghouse portal, and 46 claim acknowledgements after 11 September rejected a diagnosis code.
  • Proof of a hidden feedback loop. The clearinghouse's portal-edit reports recorded 1,174 field changes on 383 claims, made by billers correcting claims by hand. The platform archived these reports without reading them. That is why its copy of a corrected claim stayed wrong.
  • A remittance posting path the finance team can check. Remittance adjustments carry the right group codes, and charge minus paid equals the sum of adjustments on every claim and service line in the files tested.
  • A claim-rule library, written and back-tested against real history. Replayed against one month of one practice's data, its rules target the root cause of 69 of 80 real denials and 907 of 1,174 real biller corrections. This is root-cause coverage, not a live catch rate.

What is still open

Three pieces of work were found but not yet built, and the company knows about each one. First, the platform never sends a 276 claim status inquiry, so it learns status only from what arrives unprompted. Second, the portal-edit reports still need to be read back into the platform. Third, the scrubber needs rules for diagnosis specificity and diagnosis pointers. Our guide to 277 claim status automation explains the status side in more detail.

For your engineering team

  • 277 and 277CA share ST01 = 277. They differ by BHT06: TH is the clearinghouse acknowledgement, DG is a payer status response. This platform routed on ST01 alone. In this account all 7,135 transactions in 3,649 files were TH, so no harm had been done yet. A second clearinghouse or a new payer feed would expose the bug.
  • Status arrives only if you ask. 999, 277CA and 835 arrive unsolicited. Payer claim status does not, so plan a 276 polling loop from the start.
  • CAS repeats as reason, amount and quantity triplets, but the group code appears once. A naive loop reads the quantity as the next group code.
  • Remaining balance is billed minus paid minus contractual. The patient's share is CLP05 and the PR adjustments, not charge minus paid.
  • A future BPR16 date is usually a scheduled deposit. Label it; do not treat it as an error.
  • Route inbound files by content (ISA, then ST01, then BHT06), not by file name.

When this applies to you

  • Your billers fix claims in the clearinghouse portal, and your system never learns about it.
  • Remittances post, but balances, write-offs or A/R do not reconcile.
  • Claims show a status your staff know is out of date.
  • You inherited an X12 integration and the people who built it have gone.
  • Your clearinghouse contract is SFTP batch only, and you need status and remittance data to arrive dependably anyway.

For how integrations like this fail in general, see seven claims integration traps and the US payer integration guide for eligibility and claims. For turning remittances into posted payments, see payment posting automation. For the wider revenue cycle build, see RCM software development.

Request a free written EDI pipeline review

Nirmitee offers a written review of one live X12 pipeline. The review covers how files are routed, how acknowledgements and remittances are handled, where claim status comes from, and how corrections made in the clearinghouse flow back to your system. You receive a list of findings, each with a cause and a suggested fix, whether or not you engage Nirmitee afterwards. Request an EDI pipeline review through our X12 EDI integration services page.

Prefer to talk first? Talk to our team.

Share this case study

Related Case Studies