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

Description Usage Arguments Details Value Methods (by class) Examples

View source: R/explain.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
explain_code(...)

explain_icd(...)

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

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

## S3 method for class 'icd9'
explain_code(...)

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

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

## S3 method for class 'icd10who'
explain_code(
  x,
  short_code = guess_short(x),
  condense = TRUE,
  brief = NULL,
  warn = TRUE,
  lang = c("en", "fr"),
  ...
)

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

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

## S3 method for class '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.

Details

explain_icd is a synonym for explain_code.

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)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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"))

## End(Not run)
## 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éoplasme malin du rectum"
explain_code(as.icd10be("C20"), lang = "nl")
# [1] "maligne neoplasma van het rectum"

## End(Not run)

icd documentation built on July 2, 2020, 4:07 a.m.