Nason commited on
Commit
4cb96fd
·
verified ·
1 Parent(s): db1a788

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +77 -0
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: public-domain-with-cpt
4
+ license_link: LICENSE
5
+ task_categories:
6
+ - tabular-classification
7
+ - tabular-regression
8
+ tags:
9
+ - medicare
10
+ - cms
11
+ - healthcare
12
+ - physician
13
+ - duckdb
14
+ - government-data
15
+ - medical-billing
16
+ pretty_name: CMS Medicare Physician & Other Supplier Database
17
+ size_categories:
18
+ - 100M<n<1B
19
+ ---
20
+
21
+ # CMS Medicare Physician & Other Supplier Database
22
+
23
+ A clean, queryable DuckDB database built from the [CMS Medicare Physician & Other Practitioners Public Use Files](https://data.cms.gov/provider-summary-by-type-of-service/medicare-physician-other-practitioners) -- provider-level Medicare Part B claims data from CY2012 through CY2023.
24
+
25
+ **121,707,609 rows** across **3 tables** covering what every physician billed, what Medicare paid, and how many services and beneficiaries per NPI per HCPCS code.
26
+
27
+ Built with [cms-medicare-database](https://github.com/ian-nason/cms-medicare-database).
28
+
29
+ ## Quick Start
30
+
31
+ ### DuckDB CLI
32
+
33
+ ```sql
34
+ INSTALL httpfs;
35
+ LOAD httpfs;
36
+ ATTACH 'https://huggingface.co/datasets/Nason/cms-medicare-database/resolve/main/cms_medicare.duckdb' AS cms (READ_ONLY);
37
+
38
+ -- Total Medicare spending by year
39
+ SELECT year, ROUND(SUM(line_srvc_cnt * avg_medicare_payment_amt) / 1e9, 2) AS total_spending_billions
40
+ FROM cms.physician_services
41
+ GROUP BY year ORDER BY year;
42
+ ```
43
+
44
+ ### Python
45
+
46
+ ```python
47
+ import duckdb
48
+ con = duckdb.connect()
49
+ con.sql("INSTALL httpfs; LOAD httpfs;")
50
+ con.sql("""
51
+ ATTACH 'https://huggingface.co/datasets/Nason/cms-medicare-database/resolve/main/cms_medicare.duckdb'
52
+ AS cms (READ_ONLY)
53
+ """)
54
+ con.sql("SELECT * FROM cms.physician_services LIMIT 5").show()
55
+ ```
56
+
57
+ DuckDB uses HTTP range requests, so only the pages needed for your query are downloaded.
58
+
59
+ ## Tables
60
+
61
+ | Table | Description | Rows |
62
+ |-------|-------------|------|
63
+ | `physician_services` | Provider-level Medicare Part B claims: one row per NPI per HCPCS code per place | 106,515,734 |
64
+ | `physician_summary` | Provider-level aggregate summary: one row per NPI per year with total services, | 12,232,194 |
65
+ | `geography_service` | Geographic aggregate: Medicare utilization and payment by state/national level, | 2,959,681 |
66
+
67
+ ## Data Source
68
+
69
+ [CMS Medicare Physician & Other Practitioners PUF](https://data.cms.gov/provider-summary-by-type-of-service/medicare-physician-other-practitioners) -- maintained by CMS. Updated annually. Public domain U.S. government data. HCPCS descriptions include AMA CPT content used under CMS license.
70
+
71
+ ## License
72
+
73
+ Database build code: MIT. Underlying data: public domain (U.S. government work). Note: HCPCS descriptions contain AMA CPT content included as provided by CMS in the PUF.
74
+
75
+ ## GitHub
76
+
77
+ Full source code, build instructions, and data dictionary: [github.com/ian-nason/cms-medicare-database](https://github.com/ian-nason/cms-medicare-database)