Convert MSDRGs into a "base DRG" and complication level

separate_drgs(drgs, remove_age = FALSE)

Arguments

drgs

character vector of MSDRG descriptions, e.g. MSDRGDSC

remove_age

logical; if TRUE will remove age descriptions

Value

a tibble with three columns: msdrg: the input vector, base_msdrg, and msdrg_complication

Details

This function is not robust to different codings of complication in DRG descriptions. If you have a coding other than "W CC" / "W MCC" / "W CC/MCC" / "W/O CC" / "W/O MCC", please file an issue on Github and we'll try to add support for your coding.

Examples

MSDRGs <- c("ACUTE LEUKEMIA W/O MAJOR O.R. PROCEDURE W CC", "ACUTE LEUKEMIA W/O MAJOR O.R. PROCEDURE W MCC", "ACUTE LEUKEMIA W/O MAJOR O.R. PROCEDURE W/O CC/MCC", "SIMPLE PNEUMONIA & PLEURISY", "SIMPLE PNEUMONIA & PLEURISY AGE 0-17") separate_drgs(MSDRGs, remove_age = TRUE)
#> # A tibble: 5 x 3 #> msdrg base_msdrg msdrg_complicati… #> <chr> <chr> <chr> #> 1 ACUTE LEUKEMIA W/O MAJOR O.R. … ACUTE LEUKEMIA W/O MAJOR O… complication #> 2 ACUTE LEUKEMIA W/O MAJOR O.R. … ACUTE LEUKEMIA W/O MAJOR O… major complicati… #> 3 ACUTE LEUKEMIA W/O MAJOR O.R. … ACUTE LEUKEMIA W/O MAJOR O… absent complicat… #> 4 SIMPLE PNEUMONIA & PLEURISY SIMPLE PNEUMONIA & PLEURISY absent complicat… #> 5 SIMPLE PNEUMONIA & PLEURISY AG… SIMPLE PNEUMONIA & PLEURISY absent complicat…