I am trying to create a list of ICD 10-CM codes that I can analyse a dataset with, and I think the best way to do this is to generate the individual codes. When I generate the codes, however, it doesn't include the decimals for whole numbers, which is an issue for the str_detect
part that comes next.
I have tried to do this
complex_chronic <- c("G90.1", paste("Q", seq(00.0, 00.2, 0.01), sep = ""),
paste("Q", round(seq(01.0, 01.9, 0.01), digits = 2), sep = ""), "Q02",
paste("Q", signif(seq(03.0, 07.9, 0.01), digits = 3), sep = ""),
paste("F", seq(71.0, 73.9, 0.01), sep = ""))
and none of these methods work, instead returning the values as whole numbers i.e. "Q1"
vs "Q1.00"
.
Does anyone have an idea of how to fix this, or alternatively, a better way to search a list of ICD 10-CM codes, such as using the package icd
(I couldn't figure out how to do this)?