Convert 'decimal' format (123.45 style) ICD-9 codes into the name and description for human review there are official ICD9-CM data tables, not with conversion to decimal notation, but to the textual format.
explain(...)explain_icd(...)
# S3 method for default
explain(x, short_code = guess_short(x), condense = TRUE,
brief = FALSE, warn = TRUE, ...)
# S3 method for list
explain(x, ...)
# S3 method for icd9
explain(...)
# S3 method for icd9cm
explain(x, short_code = guess_short(x), condense = TRUE,
brief = FALSE, warn = TRUE, ...)
# S3 method for icd10cm
explain(x, short_code = guess_short(x), condense = TRUE,
brief = FALSE, warn = TRUE, ...)
# S3 method for icd10
explain(x, short_code = guess_short(x), condense = TRUE,
brief = FALSE, warn = TRUE, ...)
icd_explain(...)
icd_explain.default(...)
icd_explain.icd10(...)
icd_explain.icd10cm(...)
icd_explain.icd9(...)
icd_explain.icd9cm(...)
icd_explain.list(...)
icd_explain_table.default(...)
icd_explain(...)
arguments passed on to other functions
vector or other structure of ICD codes to explain in human language
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 which indicates whether to condense the given set of ICD-9 codes by replacing subsets of codes with 'parent' codes which exactly encompass certain subsets. E.g. If all cholera diagnoses are provided, only '001 - Cholera' needs to be displayed, not all sub-types.
single logical value, default is FALSE
. If TRUE
,
the short description from the canonical CMS descriptions (included in
data-raw
) will be used, otherwise the long description is used.
single logical value, default is TRUE
, meaning that codes
which do not correspond to diagnoses, or to three-digit codes, will trigger
a warning.
data frame, or list of data frames, with fields for ICD-9 code, name
and description. There is no guarantee on the order of the returned
descriptions. explain_table
is designed to provide results in a
reliable order (when not condensing codes, at least).
default
: Explain ICD codes from a character vector, guessing
ICD version
list
: Explain all ICD-9 codes in a list of vectors
icd9
: explain character vector of ICD-9 codes.
icd9cm
: explain character vector of ICD-9-CM codes
icd10cm
: ICD-10-CM explanation, current a minimal implementation
icd10
: ICD-10 explanation, falls back on ICD-10-CM until
ICD-10 WHO copyright workaround is available
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
.
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
.
explain_icd
is a synonym for explain
to avoid conflict with dplyr::explain
. Alternative is to use icd::explain
.
# NOT RUN {
# by default, just show parent code and ignore children (428.0 not shown
# because 428 is present):
explain(icd9_map_ahrq$CHF[1:3])
# same without condensing the list. In this case, 428.0 is shown:
explain(icd9_map_ahrq$CHF[1:3], brief = TRUE)
# The first three in the ICD-10 equivalent are a little different:
explain(icd10_map_ahrq$CHF[1:3], brief = TRUE)
# nice to have magrittr, but not essential
library(magrittr, warn.conflicts = FALSE, quietly = TRUE)
explain(icd9_map_ahrq$CHF[1:3] %>% condense)
# }
Run the code above in your browser using DataLab