Expand ICD codes to all possible sub-codes, optionally limiting to those codes which are defined or billable (leaf nodes).
children(x, ...)# S3 method for character
children(x, ...)
# S3 method for icd9
children(x, short_code = guess_short(x), defined = TRUE,
billable = FALSE, ...)
# S3 method for icd10
children(x, short_code = guess_short(x), defined,
billable = FALSE, ...)
# S3 method for icd10cm
children(x, short_code = guess_short(x), defined,
billable = FALSE, ...)
icd_children.character(...)
icd_children.icd10(...)
icd_children.icd10cm(...)
icd_children.icd9(...)
icd_children(...)
icd_children_defined(...)
icd_children_defined.icd10cm(...)
data, e.g. character vector of ICD codes.
arguments passed on to other functions
single logical value which determines whether the ICD-9
code provided is in short (TRUE
) or decimal (FALSE
) form.
Where reasonable, this is guessed from the input data.
single logical value, whether returned codes should only include those which have definitions. Definition is based on the ICD version being used, e.g. ICD-9-CM, the WHO version of ICD-10, or other.
single logical value, whether to limit return codes also by whether they are billable, i.e. leaf nodes. This is really only designed for use with ICD-9-CM, ICD-10-CM etc, since the WHO versions are not designed for billing, but for public health and death reporting.
Returns a vector of ICD codes, with class of character
and the
class of the identified or specified ICD code, e.g. icd9
character
: Get child codes, guessing ICD version and short
versus decimal format
icd9
: Get children of ICD-9 codes
icd10
: Get children of ICD-10 codes (warns because this
only applies to ICD-10-CM for now).
icd10cm
: Get children of ICD-10-CM codes
Future versions of icd will drop
the icd_
prefix. For example, charlson
should be used in
favor of icd_charlson
. To distinguish icd function calls,
consider using the namespace prefix icd::
instead, e.g.,
icd::charlson
. Functions which specifically operate on either ICD-9
or ICD-10 codes or their subtypes will retain the prefix. E.g.
icd9_comorbid_ahrq
. icd specific classes also retain
the prefix, e.g., icd_wide_data
.
Future versions of icd will drop
the icd_
prefix. For example, charlson
should be used in
favor of icd_charlson
. To distinguish icd function calls,
consider using the namespace prefix icd::
instead, e.g.,
icd::charlson
. Functions which specifically operate on either ICD-9
or ICD-10 codes or their subtypes will retain the prefix. E.g.
icd9_comorbid_ahrq
. icd specific classes also retain
the prefix, e.g., icd_wide_data
.
Future versions of icd will drop
the icd_
prefix. For example, charlson
should be used in
favor of icd_charlson
. To distinguish icd function calls,
consider using the namespace prefix icd::
instead, e.g.,
icd::charlson
. Functions which specifically operate on either ICD-9
or ICD-10 codes or their subtypes will retain the prefix. E.g.
icd9_comorbid_ahrq
. icd specific classes also retain
the prefix, e.g., icd_wide_data
.
Future versions of icd will drop
the icd_
prefix. For example, charlson
should be used in
favor of icd_charlson
. To distinguish icd function calls,
consider using the namespace prefix icd::
instead, e.g.,
icd::charlson
. Functions which specifically operate on either ICD-9
or ICD-10 codes or their subtypes will retain the prefix. E.g.
icd9_comorbid_ahrq
. icd specific classes also retain
the prefix, e.g., icd_wide_data
.
Future versions of icd will drop
the icd_
prefix. For example, charlson
should be used in
favor of icd_charlson
. To distinguish icd function calls,
consider using the namespace prefix icd::
instead, e.g.,
icd::charlson
. Functions which specifically operate on either ICD-9
or ICD-10 codes or their subtypes will retain the prefix. E.g.
icd9_comorbid_ahrq
. icd specific classes also retain
the prefix, e.g., icd_wide_data
.
Future versions of icd will drop
the icd_
prefix. For example, charlson
should be used in
favor of icd_charlson
. To distinguish icd function calls,
consider using the namespace prefix icd::
instead, e.g.,
icd::charlson
. Functions which specifically operate on either ICD-9
or ICD-10 codes or their subtypes will retain the prefix. E.g.
icd9_comorbid_ahrq
. icd specific classes also retain
the prefix, e.g., icd_wide_data
.
Future versions of icd will drop
the icd_
prefix. For example, charlson
should be used in
favor of icd_charlson
. To distinguish icd function calls,
consider using the namespace prefix icd::
instead, e.g.,
icd::charlson
. Functions which specifically operate on either ICD-9
or ICD-10 codes or their subtypes will retain the prefix. E.g.
icd9_comorbid_ahrq
. icd specific classes also retain
the prefix, e.g., icd_wide_data
.
Other ICD-9 ranges: condense
,
expand_minor
, expand_range
# NOT RUN {
library(magrittr, warn.conflicts = FALSE, quietly = TRUE) # optional
# no children other than self
children("10201", short_code = TRUE, defined = FALSE)
# guess it was ICD-9 and a short, not decimal code
children("0032")
# empty because 102.01 is not meaningful
children("10201", short_code = TRUE, defined = TRUE)
children("003", short_code = TRUE, defined = TRUE) %>%
explain(condense = FALSE, short_code = TRUE)
children(short_code = FALSE, "100.0")
children(short_code = FALSE, "100.00")
children(short_code = FALSE, "2.34")
# }
Run the code above in your browser using DataLab