ccsr_dx: Identify CCSR categories for ICD-10-CM codes

View source: R/ccsr_dx.R

ccsr_dxR Documentation

Identify CCSR categories for ICD-10-CM codes

Description

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

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_id ICD10dx
A K432
A A401
B ...

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

ICD10 CCSR1 CCSR2 CCSR(n)
K432 DIG010 --- ...
A401 INF002 INF003 ...
... ... ... ...

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_id ICD10dx CCSR
A K432 DIG010
A A401 INF002
A A401 INF003
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.

Value

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

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)
library(tibble) # for tribble fxn
library(tidyr)  # for unnest

## Using a single ICD code
ccsr_dx("K432")
ccsr_dx("A401")

## When vectorized, returns list
ccsr_dx(c("K432", "A401")) %>% str()

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

  mutate(CCSR = ccsr_dx(ICD10)) %>%
  unnest_longer(CCSR)


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