if (FALSE) {
#Define medication group and add an indicator column whether
#the given medication group was administered
meds <- list(statin = c("Simvastatin", "Atorvastatin"),
NSAID = c("Acetaminophen", "Paracetamol"))
data_med_indic <- convert_med(d = data_med, codes_to_find = meds, nThread = 1)
#Summarize per patient if they ever had the given medication groups registered
data_med_indic_any <- convert_med(d = data_med,
codes_to_find = meds, collapse = "ID_MERGE", nThread = 2)
}
Run the code above in your browser using DataLab