-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adjustments()
Implementation
#18
Comments
andrewallenbruce
changed the title
Adjustment Code Assignment
Jun 12, 2024
adjustments()
Implementation
Testing regex to differentiate CARC codes from RARC codes:library(tidyverse)
library(northstar)
search_denials()$site |>
select(adj_code) |>
mutate(
adj_dash = adj_code,
adj_code = str_remove_all(adj_code, "-"),
is_carc_dash = str_detect(adj_dash,
regex("^[ACIOPR]{2}-?[ABDPW]?[0-9]{1,3}$")),
is_carc_nodash = str_detect(adj_code,
regex("^[ACIOPR]{2}-?[ABDPW]?[0-9]{1,3}$")),
works = is_carc_dash == is_carc_nodash
) |>
print(n = 100)
#> # A tibble: 64 × 5
#> adj_code adj_dash is_carc_dash is_carc_nodash works
#> <chr> <chr> <lgl> <lgl> <lgl>
#> 1 CO16 CO-16 TRUE TRUE TRUE
#> 2 M51 M51 FALSE FALSE TRUE
#> 3 N56 N56 FALSE FALSE TRUE
#> 4 CO16 CO-16 TRUE TRUE TRUE
#> 5 M81 M81 FALSE FALSE TRUE
#> 6 CO16 CO-16 TRUE TRUE TRUE
#> 7 MA04 MA04 FALSE FALSE TRUE
#> 8 CO16 CO-16 TRUE TRUE TRUE
#> 9 MA36 MA36 FALSE FALSE TRUE
#> 10 N704 N704 FALSE FALSE TRUE
#> 11 CO16 CO-16 TRUE TRUE TRUE
#> 12 MA120 MA120 FALSE FALSE TRUE
#> 13 CO16 CO-16 TRUE TRUE TRUE
#> 14 MA121 MA121 FALSE FALSE TRUE
#> 15 MA122 MA122 FALSE FALSE TRUE
#> 16 N264 N264 FALSE FALSE TRUE
#> 17 N265 N265 FALSE FALSE TRUE
#> 18 CO16 CO-16 TRUE TRUE TRUE
#> 19 CO16 CO-16 TRUE TRUE TRUE
#> 20 N290 N290 FALSE FALSE TRUE
#> 21 N257 N257 FALSE FALSE TRUE
#> 22 CO16 CO-16 TRUE TRUE TRUE
#> 23 N382 N382 FALSE FALSE TRUE
#> 24 N704 N704 FALSE FALSE TRUE
#> 25 CO19 CO-19 TRUE TRUE TRUE
#> 26 M418 M418 FALSE FALSE TRUE
#> 27 CO22 CO-22 TRUE TRUE TRUE
#> 28 N598 N598 FALSE FALSE TRUE
#> 29 CO24 CO-24 TRUE TRUE TRUE
#> 30 CO29 CO-29 TRUE TRUE TRUE
#> 31 N211 N211 FALSE FALSE TRUE
#> 32 PR31 PR-31 TRUE TRUE TRUE
#> 33 CO45 CO-45 TRUE TRUE TRUE
#> 34 PR45 PR-45 TRUE TRUE TRUE
#> 35 PR49 PR-49 TRUE TRUE TRUE
#> 36 N111 N111 FALSE FALSE TRUE
#> 37 N429 N429 FALSE FALSE TRUE
#> 38 CO50 CO-50 TRUE TRUE TRUE
#> 39 N115 N115 FALSE FALSE TRUE
#> 40 CO96 CO-96 TRUE TRUE TRUE
#> 41 M117 M117 FALSE FALSE TRUE
#> 42 CO96 CO-96 TRUE TRUE TRUE
#> 43 N431 N431 FALSE FALSE TRUE
#> 44 CO97 CO-97 TRUE TRUE TRUE
#> 45 M15 M15 FALSE FALSE TRUE
#> 46 CO97 CO-97 TRUE TRUE TRUE
#> 47 COB20 CO-B20 TRUE TRUE TRUE
#> 48 N111 N111 FALSE FALSE TRUE
#> 49 CO107 CO-107 TRUE TRUE TRUE
#> 50 CO151 CO-151 TRUE TRUE TRUE
#> 51 CO236 CO-236 TRUE TRUE TRUE
#> 52 CO252 CO-252 TRUE TRUE TRUE
#> 53 M23 M23 FALSE FALSE TRUE
#> 54 N704 N704 FALSE FALSE TRUE
#> 55 CO252 CO-252 TRUE TRUE TRUE
#> 56 N706 N706 FALSE FALSE TRUE
#> 57 N704 N704 FALSE FALSE TRUE
#> 58 COB7 CO-B7 TRUE TRUE TRUE
#> 59 N570 N570 FALSE FALSE TRUE
#> 60 PRB8 PR-B8 TRUE TRUE TRUE
#> 61 OA18 OA-18 TRUE TRUE TRUE
#> 62 N522 N522 FALSE FALSE TRUE
#> 63 N103 N103 FALSE FALSE TRUE
#> 64 OA258 OA-258 TRUE TRUE TRUE Created on 2024-06-21 with reprex v2.1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using {triebeard}
Created on 2024-06-11 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: