Description Usage Arguments Methods (by class) See Also Examples
These functions take a set of ICD codes, and look for parent ICD codes in the
hierarchy. If all the children of a parent are found, then the returned
vector will just contain the parents of those codes. Any additional codes
which did not have all the siblings present are retained. This can be thought
of as the inverse operation to children
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14  condense(x, short_code = guess_short(x), defined = NULL, warn = TRUE, ...)
## S3 method for class 'character'
condense(x, short_code = guess_short(x), defined = NULL, ...)
## S3 method for class 'factor'
condense(x, short_code = guess_short(x), defined = NULL, ...)
icd9_condense_decimal(
x,
defined = NULL,
warn = TRUE,
keep_factor_levels = FALSE
)

short_code 
single logical value which determines whether the ICD9
code provided is in short ( 
... 
arguments passed on to other functions 
icd9 
is
a character vector or factor of ICD9 codes. If fewer than five characters
is given in a code, then the digits are greedily assigned to hundreds, then
tens, then units, before the decimal parts. E.g., 
icd9Short 
is a character vector of ICD9 codes. If fewer than five
characters is given in a code, then the digits are greedily assigned to
hundreds, then tens, then units, before the decimal parts. E.g., 
character 
vector of ICD9 codes. If fewer than five
characters is given in a code, then the digits are greedily assigned to
hundreds, then tens, then units, before the decimal parts. E.g., 
character
: Condense a set of ICD codes, guessing ICD version
from input data
factor
: Condense a factor of ICD codes
Other ICD9 ranges:
children()
,
expand_range()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  kids < children("V40")
kids
condense(kids, defined = TRUE)
kids_with_undefined < children("V40", defined = FALSE)
head(kids_with_undefined)
length(kids_with_undefined)
condense(kids, defined = FALSE)
# what happens if we have additional codes?
# (condense will warn if we don't explicitly ask to condense
# based on defined or possible codes.)
condense(c(kids, "41100"), warn = FALSE)
# a good use is to summarise the contents of a comorbidity:
icd9_map_elix$CHF
condense(icd9_map_elix$CHF, warn = FALSE)
# explaining big groups of codes takes advantage of this:
explain_code(icd9_map_elix$CHF, condense = TRUE, warn = FALSE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.