Learn R Programming

icd (version 3.3)

explain_code: Explain ICD-9 and ICD-10 codes in English

Description

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.

Usage

explain_code(...)

explain_icd(...)

# S3 method for default explain_code(x, short_code = guess_short(x), condense = TRUE, brief = FALSE, warn = TRUE, ...)

# S3 method for list explain_code(x, ...)

# S3 method for icd9 explain_code(...)

# S3 method for icd9cm explain_code(x, short_code = guess_short(x), condense = TRUE, brief = FALSE, warn = TRUE, ...)

# S3 method for icd10cm explain_code(x, short_code = guess_short(x), condense = TRUE, brief = FALSE, warn = TRUE, ...)

# S3 method for icd10 explain_code(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(...)

Arguments

...

arguments passed on to other functions

x

vector or other structure of ICD codes to explain in human language

short_code

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.

condense

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.

brief

single logical value, default is FALSE. If TRUE, the short description from the canonical CMS descriptions will be used, otherwise the long description is used.

warn

single logical value, default is TRUE, meaning that codes which do not correspond to diagnoses, or to three-digit codes, will trigger a warning.

Value

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).

Methods (by class)

  • 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

Deprecated function names

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 prefix icd:: instead, e.g., icd::charlson. Functions which specifically operate on either ICD-9 or ICD-10 codes or their sub-types will retain the prefix. E.g. icd9_comorbid_ahrq. icd specific classes also retain the prefix, e.g., icd_wide_data.

Details

explain_icd is a synonym for explain_code.

Examples

Run this code
# NOT RUN {
# by default, just show parent code and ignore children (428.0 not shown
# because 428 is present):
explain_code(icd9_map_ahrq$CHF[1:3])
# same without condensing the list. In this case, 428.0 is shown:
explain_code(icd9_map_ahrq$CHF[1:3], brief = TRUE)
# The first three in the ICD-10 equivalent are a little different:
explain_code(icd10_map_ahrq$CHF[1:3], brief = TRUE)
# nice to have magrittr, but not essential
library(magrittr, warn.conflicts = FALSE, quietly = TRUE)
explain_code(icd9_map_ahrq$CHF[1:3] %>% condense)
# }

Run the code above in your browser using DataLab