code wiki / (root) / nx_medbill_recon.nx

nx_medbill_recon.nx

buildroot/runtime/nx_medbill_recon.nx

10395 B275 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic medbill
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_medbill_recon.nx nx_medbill_cli.nx nx_medbill_recon_gate.nx

imports: nx_syscalls.nx

imported by: nx_medbill_cli.nxnx_medbill_recon_gate.nx

structs

none

consts

12const K_MAGIC_1900: i64 = 1900
13const K_MAGIC_10000: i64 = 10000

functions

16func mbr_ctx_new(cap: i64) -> *i64
called by 3: cli_reviewcli_lettermain calls 1: sys_mmap
30func mbr_code_at(ctx: *i64, i: i64) -> *u8 { return ((ctx[1] as i64) + 16 * i) as *u8 }
31func mbr_geti(ctx: *i64, slot: i64, i: i64) -> i64 { let p: *i64 = ctx[slot] as *i64; return p[i] }
33func mbr_is_digit(c: u8) -> i64 { if (c as i64) >= 48 { if (c as i64) <= 57 { return 1 } } return 0 }
34func 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
37func mbr_tok_money(t: *u8, ts: i64, te: i64) -> i64
called by 2: mbr_parsemain calls 1: mbr_is_digit
64func mbr_tok_date(t: *u8, ts: i64, te: i64) -> i64
called by 2: mbr_parsemain calls 1: mbr_is_digit
103func mbr_tok_units(t: *u8, ts: i64, te: i64) -> i64
called by 2: mbr_parsemain calls 1: mbr_is_digit
115func mbr_tok_code(t: *u8, ts: i64, te: i64) -> i64
131func mbr_parse(text: *u8, n: i64, ctx: *i64) -> i64
214func mbr_code_eq(a: *u8, b: *u8) -> i64
called by 2: mbr_reconmain
226func mbr_recon(bctx: *i64, ectx: *i64, ftyp: *i64, fidx: *i64, famt: *i64) -> i64