Skip to content

Instantly share code, notes, and snippets.

@conjugateprior
Last active January 9, 2019 17:51
Show Gist options
  • Save conjugateprior/2d5fc8b53bdd272c6f0e705b39430d15 to your computer and use it in GitHub Desktop.
Save conjugateprior/2d5fc8b53bdd272c6f0e705b39430d15 to your computer and use it in GitHub Desktop.
A monster table of medical charges, parsed but not interpreted
# install.packages(c("jsonlite", "dplyr"))
library(jsonlite)
library(dplyr)
json <- "https://www.sutterhealth.org/for-patients/chargemaster-2019.json"
cmr <- read_json(json)
gg <- bind_rows(lapply(cmr$CDM, as.data.frame))
head(gg) # ok, now what...
# FACILITY CMS_PROV_ID HOSPITAL_NAME SERVICE_SETTING CDM
# 1 ABMC 50305 Alta Bates Summit Medical Center - Alta Bates Campus DRG DRG-064
# 2 ABMC 50305 Alta Bates Summit Medical Center - Alta Bates Campus DRG DRG-189
# 3 ABMC 50305 Alta Bates Summit Medical Center - Alta Bates Campus DRG DRG-190
# 4 ABMC 50305 Alta Bates Summit Medical Center - Alta Bates Campus DRG DRG-193
# 5 ABMC 50305 Alta Bates Summit Medical Center - Alta Bates Campus DRG DRG-194
# 6 ABMC 50305 Alta Bates Summit Medical Center - Alta Bates Campus DRG DRG-291
# DESCRIPION REVENUE_CODE CHARGE
# 1 INTRACRANIAL HEMORRHAGE OR CEREBRAL INFARCTION W MCC 94946
# 2 PULMONARY EDEMA & RESPIRATORY FAILURE 52947
# 3 CHRONIC OBSTRUCTIVE PULMONARY DISEASE W MCC 54264
# 4 SIMPLE PNEUMONIA & PLEURISY W MCC 51524
# 5 SIMPLE PNEUMONIA & PLEURISY W CC 34576
# 6 HEART FAILURE & SHOCK W MCC 63797
head(filter(gg, grepl("HEART FAILURE", DESCRIPION)))
# FACILITY CMS_PROV_ID HOSPITAL_NAME SERVICE_SETTING CDM
# 1 ABMC 50305 Alta Bates Summit Medical Center - Alta Bates Campus DRG DRG-291
# 2 CPMCD 50008 California Pacific Medical Center - Davies Campus DRG DRG-291
# 3 CPMCP 50047 California Pacific Medical Center - Pacific Campus DRG DRG-291
# 4 CPMCP 50047 California Pacific Medical Center - Pacific Campus DRG DRG-292
# 5 EMC 50488 Eden Medical Center DRG DRG-291
# 6 EMC 50488 Eden Medical Center DRG DRG-292
# DESCRIPION REVENUE_CODE CHARGE
# 1 HEART FAILURE & SHOCK W MCC 63797
# 2 HEART FAILURE & SHOCK W MCC 51073
# 3 HEART FAILURE & SHOCK W MCC 71147
# 4 HEART FAILURE & SHOCK W CC 58335
# 5 HEART FAILURE & SHOCK W MCC 73583
# 6 HEART FAILURE & SHOCK W CC 50429
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment