amber.case_reports {amberr} | R Documentation |
Get the case report records
Description
Get the case report records of one or several form(s).
Usage
amber.case_reports(
amber,
study = NULL,
form = NULL,
caseReportForm = NULL,
from = NULL,
to = NULL,
pId = NULL,
query = list(),
skip = 0,
limit = 100,
df = TRUE
)
Arguments
amber |
An Amber object |
study |
Study identifier (name or id), optional. |
form |
Form identifier (name or id), optional. |
caseReportForm |
Case report form identifier (name or id), optional. |
from |
From date (included), optional |
to |
To date (included), optional |
pId |
Patient/participant identifier |
query |
The search query |
skip |
Number of items to skip |
limit |
Max number of items |
df |
Return a data.frame (default is TRUE) |
Value
A data.frame (or a named list of raw results when 'df' is FALSE)
See Also
Other studies functions:
amber.campaign()
,
amber.campaigns()
,
amber.case_report_export()
,
amber.case_report_form()
,
amber.case_report_forms()
,
amber.form()
,
amber.form_revision()
,
amber.form_revisions()
,
amber.forms()
,
amber.interview_design()
,
amber.interview_designs()
,
amber.interview_export()
,
amber.interviews()
,
amber.participant()
,
amber.participants()
,
amber.studies()
,
amber.study()
Examples
## Not run:
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)
## End(Not run)