Select codes from column consisting ICD-10 codes that meet the requirement for injury codes ie. between S00 to T78
Usage
get_valid_codes(
d,
select.col = "hoveddiagnoser",
create.col = "hovdiag",
split = " ",
keep = FALSE
)
Arguments
- d
Dataset
- select.col
Columnames from dataset with ICD codes to be controlled for. Default is
hoveddiagnoser
- create.col
New columnames consisting logical value to indicate that at least one of these codes S00 to T78 exists ie. TRUE means one or more of the codes in
select.col
is between S00 to T78. Default ishovdiag
- split
Symbols for splitting the codes when there are multiple codes in the column. Default is whitespace ie.
" "
- keep
Split multiple codes and keep in its own column. Default is FALSE.