Hospital encounters, diagnoses and claims

Patients, providers, encounters, ICD-10 diagnoses, prescriptions, labs and insurance claims that reconcile from billed to paid.

A hospital network's 1,500 patients: providers, encounters (outpatient, emergency, inpatient), ICD-10 diagnoses, prescriptions, lab results and the insurance claims that follow, from billed through allowed to paid, with denials and their reasons.

  • healthcare
  • ICD-10
  • claims
  • revenue cycle
  • payers
01,5003,000Sep 2024Jan 2025May 2025Sep 2025Jan 2026May 2026Sep 2026
Rows per month in lab_results.collected_at, counted from the file.

Explore

Every table, profiled

Each column's type, spread, empties and most common values, measured from the CSVs in the download. Switch to the first rows to see the data exactly as it sits in the file.

lab_results.csv

14,946 rows · 10 columns · 2 foreign keys

lab_idprimary key
unique on every row
14,946 distinctno empties
encounter_idforeign key
points to encounters.encounter_id
4,016 distinctno empties
patient_idforeign key
points to patients.patient_id
1,134 distinctno empties
collected_atdate
Sep 2024Sep 2026
2024-09-10 to 2026-09-13no empties
analytecategory
  • Glucose
    11%
  • Hemoglobin
    11%
  • Platelet count
    11%
  • Creatinine
    11%
  • White blood cell count
    11%
  • 6 more values · 45%
11 valuesno empties
unitcategory
  • mg/dL
    27%
  • 10^3/uL
    22%
  • mmol/L
    21%
  • g/dL
    11%
  • U/L
    7.6%
  • 2 more values · 12%
7 valuesno empties
valuenumber
0.4log scale343
mean 64.08median 14.20.05 to 438.4no empties
ref_lownumber
0150
mean 41.59median 70 to 150no empties
ref_highnumber
1.3log scale400
mean 83.97median 17.51.3 to 400no empties
flagcategory
  • normal
    83%
  • high
    13%
  • low
    4.3%
3 valuesno empties

Keys

Every join resolves

11 foreign keys, 82,311 references checked against the table each one points at. None points at a row that does not exist.

claims

  • encounter_idencounters.encounter_id0 orphans
  • patient_idpatients.patient_id0 orphans

diagnoses

  • encounter_idencounters.encounter_id0 orphans
  • patient_idpatients.patient_id0 orphans

encounters

  • patient_idpatients.patient_id0 orphans
  • provider_idproviders.provider_id0 orphans

lab_results

  • encounter_idencounters.encounter_id0 orphans
  • patient_idpatients.patient_id0 orphans

prescriptions

  • diagnosis_iddiagnoses.diagnosis_id0 orphans
  • encounter_idencounters.encounter_id0 orphans
  • patient_idpatients.patient_id0 orphans

Checks

What we checked

  • 11 foreign-key relationships checked, 0 orphaned rows
  • No row is dated before the row it belongs to
  • 9.0% of 4,737 claims are denied, and every denied claim carries a reason
  • Money walks down correctly: paid is at most allowed and allowed at most billed in 100% of 4,737 claims
  • 100% of encounters are discharged after they are admitted; median stay is emergency 4 h, inpatient 4.1 days, outpatient 1 h
  • 41 distinct ICD-10 codes across 8,427 diagnoses
  • The busiest 20% of providers see 54% of encounters
  • Labs follow the visit: Hemoglobin A1c is 11.9% of outpatient lab results and 0.8% of emergency ones

The same checks ship in the zip as INTEGRITY.txt, so you can rerun them in any SQL engine. How we verify

Questions, answered

Worth asking it

