Learn R Programming

icd9 (version 1.1)

icd9Children: Expand ICD-9 codes to all possible sub-codes

Description

Expand ICD-9 codes to all possible sub-codes

Usage

icd9Children(icd9, isShort = icd9GuessIsShort(icd9), onlyReal = TRUE)

icd9ChildrenShort(icd9Short, onlyReal = TRUE)

icd9ChildrenDecimal(icd9Decimal, onlyReal = 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.

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.

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"

See Also

Other ICD-9 ranges: %i9d%, %i9da%, %i9mj%, %i9s%, %i9sa%, icd9ExpandRange, icd9ExpandRangeDecimal, icd9ExpandRangeMajor, icd9ExpandRangeShort; icd9Condense, icd9CondenseDecimal, icd9CondenseShort, icd9CondenseToMajor, icd9CondenseToMajorDecimal, icd9CondenseToMajorShort; icd9ExpandMinor

Examples

Run this code
# NOT RUN {
library(magrittr)
icd9ChildrenShort("10201", FALSE) # no children other than self
icd9Children("0032", FALSE) # guess it was a short, not decimal code
icd9ChildrenShort("10201", TRUE) # empty because 102.01 is not meaningful
icd9ChildrenShort("003", TRUE) %>% icd9ExplainShort(doCondense = FALSE)
icd9ChildrenDecimal("100.0")
icd9ChildrenDecimal("100.00")
icd9ChildrenDecimal("2.34")
# }

Run the code above in your browser using DataLab