icd9IsReal
. Factors are accepted, and since the validation is done with grepl
these are handled correctly.
Currently, there is a limitation on NA values. Calling with NA
(which is a logical vector of length one by default) fails, because it is
not a string. This is rarely of significance in real life, since the NA
will be part of a character vector of codes, and will therefore be cast
already to NA_character
NA
values result in a return value of FALSE
.
icd9IsValid(icd9, isShort)
icd9Valid(icd9, isShort)
icd9IsValidDecimal(icd9Decimal)
icd9ValidDecimal(icd9)
icd9IsValidShort(icd9Short)
icd9ValidShort(icd9)
icd9IsValidShortV(icd9Short)
icd9IsValidShortE(icd9Short)
icd9IsValidShortN(icd9Short)
icd9IsValidMajor(major)
TRUE
or FALSE
for each icd9 code
provided according to its validity
isValidMajor
validates just the
'major' three-digit part of an ICD-9 code. This can in fact be provided as
a numeric, since there is no ambiguity. Numeric-only codes should be one to
three digitis, V codes are followed by one or two digits, and E codes
always by three digits between 800 and 999.icd9IsValidDecimal
, icd9IsValidShort
,
http://www.stata.com/users/wgould/icd9/icd9.hlp
urlhttp://www.sascommunity.org/wiki/Validate_the_format_of_ICD-9_codesOther ICD9 validation: icd9IsValidMapping
icd9IsValidShort(c("", "1", "22", "333", "4444", "123.45", "V",
"V2", "V34", "V567", "E", "E1", "E70", "E"))
icd9IsValidMajor(c("", "1", "22", "333", "4444", "123.45", "V",
"V2", "V34", "V567", "E", "E1", "E70", "E"))
Run the code above in your browser using DataLab