death_icd10_clean: Clean and Standardize ICD-10 Death Codes

View source: R/death_functions.R

death_icd10_cleanR Documentation

Clean and Standardize ICD-10 Death Codes

Description

This function prepares ICD-10 codes for processing with the death functions in the rads package.

Usage

death_icd10_clean(icdcol)

Arguments

icdcol

A character vector containing ICD-10 codes.

Details

This function prepares ICD-10 codes for processing with the death functions in the rads package. It performs cleaning and tidying operations, such as converting codes to uppercase, removing non-alphanumeric characters (e.g., hyphens and periods), validating the ICD-10 code format, trimming codes to a maximum of 4 characters, and padding shorter codes with zeros when needed. It is used internally by rads death functions but can also be used as a standalone function.

Value

A cleaned and standardized character vector of ICD-10 codes.

Examples


icd_codes <- c("A85.2", "B99-1", "J20.9", "INVALID", "C34")
cleaned_icd_codes <- death_icd10_clean(icd_codes)
print(cleaned_icd_codes)


PHSKC-APDE/rads documentation built on April 14, 2025, 10:47 a.m.