Learn R Programming

icd9 (version 0.3)

icd9AddLeadingZeroes: pad decimal ICD-9 codes with leading zeroes

Description

pad decimal ICD-9 codes with leading zeroes

Non-decimal ICD-9 codes with length<5 100="" are="" often="" ambiguous.="" e.g.="" could="" be="" 1.00="" 10.0="" or="" 100<="" p="">

three digit codes are returned unchanged, one and two digit codes are preceded by 00 or 0. V codes are only zero padded if addZeroV is set to TRUE.

Usage

icd9AddLeadingZeroes(icd9, isShort, addZeroV = FALSE,
  invalidAction = icd9InvalidActions)

icd9AddLeadingZeroesDecimal(icd9Decimal, addZeroV = FALSE, invalidAction = icd9InvalidActions)

icd9AddLeadingZeroesShort(icd9Short, addZeroV = FALSE, invalidAction = icd9InvalidActions)

icd9AddLeadingZeroesMajor(major, addZeroV = FALSE, invalidAction = icd9InvalidActions)

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.
addZeroV
single logical whether to add zeros to V codes, default being not to do so. E codes are always E800-E999 (if valid) so no attempt is ever made to zero-pad them as it would just make invalid codes even worse.
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

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"

Value

  • character vector of icd9 codes