Make regural expression classifications from LIKE% classifications

make_regex(.data, classname, diagnosis, diagnosis.rm, sep = ", ")

Arguments

.data

holds the data which has variable names given as 'classname' and 'diagnosis'. Must be convertible to a tibble.

classname

name of the variable containing names/labels for the classes

diagnosis

name of the variable containing strings in LIKE% -format

diagnosis.rm

name of the variable defining exceptions of ICD-codes not to be included in the class

sep

separator of different diagnoses in 'diagnosis'. String.

Value

returns a tibble with regular expression definitions

See also

Examples

if (FALSE) { # We load classification here excelfile <- readxl::read_excel("./datas/disease_classification.xlsx") cl9 <- excelfile %>% make_regex(classname=Lyhenne,diagnosis=sairdiag_icd9,diagnosis.rm=sairdiagpl_icd9) %>% mutate(icd="icd9") cl10 <- excelfile %>% make_regex(classname=Lyhenne,diagnosis=sairdiag,diagnosis.rm=sairdiagpl) %>% mutate(icd="icd10") sel_classes<-bind_rows(cl9,cl10) %>% mutate(classification="own_definition") }