Pad ICD-9 codes that do not have a sub-code (i.e., 3-character codes)
Source:R/pad_3char_codes.R
pad_3char_codes.RdSome of the ICD-9 codes only contain 3 characters (i.e., they do not contain subcodes). This function just takes the UCOD column and converts all of these 3 character codes into 4 by padding a zero at the end.
Examples
pad_3char_codes(c("400", "4043", "304", "5062"))
#> [1] "4000" "4043" "3040" "5062"