Learn R Programming

icd (version 4.0.6)

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

Description

Converts a vector of ICD codes to a vector of descriptions of these codes. The conversion is based on the edition (ICD-9 or ICD-10), and class (e.g., icd10who) of the input vector. See examples.

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 icd10who explain_code(x, short_code = guess_short(x), condense = TRUE, brief = NULL, warn = TRUE, lang = c("en", "fr"), ...)

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

# S3 method for icd10be explain_code(x, lang = c("fr", "nl", "en"), ...)

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

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.

lang

For WHO ICD-10 codes, the 2016 English and 2008 French translations are available. Use en or fr respectively. For ICD-10-CM codes, Dutch is also available, indicated by nl.

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

  • icd10who: WHO ICD-10 explanation in French or English

  • icd10fr: ICD-10-FR explanation, initial implementation, subject to change

  • icd10be: ICD-10-BE explanation, initial implementation, subject to change

  • icd10: ICD-10 explanation, falls back on ICD-10-CM until ICD-10 WHO copyright workaround is available

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)
# }
# NOT RUN {
# these may need to download the WHO data first:
explain_code(as.icd10who("B219"), lang = "fr")
explain_code(as.icd10who("B219"))
# }
# NOT RUN {
# Belgian ICD-10 has three languages available
explain_code(as.icd10be("C20"))
# [1] "Malignant neoplasm of rectum"
explain_code(as.icd10be("C20"), lang = "en")
# [1] "Malignant neoplasm of rectum"
explain_code(as.icd10be("C20"), lang = "fr")
# [1] "n<U+00E9>oplasme malin du rectum"
explain_code(as.icd10be("C20"), lang = "nl")
# [1] "maligne neoplasma van het rectum"
# }

Run the code above in your browser using DataLab