data.frame
column which is most likely to contain
the ICD codesguess which field contains the (only) ICD code, in order of preference, the
column name has an icd code class, case-insensitive regexes of commonly used
names for ICD code fields, a single column has more than 10
If the result is not specified by class, or exactly with icd_name
being given, we confirm there are at least some valid ICD codes in there
get_icd_name(x, icd_name = NULL, valid_codes = TRUE,
defined_codes = FALSE)
data frame
usually NULL
but if specified, will be checked it is
valid (i.e. a character vector of length one, which is indeed a name of one
of x
's columns) and returned unchanged