An ICD code consists of, at a minimum, a three digit ICD-10 code (i.e. one upper-case letter followed by two digits). This may optionally be followed by a two digit subcode, selected punctuation symbols (cross "*", dagger "U2020" or exclamation mark "!"). Both the period separating the three-digit code from the subcode, and the hyphen indicating an "incomplete" subcode, are optional. Finally, in the ambulatory system, an additional letter G, V, Z or A may be appended to signify the status ("security") of the diagnosis.
Character vector from which to extract all ICD codes
A character string determining how strictly matching should be performed. This must be one of "strict" (
logical. Whether to convert the matrix output of
By default, the function returns a data.frame
containing the matched codes and the standardised
three digit code (
icd3), subcode (
icd_norm) and code without period (
bind_rows = FALSE, the list output of
stringi::stri_match_all_regex is returned.
This is particularly useful to retrieve the
matches from each element of the
data.frame (if bind_rows = TRUE) or matrix
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.