clean_icd_list: Expand a list of icd9 code ranges.

Description Usage Arguments Details Value Examples

Description

: Given a data.table with a column containing one or more ICD9 code ranges (separated by ";"), and another with the name of the corresponding condition, return a data.table with an expanded, comprehensive list of all valid ICD9 codes falling in the listed range(s), along with names of the condition inherited from the original table.

Usage

1
clean_icd_list(data, code_col, name_col, decimal = TRUE, validate = FALSE)

Arguments

data

data.table containing a column with icd9 code ranges and code range names (data.table).

code_col

name of the column containing the icd9 code ranges (see the below example) - commented out rows (start with '#') are ignored (character).

name_col

name of the column containing the code range names (character).

decimal

whether or not the icd9 codes are in decimal format (logical - TRUE/FALSE) [default: TRUE].

validate

whether or not to subset to 'defined' icd9 codes (see www.rdocumentation.org/packages/icd/versions/2.2/topics/icd_expand_range for more detail) (logical - TRUE/FALSE) [default: FALSE].

Details

Maintained by: Clara Marquardt

Value

data.table with the expanded icd9 code list and the associated code range names.

Examples

1
2
3
4
orig_table <- copy(gagne_code) 
print(orig_table$code)
code_table  <- clean_icd_list(data=orig_table, code_col="code", name_col="condition", decimal=FALSE, validate=FALSE) 
print(code_table)

ClaraMarquardt/ehR documentation built on May 6, 2019, 12:02 p.m.