Learn R Programming

icd9 (version 0.5)

icd9PartsRecompose: recompose major and minor parts into icd9 codes

Description

internal function which checks vector lengths to avoid unintentional recycling of vectors when lengths differ. Length of one is fine for major or minor.

icd9MajMinToDf simply composes the data frame needed as input to the PartsToXxxx functions

icd9MajMinTo{Short|Decimal} simply composes the data frame needed as input to the PartsToXxxx functions. Having two inputs breaks the ability to 'pipe' commands together using magrittr, so passing a single data.frame is preferred.

Usage

icd9PartsRecompose(parts, isShort, invalidAction = icd9InvalidActions)

icd9PartsToShort(parts, invalidAction = icd9InvalidActions)

icd9PartsToDecimal(parts, invalidAction = icd9InvalidActions)

icd9MajMinToParts(major, minor)

icd9MajMinToShort(major, minor, invalidAction = icd9InvalidActions)

icd9MajMinToDecimal(major, minor, invalidAction = icd9InvalidActions)

Arguments

parts
data.frame with major and minor fields. This can be given instead of major and minor vectors
isShort
single logical value which determines whether the ICD-9 code provided is in short (TRUE) or decimal (FALSE) form.
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

Value

  • character vector. Deliberately returns zero-padded major, because otherwise we are creating ambiguous codes (even if we know what we mean)

See Also

Other ICD-9 convert: icd9DecimalToShort; icd9DropLeadingZeroes, icd9DropLeadingZeroesDecimal, icd9DropLeadingZeroesMajor, icd9DropLeadingZeroesShort; icd9ShortToDecimal