Skip to contents

Check if string is valid ICD-10-CM code

Usage

is_valid_icd(x, arg = rlang::caller_arg(x), call = rlang::caller_env())

Arguments

x

<chr> string of length(x) == 1

arg

<chr> function argument name in the current function

call

<env> environment the function is called from

Value

<lgl> vector; TRUE if valid, FALSE otherwise

Examples

purrr::map_vec(
c("H00.019", "D50.1", "C4A.70", "Z20.818", "11646", "E8015"),
is_valid_icd)
#> [1] "H00.019" "D50.1"   "C4A.70"  "Z20.818" "11646"   "E8015"