code wiki / (root) / nx_fin_audit.nx

nx_fin_audit.nx

buildroot/runtime/nx_fin_audit.nx

5281 B109 linesdepth 3pulls 3 transitivereach 17 importersview sourcekind librarytopic fin
docsdependenciesstructsconstsfunctions

about

nx_fin_audit.nx -- R5 of THE NISHI FINANCIAL ECOSYSTEM: medical-bill OVERBILLING / anomaly audit. Dogfooded on the operator's multi-year cancer medical-overbilling crisis. Built on nx_money (exact no-float cents). DATA-DRIVEN BY CONSTRUCTION (#6/#11/#25): the engine has ZERO hardcoded CPT codes, thresholds, or multipliers -- every rule is a PACK passed in as data (the packs are grounded on the fetched NCCI/MUE/Medicare corpus and, in R6, loaded from a sovereign rule-pack store). Each check is a distinct LENS; a line can flag under more than one (reported per-check, never silently summed into one number that double-counts). Every overcharge is exact integer cents. CHECKS (each returns a flag count, writes flagged line indices to out_idx[], total overcharge to out_oc[0]): aud_duplicates -- same (code, date) billed more than once -> the repeat is the overcharge aud_unbundle -- a comprehensive code billed WITH a component code that NCCI bundles into it -> the component's charge is the overcharge (pack = ordered (comprehensive, component) pairs) aud_mue -- units billed exceed a code's Medically-Unlikely-Edit max -> the excess-units charge aud_fairprice -- billed exceeds (Medicare allowed * multiplier%) -> the amount above the fair ceiling No hardware writes; pure analysis over caller arrays (never mutates input). license_tier: ORIGINAL

dependencies 1 imports · 9 importers

nx_money.nx nx_fin_audit.nx nx_climbout_docs.nx nx_climbout_real.nx nx_climbout_real_gate.nx nx_doc_extract_gate.nx nx_fin_audit_gate.nx nx_fin_dispute_gate.nx nx_fin_rules_gate.nx nx_medbill_cli.nx nx_medbill_recon_gate.nx

imports: nx_money.nx

imported by: nx_climbout_docs.nxnx_climbout_real.nxnx_climbout_real_gate.nxnx_doc_extract_gate.nxnx_fin_audit_gate.nxnx_fin_dispute_gate.nxnx_fin_rules_gate.nxnx_medbill_cli.nxnx_medbill_recon_gate.nx

structs

none

consts

none

functions

19func aud_lookup(keys: *i64, vals: *i64, n: i64, key: i64) -> i64
28func aud_duplicates(codes: *i64, dates: *i64, billed: *i64, n: i64, out_idx: *i64, out_amt: *i64, out_oc: *i64) -> i64
45func aud_unbundle(codes: *i64, n: i64, pairA: *i64, pairB: *i64, np: i64, billed: *i64, out_idx: *i64, out_amt: *i64, out_oc: *i64) -> i64
70func aud_mue(codes: *i64, units: *i64, billed: *i64, n: i64, mcode: *i64, mmax: *i64, nm: i64, out_idx: *i64, out_amt: *i64, out_oc: *i64) -> i64
91func aud_fairprice(codes: *i64, billed: *i64, n: i64, bcode: *i64, ballow: *i64, nb: i64, mult_pct: i64, out_idx: *i64, out_amt: *i64, out_oc: *i64) -> i64