Learn R Programming

icd9 (version 0.2.1)

stopIfInvalidIcd9: warn or stop with invalid ICD-9 codes

Description

In the case of warning, execution continues, and the logical vector containing the *invalid* codes is returned invisibly. Returning the invalids for consistency with the name of the function. The warn version of this function only uses one call to check validity, making execution as fast as possible.

Usage

stopIfInvalidIcd9(icd9, short, callingFunction = "")

warnIfInvalidIcd9(icd9, short, callingFunction = "")

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"
short
single logical value which determines whether the ICD-9 code provided is in short (TRUE) or decimal (FALSE) form.
callingFunction
not implemented: ideally look at call stack and indicate who called here.

See Also

Other ICD9 validation: icd9GetInvalidMappingDecimal, icd9GetInvalidMappingShort, icd9ValidMapping, icd9ValidMappingDecimal, icd9ValidMappingShort; icd9ValidDecimal, icd9ValidDecimalE, icd9ValidDecimalE, icd9ValidDecimalN, icd9ValidDecimalN, icd9ValidDecimalV, icd9ValidDecimalV; icd9ValidMajor; icd9ValidNaWarnStop, icd9ValidNaWarnStopDecimal, icd9ValidNaWarnStopShort; icd9ValidShort, icd9ValidShortE, icd9ValidShortE, icd9ValidShortN, icd9ValidShortN, icd9ValidShortV, icd9ValidShortV; icd9Valid