Learn R Programming

icd (version 3.3)

expand_minor: expand decimal part of ICD-9 code to cover all possible sub-codes

Description

Accepts a single number or character input starting point for generation of all possible decimal parts of ICD9 code. e.g. giving an empty input will fill out 111 combinations, e..g .1 .11 .12 .... .2 ....

Usage

expand_minor(mnr, ...)

# S3 method for icd9 expand_minor(mnr, is_e = FALSE)

# S3 method for icd10 expand_minor(x)

Arguments

minor

character vector of 'minor' part of ICD-9 codes, i.e. that part which falls after the decimal point, in decimal notation. (In 'short' five digit notation, the 'major' part is the first three characters including leading zeroes which may be inferred; the last two characters represent the 'minor' part.)

isE

single logical, which if TRUE, treats the minor as part of an E code (which is one character), as opposed to a V or numeric-only code, which is two character. Default is FALSE.

Value

NA for invalid minor, otherwise a vector of all possible (perhaps non-existent) sub-divisions.

Methods (by class)

  • icd9: expand minor parts of ICD-9 codes

  • icd10: expand minor parts of ICD-10 codes. Not implemented, no obvious need, and ICD-10 children can be very complex.

See Also

Other ICD-9 ranges: children, condense, expand_range

Examples

Run this code
# NOT RUN {
  # return all possible decimal parts of ICD9 codes (111 in total)
  length(icd:::expand_minor(as.icd9(""), is_e = FALSE))
  icd:::expand_minor(as.icd9("1")) # "1"  "10" "11" "12" "13" "14" "15" "16" "17" "18" "19"
# }

Run the code above in your browser using DataLab