Skip to contents

Given a vector of ICD-10-CM diagnosis codes, this function returns a list of the Clinical Classifications Software Refined (CCSR) categories associated with these codes

Usage

ccsr_dx(icd_10_dx)

Arguments

icd_10_dx

A vector of ICD-10-CM diagnosis codes

Value

A list charachter vectors with a of length(icd_10_dx).

Details

The Clinical Classifications Software Refined (CCSR) software provides both one-to-one mapping (see classify_ccsr_dx1) and one-to-many (see ccsr_dx) mapping of ICD-10-CM diagnosis codes to CCSR categories. The one-to-many mapping is necessary because many ICD-10 codes span multiple meaningful categories, and the identification of all conditions related to a diagnosis code would be lost by categorizing some ICD-10-CM codes into a single category.

One-to-many

For example, consider the code I11.0 (Hypertensive heart disease with heart failure) which encompasses both heart failure (CCSR category CIR019) and hypertension with complications (CIR008). Classifying this code as heart failure alone would miss meaningful information, but on the other hand, some analyses require mutually exclusive categorization.

This function addresses identifying all CCSR categories associated with an ICD code. For example, consider a data.frame with an ICD-10 code per row:

pt_idICD10dx
AK432
AA401
B...

The corresponding CCSR codes for these two codes are below. Note that K432 only has one CCSR category, while A401 has two.

ICD10CCSR1CCSR2CCSR(n)
K432DIG010---...
A401INF002INF003...
............

Running this function for patient A's two codes, results in three rows because A401 has two categories (plus the single row for K432). See the tidy data section of R for Data Science or the corresponding paper for more on this conceptual approach.

pt_idICD10dxCCSR
AK432DIG010
AA401INF002
AA401INF003
B......

CCSR vs CCS

There are numerous differences between CCSR and CCS (the predecessor to CCSR). The CCS classifies codes into multi-level categories in a hierarchical manner, which allows users of CCS to use varying levels of specificity in their classification (see classify_ccs), while the CCSR does not have multiple classification levles. Additionally, CCSR does not classify codes into mutually exclusive categories (for ICD-10 diagnosis codes) and the categories used in CCSR aren't the same as the old categories used in CCS.

See Appendix A of the CCSR user guide for more details on the differences between CCSR and CCS.

See also

classify_ccsr_dx1 for identifying a single CCSR category based on the principal diagnosis

classify_ccs for the legacy CCS categories

Examples

library(dplyr)
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
library(tibble) # for tribble fxn
library(tidyr)  # for unnest

## Using a single ICD code
ccsr_dx("K432")
#> [1] "DIG010"
ccsr_dx("A401")
#> [1] "INF002" "INF003"

## When vectorized, returns list
ccsr_dx(c("K432", "A401")) %>% str()
#> List of 2
#>  $ : chr "DIG010"
#>  $ : chr [1:2] "INF002" "INF003"

## Use unnest to make it tidy
tibble::tribble(
  ~pt_id,  ~ICD10,
     "A",  "K432",
     "A",  "A401") %>%

  mutate(CCSR = ccsr_dx(ICD10)) %>%
  unnest_longer(CCSR)
#> # A tibble: 3 × 3
#>   pt_id ICD10 CCSR  
#>   <chr> <chr> <chr> 
#> 1 A     K432  DIG010
#> 2 A     A401  INF002
#> 3 A     A401  INF003