healthcareai (version 2.3.0)

separate_drgs: Convert MSDRGs into a "base DRG" and complication level

Description

Convert MSDRGs into a "base DRG" and complication level

Usage

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab