Learn R Programming

icd9 (version 1.0)

icd9Condense: Condense ICD-9 code by replacing complete families with parent codes

Description

This can be thought of as the inverse operation to icd9Children.

Usage

icd9Condense(icd9, isShort, onlyReal = NULL, toMajor = TRUE)

icd9CondenseToMajor(icd9, isShort = icd9GuessIsShort(icd9), onlyReal = NULL)

icd9CondenseToMajorDecimal(icd9Decimal, onlyReal = NULL)

icd9CondenseToMajorShort(icd9Short, onlyReal = NULL)

icd9CondenseShort(icd9Short, onlyReal = NULL, toMajor = TRUE)

icd9CondenseDecimal(icd9Decimal, onlyReal = NULL, toMajor = TRUE)

Arguments

icd9

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"

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.

onlyReal

single logical value, if TRUE, will limit the search to those codes which appear in the master list, not just syntactically valid codes. Since nearly valid, out-dated or new codes may be missed, not limiting to 'real' values will be useful. Ultimately, there will need to be annual (and all-time) master lists of codes and the ability to test against a given master list given the year of the ICD-9 coding.

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.

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"

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"

Details

icd9CondenseToMajor family of functions are required, at least in this release because of issue #37 in github. This function just gets majors, unlike icd9CondenseShort.

See Also

Other ICD-9 ranges: %i9d%, %i9da%, %i9mj%, %i9s%, %i9sa%, icd9ExpandRange, icd9ExpandRangeDecimal, icd9ExpandRangeMajor, icd9ExpandRangeShort; icd9Children, icd9Children, icd9ChildrenDecimal, icd9ChildrenShort; icd9ExpandMinor