## Not run:
# # Output from a single table
# where_q <- "crd < STARTDATE & (is.null(tod) | tod > ENDDATE) & accept == 1"
# ayears <- select_by_year(db, "Patient", columns = c("patid", "yob", "tod"),
# where = where_q, year_range = 2000:2003)
# # Output from multiple tables
# load("data/medical.RData")
# a <- read.csv("data/chronic-renal-disease.csv")
# a <- read_to_medcodes(a, medical, "code", lookup_readcodes= "readcode",
# lookup_medcodes="medcode", description = T)
# where_q <- "eventdate >= STARTDATE & eventdate <= ENDDATE & medcode %in% .(a$medcode)"
# byears <- byears <- select_by_year("~/rOpenHealth/CPRD_test/Coupland/Coupland",
# c("Clinical", "Referral"),
# columns = c("patid", "eventdate", "medcode"),
# where = where_q, year_range = 2000:2003, as_list = FALSE,
# cores = 10)
# ## End(Not run)
Run the code above in your browser using DataLab