Some classes cannot be simultaneously true for one vector of ICD codes, e.g.
ICD-9-CM and ICD-9 from the WHO. This function returns TRUE
if there
are any such combinations of incompatible classes. If the constructor
functions such as icd9cm()
and icd10()
are used, this should
never happen.
icd_classes_conflict(x)
input object to test for class conflicts
# NOT RUN {
bad_codes <- c("100", "A01", "V100", "E999.0")
class(bad_codes) <- c("icd9", "icd10cm")
stopifnot(icd:::icd_classes_conflict(bad_codes))
# }
Run the code above in your browser using DataLab