Each answer is the query's result on these exact files. Open one for its SQL and rows, then check your own query against it.

  1. 1Which payers deny the most claims, and for what reasons?other denies the most (10.3%), most often coding_error.
    with reasons as (
      select payer, denial_reason, count(*) as denials,
             row_number() over (partition by payer order by count(*) desc, denial_reason) as rank_in_payer
      from claims
      where status = 'denied'
      group by payer, denial_reason
    ),
    payers as (
      select payer, count(*) as claims,
             sum(case when status = 'denied' then 1 else 0 end) as denied
      from claims
      group by payer
    )
    select p.payer, p.claims, p.denied,
           round(100.0 * p.denied / p.claims, 1) as denial_rate_pct,
           r.denial_reason as top_reason, r.denials as top_reason_denials
    from payers p
    left join reasons r on r.payer = p.payer and r.rank_in_payer = 1
    order by denial_rate_pct desc
    payerclaimsdenieddenial_rate_pcttop_reasontop_reason_denials
    other2632710.3coding_error7
    commercial2,1361989.3not_medically_necessary55
    medicare1,1111039.3not_medically_necessary32
    self_pay275238.4not_medically_necessary10
    medicaid952757.9missing_authorization24
  2. 2What is the average length of stay by diagnosis category?Longest average stay: gynecologic (1.17 days); shortest: urologic (0.46 days).
    -- An encounter with diagnoses in several categories counts once in each.
    select d.category,
           count(distinct e.encounter_id) as encounters,
           round(avg(e.los_hours) / 24, 2) as avg_stay_days,
           round(percentile_cont(0.5) within group (order by e.los_hours), 1) as median_stay_hours
    from (select distinct encounter_id, category from diagnoses) d
    join encounters e on e.encounter_id = d.encounter_id
    group by d.category
    order by avg_stay_days desc
    categoryencountersavg_stay_daysmedian_stay_hours
    gynecologic411.171.1
    injury3621.071.2
    respiratory1,3141.051.3
    mental_health8181.041.3
    infectious5911.031.3
    cardiovascular9761.021.3
    neurological2650.991.3
    gastrointestinal6800.911.4
    metabolic1,5970.881.3
    musculoskeletal8430.851.3
    pregnancy520.791.2
    urologic480.461.1
  3. 3How much of billed revenue is finally paid?Payers paid $7,938,924 of $18,033,950 billed, 44.0%.
    select status,
           count(*) as claims,
           round(sum(billed_amount), 2) as billed,
           round(sum(coalesce(allowed_amount, 0)), 2) as allowed,
           round(sum(coalesce(paid_amount, 0)), 2) as paid_by_payer,
           round(sum(coalesce(patient_responsibility, 0)), 2) as patient_responsibility,
           round(100 * sum(coalesce(paid_amount, 0)) / sum(billed_amount), 1) as paid_pct_of_billed
    from claims
    group by status
    order by billed desc
    statusclaimsbilledallowedpaid_by_payerpatient_responsibilitypaid_pct_of_billed
    paid4,12215,718,050.637,938,924.17,938,924.17,779,126.5350.5
    denied4261,495,593.8778,187.9000
    pending189820,305.41455,793.62000
  4. 4Which lab flags cluster around which diagnoses?The strongest cluster: LDL cholesterol is abnormal in 70.2% of musculoskeletal encounters against 63.7% overall.
    -- Abnormal share of each analyte within encounters coded with each category; pairs with at least 50 results.
    with labs as (
      select d.category, l.analyte, l.flag
      from lab_results l
      join (select distinct encounter_id, category from diagnoses) d on d.encounter_id = l.encounter_id
    ),
    base as (
      select analyte, 100.0 * sum(case when flag <> 'normal' then 1 else 0 end) / count(*) as abnormal_pct
      from lab_results
      group by analyte
    )
    select x.category, x.analyte, count(*) as results,
           round(100.0 * sum(case when x.flag <> 'normal' then 1 else 0 end) / count(*), 1) as abnormal_pct,
           round(b.abnormal_pct, 1) as abnormal_pct_all_encounters
    from labs x
    join base b on b.analyte = x.analyte
    group by x.category, x.analyte, b.abnormal_pct
    having count(*) >= 50
    order by 100.0 * sum(case when x.flag <> 'normal' then 1 else 0 end) / count(*) - b.abnormal_pct desc
    limit 10
    categoryanalyteresultsabnormal_pctabnormal_pct_all_encounters
    musculoskeletalLDL cholesterol13170.263.7
    mental_healthHemoglobin A1c17460.955.8
    injuryWhite blood cell count12810.26.3
    cardiovascularLDL cholesterol15067.363.7
    infectiousGlucose21762.759.3
    infectiousSodium2056.83.6
    mental_healthPlatelet count2806.83.7
    infectiousCreatinine219107.2
    mental_healthLDL cholesterol13166.463.7
    gastrointestinalLDL cholesterol10466.363.7

Every query runs on the files in the download as they are. ANSWERS.sql holds all of them; run it in DuckDB from the dataset's folder.

Full version · $15

This sample, or the full Healthcare Claims and Denials

A year of revenue cycle with the reason behind every denial. Try its free preview before you decide.

This sampleHealthcare Claims and Denials
Rows39,946356,609
Tables78
Columns73134
FormatsCSVCSV
AuditKeys and the checks listed above99 checks, all listed
LicenceCC0, freeCommercial use, $15 once
Built forhealthcare, ICD-10, claims, revenue cycleDenial prediction, Denial management and root cause dashboards, Accounts receivable and cash forecasting, Patient responsibility, Payer contract analysis, Teaching and demos

Use it

Take it, or make one shaped like yours

Rebuild it byte for byte

The zip includes RECIPE.json: the Studio pack, the overrides and seed 20260921 that made these exact rows.

Your own tables, your own numbers

Describe the data you need in Studio and get connected tables with the totals you state, profiled like this and checked before you download.

The full version, and what goes with it

All premium
  • First-pass denial rate, by month of service

    10 payers, 8 facilities, calendar 2025

    A year of revenue cycle with the reason behind every denial

    Answer key

    • cause_coverage_inactive
    • denial_cause
    • preventable
    • +6 more
    Rows
    356,609
    Tables
    8
    Checks
    99 of 99
    Free preview18-question projectProfile and preview
  • How much of each month was paid by the cut

    12,000 members, four products, calendar 2025

    A payer's year with its incurred truth

    Answer key

    • unpaid_at_cut
    • not_received_at_cut
    • cause_no_prior_auth
    • +4 more
    Rows
    284,051
    Tables
    7
    Checks
    107 of 107
    Free preview18-question projectProfile and preview
  • Card spending each month, debit and credit

    2,500 US households at five banks and seven card issuers, two years

    Five banks' raw statement lines, with every label behind them

    Answer key

    • description
    • merchant_name
    • category
    • +6 more
    Rows
    7,627,186
    Tables
    14
    Checks
    50 of 50
    Free previewProfile and preview

Related free datasets

All 12

Fully synthetic. No real person, company or transaction is represented, and no production data was read to make it. CC0: use it anywhere, no attribution needed.