Classify ICD diagnosis codes into Chronic Condition Indicator categories
classify_chronic.Rd
Converts a vector of ICD diagnosis codes into a vector of Chronic Condition Indicator (CCI) categories using the HCUP's software
Arguments
- icd_dx
A vector of ICD diagnosis codes (without decimals)
- icd_version
The version of ICD codes to be used. Can be either ICD-10 (
icd_version = 10
) or ICD-9 (icd_version = 9
)
Value
A vector of CCI classifications. The levels returned depend on the version of ICD codes. See Details section
Details
Starting in v2021.1 (beta version), the CCI tool for ICD-10-CM was expanded
to identify four types of conditions. Therefore, running the
function with icd_version = 10
will categorize ICD-10-CM codes into one of
the four conditions below:
Acute: Examples include aortic embolism, bacterial infection, pregnancy, and an initial encounter for an injury
Chronic: Examples include malignant cancer, diabetes, obesity, hypertension, and many mental health conditions
Both: Examples include persistent asthma with (acute) exacerbation, acute on chronic heart failure, and kidney transplant rejection
Not Applicable: Examples include external cause of morbidity codes, injury sequela codes, and codes starting with the letter Z for screening or observation
In previous version (using ICD-9-CM), CCI classified conditions as Chronic or NonChronic, so caution should be used when appying the CCI on data using both ICD-9 and ICD-10.
Examples
## Take an ICD dx code and return the CCI
classify_chronic(icd_dx = "G4730", icd_version = 10)
#> [1] "Chronic"
classify_chronic(icd_dx = "56081", icd_version = 9)
#> [1] "NonChronic"
# Vectorized version
icd_codes <- c("G4730", "L563", "M25151")
classify_chronic(icd_codes, icd_version = 10)
#> [1] "Chronic" "Acute" "Acute"
# This works well in the dplyr workflow
library(dplyr)
pt_data <- tibble(
Patients = c("A", "B", "C"),
ICD_10 = c("G4730", "L563", "M25151")
)
pt_data %>%
mutate(CCI = classify_chronic(ICD_10, icd_version = 10))
#> # A tibble: 3 × 3
#> Patients ICD_10 CCI
#> <chr> <chr> <chr>
#> 1 A G4730 Chronic
#> 2 B L563 Acute
#> 3 C M25151 Acute