if (FALSE) {
a <- amber.login("https://amber-demo.obiba.org")
# Find all case reports
amber.case_reports(a)
# Find all case reports in a range of time
amber.case_reports(a, from = "2022-01-12 00:00", to = "2022-02-13")
# Find all case reports for a specific participant/patient identifier
amber.case_reports(a, pId = "1231")
# Find all case reports having their identifier matching a regular expression
amber.case_reports(a, query = list(`data._id[$search]` = "^12"))
# Find all case reports which form data is equal to some value
# (will not work if the data are encrypted in the database)
amber.case_reports(a, query = list(data.PATIENT.ORIGIN_REGION = "xyz"))
# Export records collected with a study's form in a specific version
amber.case_reports(a,
study = "Trauma Registry",
form = "Adult trauma",
query = list(revision = 6))
# Export records collected with a specific case report form
amber.case_reports(a, caseReportForm = "Adult trauma - test")
# Export records collected with a study's form in all versions used
amber.case_reports(a,
study = "Trauma Registry",
form = "Adult trauma")
amber.logout(a)
}
Run the code above in your browser using DataLab