Roshan Rajan
← Projects

Chargemaster

Collecting every US hospital's published prices, then using them to cost out a simulated patient population.

US hospitals are required to publish what they actually charge. Since 2021, every hospital has had to post a machine readable file listing its prices, including the rates it has negotiated with each insurer. Those rates used to be contractually confidential. They are now public.

The data is close to unusable. Files run from a few megabytes to 43 GB. The format is nominally standardized and practically is not, so the same field arrives as a column in one file, a nested object in another, and a row label in a third. Links break, hosts refuse connections, and some publishers appear compliant while serving files nothing can parse.

Chargemaster collects them anyway. It is a streaming pipeline that downloads, parses and discards, so a corpus far larger than the disk it runs on can be processed on a laptop. It currently holds 1,728 of 1,749 facilities nationally: 2.24 billion price rows across 32 GB of Parquet. Every figure carries the source file it came from, so any number can be traced back to the hospital's own published document.

The reason to build it is what the prices show. A hospital's listed price, the chargemaster itself, is close to fiction. Almost nobody pays it. Insurers pay negotiated rates that can be a fraction of it, those rates differ between insurers at the same hospital for the same procedure, and uninsured patients are often billed the full amount that no insurer would accept.

The current work is joining that price data to Synthea, an open source patient simulator that generates realistic populations with realistic disease progression and utilization but placeholder costs. Its cost model prices every encounter type at 75 dollars, from a phone call to an inpatient admission. Replacing those placeholders with real negotiated rates turns a simulated population into an estimate of what its care would actually cost, and what the same care would cost under a different insurer or none at all.

That join is the unfinished part. The simulator records care in SNOMED, a clinical vocabulary, and hospitals bill in CPT and HCPCS, which are billing vocabularies. There is no authoritative map between them, partly for licensing reasons and partly because the correct billing code depends on details of the encounter that a clinical record does not capture. A first attempt using UMLS covered under one percent of procedure volume. The next uses the OHDSI vocabulary, whose mappings were built for this purpose.

A caveat that will survive whatever the crosswalk achieves: most of what a simulated population does is routine outpatient care that hospitals do not bill for. Screenings, assessments and wellness visits have no hospital price, and no better mapping will invent one. The hospital facing subset is the part that can honestly be priced.