code wiki / (root) / nx_medbill_codes.nx

nx_medbill_codes.nx

buildroot/runtime/nx_medbill_codes.nx

7246 B197 linesdepth 3pulls 3 transitivereach 10 importersview sourcekind librarytopic medbill
docsdependenciesstructsconstsfunctions

about

nx_medbill_codes.nx -- M1 of the MEDICAL BILLING & PATIENT ADVOCACY ladder (see /compare/medbilling): the sovereign CODE-PACK STORE + DECODE library. Billing codes (ICD-10-CM, HCPCS, CPT) map to their OFFICIAL descriptors, stored as DATA in the sovereign seg-store (#6/#11/#25) -- the engine has ZERO hardcoded descriptors. Descriptors are INGESTED from banked NLM ClinicalTables API responses (clinicaltables.nlm.nih.gov, US-gov, fetched sovereignly by the researcher into knowledge/fetched/ mbc_*.raw) so nothing is fabricated: a code the store does not know returns -1, NEVER a made-up description (the liar-kill invariant). CPT descriptors are AMA-licensed and cannot be bulk-fetched; curated entries carry an explicit "curated:" cite so provenance is always visible. Record layout under key "mbcode:<code>": system|descriptor|cite (pipe-delimited, NUL-terminated). Commit segid = sys_now_us() (see reference-segstore-segid-use-now-us). No floats, no hardware writes. license_tier: ORIGINAL

dependencies 2 imports · 9 importers

nx_syscalls.nx nx_seg_store.nx nx_medbill_codes.nx nx_healthhelp_site_gate.nx nx_medbill_advocacy_gate.nx nx_medbill_charity.nx nx_medbill_civic.nx nx_medbill_civic_gate.nx nx_medbill_cli.nx nx_medbill_codes_gate.nx nx_medbill_nsa_gate.nx nx_medbill_recon_gate.nx

imports: nx_syscalls.nxnx_seg_store.nx

imported by: nx_healthhelp_site_gate.nxnx_medbill_advocacy_gate.nxnx_medbill_charity.nxnx_medbill_civic.nxnx_medbill_civic_gate.nxnx_medbill_cli.nxnx_medbill_codes_gate.nxnx_medbill_nsa_gate.nxnx_medbill_recon_gate.nx

structs

none

consts

14const K_MAGIC_2048: i64 = 2048
15const K_MAGIC_65536: i64 = 65536
16const K_MAGIC_1024: i64 = 1024

functions

19func mbc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
22func mbc_app(out: *u8, off: i64, src: *u8) -> i64
30func mbc_find(hay: *u8, n: i64, needle: *u8, from: i64) -> i64
45func mbc_contains(hay: *u8, needle: *u8) -> i64
51func mbc_streq(a: *u8, b: *u8) -> i64
59func mbc_read_all(path: *u8, buf: *u8, cap: i64) -> i64
75func mbc_key(code: *u8, out: *u8) -> i64
called by 2: mbc_putmbc_get calls 1: mbc_app
85func mbc_put(prefix: *u8, code: *u8, system: *u8, desc: *u8, cite: *u8) -> i64
106func mbc_get(prefix: *u8, code: *u8, out: *u8, cap: i64) -> i64
126func mbc_field(rec: *u8, idx: i64, out: *u8, cap: i64) -> i64
149func mbc_ingest_nlm(prefix: *u8, rawpath: *u8, code: *u8, system: *u8) -> i64