reverse_ccsr: Look up ICD-10 codes based on CCSR categories

View source: R/reverse_ccsr.R

reverse_ccsrR Documentation

Look up ICD-10 codes based on CCSR categories

Description

Provided with a vector of CCSR categories, this will identify the ICD-10 codes that match that category. It returns a named list of ICD-10 codes that can be used with the icd package to

Usage

reverse_ccsr(CCSR_codes)

Arguments

CCSR_codes

A vector of CCSR codes

Value

A named list with a depth of one and the same length as CCSR_codes, with names corresponding to the provided CCSR_codes. Each element of the list is a character vector of ICD-10 codes corresponding to the CCSR_code. Invalid or missing CCSR_codes are set to NA

Examples

reverse_ccsr("DIG001")
reverse_ccsr("CAR009")

reverse_ccsr(c("DIG001", "CAR009"))
## Not run: 
library(icd)
library(dplyr)

# Example data from ICD package
df <- icd::uranium_pathology %>%
  mutate(icd10 = decimal_to_short(icd10),
         icd10 = as.character(icd10)))

# Categories of interest
CCSR_categories <- c("RSP008", "CIR009", "DIG019", "NEO070")
explain_ccsr(CCSR_categories)

# Create mapping
CCSR_map <- reverse_ccsr(CCSR_categories)

# Map comorbidities
result <- icd::comorbid(df, CCSR_map, return_df = T)

## End(Not run)

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