This function processes the character matrix of ICD9 codes by converting them to character codes of length 5. For SAS procedure from HCUP, it trims all character string to be of length 5, adds the missing trailing white space, and capitalizes the first character in ICD9 codes.
Usage
icd9Clean(input, style = c("touch", "hcup"))
Arguments
- input
a character matrix of ICD9 codes, with rows representing patients.
- style
a character vector of length one indicating the reformatting style to follow. The possible option are "touch" and "hcup". The former does the cleaning for this package; The latter does the reformatting for the SAS script provided by HCUP.
Examples
data(dxDat)
icd <- dxDat[, -1L]
output <- icd9Clean(icd)