These functions check whether the given ICD codes look correct, but do not
check whether they have actual definitions in any particular ICD scheme. For
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
is_valid(x, ...) ## S3 method for class 'icd10' is_valid( x, short_code = guess_short(x), whitespace_ok = TRUE, re_short = re_icd10_short, re_decimal = re_icd10_decimal, ... ) ## S3 method for class 'icd10fr' is_valid(x, short_code = guess_short(x), whitespace_ok = TRUE, ...) ## S3 method for class 'icd9' is_valid(x, short_code = guess_short(x), whitespace_ok = TRUE, ...) ## S3 method for class 'comorbidity_map' is_valid(x, short_code, ...)
An ICD-9 or 10 code. If the class is set to
arguments passed on to other functions
Single logical, if
character vector of 'major' part of ICD-9 codes, i.e. that part which falls before the decimal point, in decimal notation. (In five digit notation, the 'major' part is be the first three characters (with leading zeroes), and includes V or E prefix.
Leading zeroes in the decimal form are not ambiguous. Although integer ICD-9 codes could be intended by the user, there is a difference between 100, 100.0, 100.00. Therefore a warning is given if a numeric value is provided.
logical vector with
FALSE for each ICD code
provided according to its validity
icd10: Test whether generic ICD-10 code is valid
icd10fr: Test whether generic ICD-10-FR code is valid
icd9: Test whether generic ICD-10 code is valid
comorbidity_map: Validate a mapping of ICD codes to comorbidities.
icd9_is_valid_major 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 digits, V codes are followed by one or two digits, and E codes
always by three digits between 800 and 999.
Currently, there is a limitation on NA values.
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
S3 class of on object in R is just a vector. Attributes are
lost with manipulation, with the exception of class: therefore, elements of
the class vector are used to describe features of the data. If these are
not present, the user may specify (e.g. decimal vs short_code type, ICD-9
vs ICD-10 WHO), but if they are, the correct functions are called without
any guess work. There is overlap between sets with combinations of
decimal_code, and ICD-9 or ICD-10 codes, so
guessing is never going to be perfect.
1 2 3 4 5 6 7 8 9
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.