Filters a data.frame of patients for valid or invalid ICD-9 codes
icd9FilterValid(icd9df, icd9Field = NULL, isShort = NULL, invert = FALSE)
data frame containing columns for visitId (which is the feault name), icd9 (default for the icd9 code), and maybe also a POA flag.
The column in the data frame which contains the ICD codes.
This is a character vector of length one. If it is NULL
, icd9
will attempt to guess the column name, looking for progressively less
likely possibilities until it matche a single column. Failing this, it will
take the first column in the data frame. Specifying the column using this
argument avoids the guesswork.
single logical value which determines whether the ICD-9 code provided is in short (TRUE) or decimal (FALSE) form. Where reasonable, this is guessed from the input data.
single logical value, if TRUE will return invalid instead of valid rows.