if (FALSE) {
a <- amber.login("https://amber-demo.obiba.org")
# Extract data from all interviews
amber.interview_export(a)
# Extract data from all completed interviews
amber.interview_export(a, completed = TRUE)
# Extract data from all interviews in a range of time
amber.interview_export(a, from = "2022-01-12 00:00", to = "2022-02-13")
# Extract data from all interviews for a specific participant/patient
# study identifier
amber.interview_export(a, identifier = "1231")
# Extract data from all interviews having their participant study
# identifier matching a regular expression
amber.interview_export(a, query = list(`identifier[$search]` = "^12"))
# Extract data from all interviews having their participant attributes
# matching a value
# (will not work if the data are encrypted in the database)
amber.interview_export(a, query = list(data.country = "fr"))
# Export records collected with a study's interview design
tables <- amber.interview_export(a,
study = "liftup",
interviewDesign = "treocapa_lt")
# Result contains both data and dictionary
tables
# Tables are named with the -- pattern
names(tables)
# Merge datasets from different versions if relevant
dplyr::bind_rows(lapply(tables, function (t) {
t$data
}))
amber.logout(a)
}
Run the code above in your browser using DataLab