Public dataset · Health and life sciences
CMS Medicare Provider and Payment Data in BigQuery
Medicare provider utilization and payment data for 2011 to 2015: inpatient and outpatient charges by hospital, Part D prescribing by doctor and drug, physician services, nursing facilities, home health, hospice and hospital information. 23 tables, 12.9 GiB, most of it Part D and physician data.
CMS publishes what Medicare pays providers. This dataset has one table per file type and year: inpatient_charges_2011 to _2015 (per hospital and MS-DRG: discharges, average covered charges, average total and Medicare payments), outpatient_charges_2011 to _2015, physicians_and_other_supplier_2012 to _2015 (per provider NPI and HCPCS service code), part_d_prescriber_2014 (per prescriber and drug: claims, day supply, drug cost), plus nursing_facilities, home_health_agencies, referring_durable_medical_equip, hospice_providers_2014 and hospital_general_info.
The column descriptions follow CMS's public use file documentation. drg_definition, for example, is the MS-DRG code and description, and average_total_payments includes co-payments and deductibles while average_medicare_payments is Medicare's share only. The dataset itself has no description, and the newest data year is 2015.
Tables and sizes
The dataset has 23 tables; the main ones are listed.
| Table | Rows | Size | Full scan | Layout |
|---|---|---|---|---|
part_d_prescriber_2014 | 24,120,618 | 3.5 GiB | $0.02 | None |
physicians_and_other_supplier_2012 | 9,153,272 | 2.3 GiB | $0.01 | None |
physicians_and_other_supplier_2015 | 9,497,891 | 2.2 GiB | $0.01 | None |
referring_durable_medical_equip_2014 | 366,242 | 110 MiB | under $0.01 | None |
inpatient_charges_2015 | 201,876 | 34.3 MiB | under $0.01 | None |
inpatient_charges_2011 | 163,065 | 27.3 MiB | under $0.01 | None |
outpatient_charges_2015 | 32,532 | 5.1 MiB | under $0.01 | None |
nursing_facilities_2014 | 15,026 | 4.7 MiB | under $0.01 | None |
home_health_agencies_2014 | 10,882 | 4.0 MiB | under $0.01 | None |
hospital_general_info | 5,336 | 1.4 MiB | under $0.01 | None |
hospice_providers_2014 | 3,928 | 1.4 MiB | under $0.01 | None |
Example queries
Most expensive inpatient diagnosis groups in 2015
Average total payment per MS-DRG across hospitals. The 2015 inpatient table is 34 MiB.
SELECT
drg_definition,
SUM(total_discharges) AS discharges,
ROUND(AVG(average_total_payments)) AS avg_total_payment_usd
FROM `bigquery-public-data.cms_medicare.inpatient_charges_2015`
GROUP BY drg_definition
ORDER BY avg_total_payment_usd DESC
LIMIT 10;Prescribers of one drug with SELECT * (expensive)
All 21 columns of part_d_prescriber_2014: 3.52 GiB, though only one drug is returned.
SELECT *
FROM `bigquery-public-data.cms_medicare.part_d_prescriber_2014`
WHERE generic_name = 'ATORVASTATIN CALCIUM';Drugs with the highest total Part D cost in 2014 (cheap)
Three columns of the same table: 785 MiB.
SELECT
generic_name,
ROUND(SUM(total_drug_cost)) AS drug_cost_usd,
SUM(total_claim_count) AS claims
FROM `bigquery-public-data.cms_medicare.part_d_prescriber_2014`
GROUP BY generic_name
ORDER BY drug_cost_usd DESC
LIMIT 10;One diagnosis group across all years
A wildcard over inpatient_charges_* reads the five yearly tables for 46.9 MiB. DRG 470 is major joint replacement of the lower extremity.
SELECT
_TABLE_SUFFIX AS year,
ROUND(AVG(average_total_payments)) AS avg_payment_usd
FROM `bigquery-public-data.cms_medicare.inpatient_charges_*`
WHERE drg_definition LIKE '470 %'
GROUP BY year
ORDER BY year;Querying it cheaply
- Five tables make up most of the 12.9 GiB:
part_d_prescriber_2014(3.52 GiB) andphysicians_and_other_supplier_2012to_2015(2.2 to 2.3 GiB each). Inpatient and outpatient tables are under 35 MiB. - No table is partitioned or clustered. Filters on
generic_nameorprovider_statedo not reduce bytes; selecting fewer columns does. - Provider name and address columns (
nppes_provider_last_org_name,nppes_provider_street1) are long strings repeated on every row. Leave them out of aggregations and join them back onnpiat the end if you need them.
FAQ
How much does it cost to query CMS Medicare data in BigQuery?
Hospital charge queries scan under 50 MiB and usually bill the 10 MB minimum or close to it. Part D and physician tables scan up to 2.3 to 3.5 GiB with SELECT *. The whole dataset is 12.9 GiB, about 1.3% of the monthly free tier.
Is the cms_medicare dataset free?
Google pays for storing public datasets, so you never pay storage for them. You pay only for the bytes your queries scan, billed to your own project at the on-demand rate, and the first 1 TiB scanned each month is free. See BigQuery pricing.
Does the dataset have Medicare data after 2015?
No. The newest tables are for 2015 (inpatient, outpatient and physician data) and 2014 (Part D, hospice, nursing facilities). CMS publishes later years on its own data portal.
Related datasets
All public datasets · BigQuery cost queries · Pricing calculator
