Map ICD-10 or ICD-10-CM codes to a list of chronic comorbidities, comorbidity groups, and Charlson Comorbidity Index weights from Quan et al. (2005) .

map_charlson_comorbidities(df, icd_column)

Source

Adapted from comorbidity()

Arguments

df

a data frame containing ICD-10 look up data

icd_column

a variable name or column number in df containing ICD-10 codes.

Value

The input data frame df enhanced with the following variables:

  • comorb a character vector of 17 comorbidity codes (adapted from the comorbidity package)

  • comorb_group a character vector of codes grouping comorb codes into 14 categories collapsing different severities of the same condition (for diabetes, liver disease, cancer). This is to avoid double counting comorbidities.

  • charlson_weights an integer vector of weights from Quan et al. (2005) used to compute the weighted Charlson comorbidity score

References

Quan H, Sundararajan V, Halfon P, Fong A, Burnand B, Luthi J, Saunders LD, Beck CA, Feasby TE, Ghali WA (2005). “Coding Algorithms for Defining Comorbidities in ICD-9-CM and ICD-10 Administrative Data.” Medical Care, 43(11), 1130--1139. doi:10.1097/01.mlr.0000182534.19832.83 .

Examples

mock_icd_data <- data.frame(
   list(icd10_code = c("J44", "J44X", "J440")), 
   stringsAsFactors = FALSE)
mock_icd_data <- map_charlson_comorbidities(
  mock_icd_data, "icd10_code")
mock_icd_data
#>   icd10_code comorb comorb_group charlson_weights
#> 1        J44    cpd          cpd                1
#> 2       J44X    cpd          cpd                1
#> 3       J440    cpd          cpd                1