Skip to contents

Check if string is valid length of a HCPCS code

Usage

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

Arguments

x

<chr> string of length(1)

arg

<chr> function argument name in the current function

call

<environment> environment the function is called from

Value

<lgl>

TRUE if valid, FALSE otherwise

a tibble

Examples

is_valid_length("11646")
#> [1] "11646"

try(is_valid_length("1164"))
#> Error in eval(expr, envir, enclos) : 
#>   A HCPCS code is 5 characters.
#>  "1164" is 4.