add-procedures.Rmd
In 2019, we purchased more than 100 procedures that are commonly performed by general surgery surgeons from CMS. The purchased procedures went back from 2007. Since we already have Medicare data from 2007-2016 for the original 5 procedures, we received the purchased procedures in separate datasets. After 2016, all newly added procedures and original 5 procedures are together in one data file each year.
Changes needed for professional claims (Carrier claim and line
files). New procedure files location on Maize:
Shared3/DMH_Shared/Dimick_Improve_Surgical_Care/SAS_Files/New_Hernia_ECMD
.
We don’t need to rerun standardization process for MBSF and MedPAR
because we already have 100% MedPAR and MBSF datasets each year. Added
beneficiaries and MedPAR cases that are related to Carrier files are
already included in the old files.
Note: in the data folder, you can find the datasets from 2007-2017.
As mentioned above, after 2016, all procedures will be in one data file
under yearly purchased, eg.
Dimick_Improve_Surgical_Care/SAS_Files/2017
.
The datasets we use are carrier files named as:
bcarrier_ln_20xx
and bcarrier_clms_20xx
Combine new carrier files to the original 5 carrier files;
George_Surgeon_Projects/original\medicare\selectedvars/data/Carrier/ecs
Combine ecs claim and line files with the original 5 procedures by
year.Code used to combine datasets are at add_procedure
The map we use for the project is at ecs_list. - In the list, CPTs to ECS procedures are not uniquely mapped. Make sure to get unique maps between cpt to ECS to avoid data processing errors (introduce by left join process)
# do not run
# ecs_list_with_coded_flg.csv was downloaded from https://docs.google.com/spreadsheets/d/1Fa2xWCRIe5-_3F7MpQPvJfCzy_lBtWFvB_TGevnZ60Q/edit#gid=1841533335
cpt_map = readr::read_csv("/Volumes/George_Surgeon_Projects/standardized_medicare_data_using_R/input/raw/ecs_list_with_coded_flg.csv")
# one cpt to one procedure
cpt_ecs_map = cpt_map %>%
distinct(cpt, ecs_id, ECSProcedureName, ProcedureGroup)
Create 0.1% sample data for the carrier claim and line files
Combine ecs files to the old datasets as described above
Carrier/Claim
folder, so ECS folder should NOT be used
after the combining process.Standardize the combined datasets using code std_master
Import_mapping.csv and import_src.csv don’t need to be edited, because all the variables and file names didn’t change for the new ECS files.
However, the year under import_src.csv needs to be customized to fit in your needs. In our situation, we only need 2007-2016.
# you can control years by editing import_src
import_src <- read_csv("data/2020/import_source.csv") %>%
filter(source_dir<2017)
# do not run
# procedure map defined by cpt
define_proc_by_cpt <- readr::read_csv(paste0(wd$input_data, "cpt_ecs_map.csv")) %>%
transmute(cpt_cd = as.character(cpt), e_proc_grp = ecs_id, e_proc_grp_lbl = ECSProcedureName) %>%
distinct()