Learn R Programming

icd9 (version 0.3)

icd9ValidNaWarnStop: stop, warn, replace invalid with NA or continue

Description

Switch based on invalidAction If major is provided, then isShort is ignored.

Usage

icd9ValidNaWarnStop(icd9, isShort, isMajor = FALSE,
  invalidAction = icd9InvalidActions)

icd9ValidNaWarnStopShort(icd9Short, invalidAction)

icd9ValidNaWarnStopDecimal(icd9Decimal, invalidAction)

icd9ValidNaWarnStopMajor(major, invalidAction)

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"
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

major
character vector of 'major' part of ICD-9 codes, i.e. that part which falls before the decimal point, in decimal notation. (In 5 digit notation, the 'major' part is be the first three characters (with leading zeroes), and includes V or E prefix. xyz
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"

Value

  • icd9 codes, with invalid codes replaced by NA, if invalidAction != "ignore"

See Also

Other ICD9 validation: icd9GetInvalidMappingDecimal, icd9GetInvalidMappingShort, icd9ValidMapping, icd9ValidMappingDecimal, icd9ValidMappingShort; icd9ValidDecimal, icd9ValidDecimalE, icd9ValidDecimalN, icd9ValidDecimalV; icd9ValidMajor, icd9ValidMajorE, icd9ValidMajorN, icd9ValidMajorV; icd9ValidShort, icd9ValidShortE, icd9ValidShortN, icd9ValidShortV; icd9Valid; stopIfInvalidIcd9, warnIfInvalidIcd9