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"
)

Arguments

original_data

data name for the data you want to add the info to

std_data_root

data path to the standardized data folder

year

select one year to process, e.g. 2007

max_year

the most recent medicare year we have; for example, in 2020, we have Medpar processed up to 2018

fac_codes_folder

folder name for fac_code

fac_clm_folder

folder name for fac_clm data (.csv format is a must)

Value

Details

  1. read std fac_clm and fac_clm_code data;

  2. join fac_clm and prof_clm by memberID and service date info. Prof claim dates should be within facility claim dates

  3. then join fac_clm_code with analytic dataset by memberID and facility claim ID (attach dx code info)

  4. create admission_type(urgent/not), 30d death