Learn R Programming

icd9 (version 0.5)

icd9CondenseToMajor: condense list of short ICD-9 code into minimal set of major-part-only codes

Description

This can be thought of as the inverse operation to icd9Children("123"). The list given must already contain the parents, because this function will never add a parent ICD-9 which, although may have all children present, may itself have an additional clinical meaning.

Usage

icd9CondenseToMajor(icd9Short, onlyReal, dropNonReal = TRUE,
  invalidAction = c("stop", "ignore", "silent", "warn"))

Arguments

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"
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, th
dropNonReal
single logical, if TRUE, and onlyReal is TRUE, then codes not found in the master list are dropped; otherwise they are included in the output.
invalidAction
character string (unit length) containing one of: "ignore", "silent", "warn", "stop"

- ignore no check for validity of ICD-9 code is made implicitly. This is the fastest option. If the function call is explicitly to check validity, e

See Also

Other ICD-9 ranges: %i9d%, icd9ExpandRangeDecimal; %i9mj%, icd9ExpandRangeMajor; %i9s%, icd9ExpandRangeShort; icd9ChildrenDecimal; icd9Children, icd9ChildrenShort; icd9CondenseToExplain; icd9ExpandMinor, icd9ExpandMinorE, icd9ExpandMinorNV; icd9PrecedingMinors, icd9SubsequentMinors