Learn R Programming

icd9 (version 1.1)

icd9Explain: explain ICD9 codes

Description

convert full format (123.45 style) ICD9 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

icd9Explain(icd9, isShort = icd9GuessIsShort(icd9), doCondense = TRUE,
  brief = FALSE, warn = TRUE, toMajor = TRUE)

icd9ExplainShort(icd9Short, doCondense = TRUE, brief = FALSE, warn = TRUE, toMajor = TRUE)

icd9ExplainDecimal(icd9Decimal, doCondense = TRUE, brief = FALSE, warn = TRUE, toMajor = TRUE)

# S3 method for list icd9Explain(icd9, isShort = icd9GuessIsShort(icd9), doCondense = TRUE, brief = FALSE, warn = TRUE, toMajor = TRUE)

# S3 method for factor icd9Explain(icd9, isShort = icd9GuessIsShort(icd9), doCondense = TRUE, brief = FALSE, warn = TRUE, toMajor = TRUE)

# S3 method for character icd9Explain(icd9, isShort = icd9GuessIsShort(icd9), doCondense = TRUE, brief = FALSE, warn = TRUE, toMajor = TRUE)

# S3 method for numeric icd9Explain(icd9, isShort = icd9GuessIsShort(icd9), doCondense = TRUE, brief = FALSE, warn = FALSE, toMajor = TRUE)

Arguments

icd9

is a character vector or factor of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010".

isShort

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.

doCondense

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

brief

single logical value, default is FALSE. If TRUE, the short description from the canonical CMS descriptions (included in extdata) 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.

toMajor

Most major codes are not real, e.g. Salmonella 003 is a major category, but is not itself used as a diagnostic code. Therefore, strictly, asking for only real codes excludes the major. We'll turn a blind eye to this if we specifically request majors with toMajor.

icd9Short

is a character vector of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010"

icd9Decimal

character vector of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010"

Value

data frame, or list of data frames, with fields for ICD9 code, name and description, derived from datamart lookup table

Methods (by class)

  • list: explain all ICD-9 codes in a list of vectors

  • factor: explain factor of ICD-9 codes

  • character: explain character vector of ICD-9 codes

  • numeric: explain numeric vector of ICD-9 codes, with warning. In general, this is not allowed because of the possible ambiguity of numeric decimal codes, but for convenience, this is allowed in this case to avoid typing many quotes.

References

http://www.stata.com/help.cgi?icd9

See Also

package comorbidities

Examples

Run this code
# NOT RUN {
icd9ExplainShort(ahrqComorbid[[1]][1:3])
icd9Explain(ahrqComorbid[[1]][1:3], brief = TRUE)
# }

Run the code above in your browser using DataLab