fac_dx.Rd
add facility code info to the analytic dataset
fac_dx(
original_data = analytic_demo,
std_data_root = wd$std_data_root,
year = 2007,
max_year = 2018,
fac_codes_folder = "fac_clm_code",
fac_clm_folder = "fac_clm"
)
data name for the data you want to add the info to
data path to the standardized data folder
select one year to process, e.g. 2007
the most recent medicare year we have; for example, in 2020, we have Medpar processed up to 2018
folder name for fac_code
folder name for fac_clm data (.csv format is a must)
read std fac_clm and fac_clm_code data;
join fac_clm and prof_clm by memberID and service date info. Prof claim dates should be within facility claim dates
then join fac_clm_code with analytic dataset by memberID and facility claim ID (attach dx code info)
create admission_type(urgent/not), 30d death