Map every CLP, CAS, and SVC segment in an X12 835 to a structured payment object and detect partial payment patterns indicating a potential underpayment dispute
For each CLP segment, capture CLP01 claim submitter ID, CLP02 claim status code (values 1 through 22 indicate the adjudication disposition), CLP03 billed amount, CLP04 paid amount, CLP05 patient responsibility amount, and CLP06 claim filing indicator code
Under each CLP, parse CAS segments where CAS01 is the adjustment group code, CAS02 is the CARC code, and CAS03 is the adjustment amount; repeat across all CAS02/CAS03 pairs within the segment for claims with multiple adjustment reasons
Under each CLP, parse SVC segments to obtain service-line detail: SVC01 composite medical procedure identifier carries the procedure code and modifier, SVC02 is the line billed amount, SVC03 is the line paid amount, and SVC06 is the original submitted units
Detect underpayment by comparing the sum of SVC03 paid amounts across all service lines against CLP04 claim paid amount; discrepancies indicate bundling, downcoding, or partial denial of specific lines requiring line-level CARC analysis
Flag records where CARC code 45 (charge exceeds fee schedule or maximum allowed) is present and calculate the allowed amount implied by the contractual adjustment to determine whether the fee schedule applied matches the contracted rate
Group claims by payer claim control number from CLP07 and trace each back to the original 837 claim using submitter claim ID in CLP01 to identify the original charges and produce a variance report for dispute prioritization
Known gotchas
CAS group code OA (other adjustment) is frequently used by payers to mask adjustments that should properly be coded as contractual obligations under CO; using OA inflates patient balance responsibility in the 835 and causes incorrect patient statement generation
Some payers issue a single CLP with a denied status code and zero CLP04 but include SVC segments with non-zero paid amounts for individual lines; the claim appears denied at the header level but is actually partially paid at the line level
CARC codes are maintained by CAQH CORE and updated quarterly; an automated denial routing system that does not refresh CARC definitions will misroute claims when an existing code is retired and replaced with a more specific code
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp