Verifies that a code conforms to the ICNARC Diagnostic code specification. This is a 5 level hierarchical code that follows a pattern such as ##.##.##.##.##. A code need only supply levels 1:3 to be valid.

verify_icnarc(icnarc_code = NULL)

Arguments

icnarc_code

as a character vector

Value

a logical vector

Details

Leading zeros in each level are not necessary. Acceptable separators are: .,|/-

Examples

verify_icnarc("01.06.04") # partial code; still valid
#> [1] TRUE
verify_icnarc("01.06.04.20.16") # perfect formatting
#> [1] TRUE
verify_icnarc("1.6.4.20.16") # not strictly correct, but can be parsed
#> [1] TRUE
verify_icnarc("01-6-04.20.16") # annoying, but can be parsed
#> [1] TRUE
verify_icnarc("01-6-04.NA.NA") # will warn about the NAs, but will work.
#> Warning: NAs introduced by coercion
#> [1] TRUE