A valid CPT Category I code is:
Usage
is_cpt_category_I(hcpcs_code)
Arguments
- hcpcs_code
<chr>
string
Value
<lgl>
TRUE
if valid, otherwise FALSE
Details
5 characters long
Begins with any 4 digits, [0-9]{4}
, and
Ends with one of [AMU0-9]
Examples
x <- c('T1503', 'G0478', '81301', '69641', '0583F', '0779T', NA)
is_cpt_category_I(x)
#> [1] FALSE FALSE TRUE TRUE FALSE FALSE NA
x[which(is_cpt_category_I(x))]
#> [1] "81301" "69641"