classify_chronic: Classify ICD diagnosis codes into Chronic Condition Indicator...

View source: R/classify_chronic.R

classify_chronicR Documentation

Classify ICD diagnosis codes into Chronic Condition Indicator categories

Description

Converts a vector of ICD diagnosis codes into a vector of Chronic Condition Indicator (CCI) categories using the HCUP's software

Usage

classify_chronic(icd_dx, icd_version)

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 = "dx10") or ICD-9 (icd_version = "dx9")

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 = "dx10" 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.

Value

A vector of CCI classifications. The levels returned depend on the version of ICD codes. See Details section

Source

HCUP page for CCI with ICD-9

HCUP page for CCI with ICD-10

See Also

CCI_icd9 and CCI_icd10 in the hcup.data package for the datasets

Examples

## Take an ICD dx code and return the CCI
classify_chronic(icd_dx = "G4730", icd_version = "dx10")
classify_chronic(icd_dx = "56081", icd_version = "dx9")

# Vectorized version
icd_codes <- c("G4730", "L563", "M25151")
classify_chronic(icd_codes, icd_version = "dx10")

# 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 = "dx10"))

HunterRatliff1/hcup documentation built on Aug. 6, 2023, 6:10 p.m.