Skip to content
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

is_valid_icd() incorrectly identifies HCPCS codes as ICD-10-CM #3

Open
andrewallenbruce opened this issue Apr 2, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@andrewallenbruce
Copy link
Owner

library(purrr)
library(pathologie)

x <- c("H00.019", "D50.1", "C4A.70", "Z20.818", "11646", "E8015")

purrr::map_vec(x, is_valid_icd)

[1] "H00.019" "D50.1"   "C4A.70"  "Z20.818" "11646"   "E8015"

Created on 2024-04-01 with reprex v2.1.0

@andrewallenbruce andrewallenbruce added the bug Something isn't working label Apr 2, 2024
@andrewallenbruce andrewallenbruce self-assigned this Apr 2, 2024
@andrewallenbruce
Copy link
Owner Author

andrewallenbruce commented Apr 8, 2024

  • if (nchar(x) < 3 | nchar(x) > 8) FALSE

  • if (nchar(x) == 3) { ...rules for valid alphanumeric combos... }

  • if (nchar(x) >= 4) {strsub(x, 4, 4) == "."}

@andrewallenbruce
Copy link
Owner Author

stringr regex tutorial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant