nx_medbill_recon.nx
buildroot/runtime/nx_medbill_recon.nx
about
nx_medbill_recon.nx -- M2 of the MEDICAL BILLING ladder (/compare/medbilling): parse an ITEMIZED BILL
or EOB text document into structured claim lines, then RECONCILE bill-vs-EOB with exact no-float cents.
A claim line = a text line carrying ALL THREE of: a date, a 5-char procedure code (CPT/HCPCS shape,
>=4 digits), and at least one $-money token -- header/footer prose never qualifies (an account number
alone is not a claim line). Money REQUIRES the $ prefix (a bare year is never money). EOB lines carry
billed/allowed/patient columns (first/second/last money); a bill line's charge = its LAST money.
RECON is a CONSUMING matcher (code+date, each EOB line matches at most once -- so a duplicate bill line
has nothing left to match = NOT-ON-EOB) with flags: 1=NOT_ON_EOB (amount=charge), 2=BILLED_MISMATCH
(|bill - EOB billed|), 3=ABOVE_ALLOWED (charge - allowed). It reports; it never fabricates a line and
never auto-acts (findings feed the fail-safe R8 dispute letter). license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_medbill_cli.nxnx_medbill_recon_gate.nx
structs
| none |
consts
| 12 | const K_MAGIC_1900: i64 = 1900 |
| 13 | const K_MAGIC_10000: i64 = 10000 |
functions
| 16 | func mbr_ctx_new(cap: i64) -> *i64 |
| 30 | func mbr_code_at(ctx: *i64, i: i64) -> *u8 { return ((ctx[1] as i64) + 16 * i) as *u8 } |
| 31 | func mbr_geti(ctx: *i64, slot: i64, i: i64) -> i64 { let p: *i64 = ctx[slot] as *i64; return p[i] } |
| 33 | func mbr_is_digit(c: u8) -> i64 { if (c as i64) >= 48 { if (c as i64) <= 57 { return 1 } } return 0 } |
| 34 | func mbr_is_upper(c: u8) -> i64 { if (c as i64) >= 65 { if (c as i64) <= 90 { return 1 } } return 0 } called by 1: mbr_tok_code |
| 37 | func mbr_tok_money(t: *u8, ts: i64, te: i64) -> i64 |
| 64 | func mbr_tok_date(t: *u8, ts: i64, te: i64) -> i64 |
| 103 | func mbr_tok_units(t: *u8, ts: i64, te: i64) -> i64 |
| 115 | func mbr_tok_code(t: *u8, ts: i64, te: i64) -> i64 |
| 131 | func mbr_parse(text: *u8, n: i64, ctx: *i64) -> i64 called by 3: cli_reviewcli_lettermain calls 5: mbr_tok_moneymbr_tok_datembr_tok_unitsmbr_tok_codembr_code_at |
| 214 | func mbr_code_eq(a: *u8, b: *u8) -> i64 |
| 226 | func mbr_recon(bctx: *i64, ectx: *i64, ftyp: *i64, fidx: *i64, famt: *i64) -> i64 |