ctrLoadQueryIntoDb {ctrdata} | R Documentation |
Load and store register trial information
Description
Retrieves information on clinical trials from registers and stores it in a collection in a database. Main function of ctrdata for accessing registers. A collection can store trial information from different queries or different registers. Query details are stored in the collection and can be accessed using dbQueryHistory. A previous query can be re-run, which replaces or adds trial records while keeping any user annotations of trial records.
Usage
ctrLoadQueryIntoDb(
queryterm = NULL,
register = "",
querytoupdate = NULL,
forcetoupdate = FALSE,
euctrresults = FALSE,
euctrresultshistory = FALSE,
ctgov2history = FALSE,
documents.path = NULL,
documents.regexp = "prot|sample|statist|sap_|p1ar|p2ars|icf|ctalett|lay|^[0-9]+ ",
annotation.text = "",
annotation.mode = "append",
only.count = FALSE,
con = NULL,
verbose = FALSE,
...
)
Arguments
queryterm |
Either a string with the full URL of a search
query in a register, or the data frame returned by the
ctrGetQueryUrl or the
dbQueryHistory functions, or, together with parameter
|
register |
String with abbreviation of register to query,
either "EUCTR", "CTGOV2", "ISRCTN" or "CTIS". Not needed
if |
querytoupdate |
Either the word "last", or the row number of
a query in the data frame returned by dbQueryHistory that
should be run to retrieve any new or update trial records since
this query was run the last time.
This parameter takes precedence over |
forcetoupdate |
If |
euctrresults |
If |
euctrresultshistory |
If |
ctgov2history |
For trials from CTGOV2, retrieve historic
versions of the record. Default is |
documents.path |
If this is a relative or absolute
path to a directory that exists or can be created,
save any documents into it that are directly available from
the register ("EUCTR", "CTGOV2", "ISRCTN", "CTIS")
such as PDFs on results, analysis plans, spreadsheets,
patient information sheets, assessments or product information.
Default is |
documents.regexp |
Regular expression, case insensitive,
to select documents, if saving documents is requested
(see |
annotation.text |
Text to be including into the field
"annotation" in the records retrieved with the query
that is to be loaded into the collection.
The contents of the field "annotation" for a trial record
are preserved e.g. when running this function again and
loading a record of a with an annotation, see parameter
|
annotation.mode |
One of "append" (default), "prepend" or "replace" for new annotation.text with respect to any existing annotation for the records retrieved with the query that is to be loaded into the collection. |
only.count |
Set to |
con |
A connection object, see section 'Databases' in ctrdata. |
verbose |
Printing additional information if set to
|
... |
Do not use (capture deprecated parameters). |
Value
A list with elements 'n' (number of trial records newly imported or updated), ‘success' (a vector of _id’s of successfully loaded records), 'failed' (a vector of identifiers of records that failed to load) and 'queryterm' (the query term used). The returned list has several attributes (including database and collection name, as well as the query history of this database collection) to facilitate documentation.
Examples
## Not run:
dbc <- nodbi::src_sqlite(collection = "my_collection")
# Retrieve protocol- and results-related information
# on two specific trials identified by their EU number
ctrLoadQueryIntoDb(
queryterm = "2005-001267-63+OR+2008-003606-33",
register = "EUCTR",
euctrresults = TRUE,
con = dbc
)
# Count ongoing interventional cancer trials involving children
# Note this query is a classical CTGOV query and is translated
# to a corresponding query for the current CTGOV2 webinterface
ctrLoadQueryIntoDb(
queryterm = "cond=cancer&recr=Open&type=Intr&age=0",
register = "CTGOV",
only.count = TRUE,
con = dbc
)
# Retrieve all information on more than 40 trials
# that are labelled as phase 3 and that mention
# either neuroblastoma or lymphoma from ISRCTN,
# into the same collection as used before
ctrLoadQueryIntoDb(
queryterm = paste0(
"https://www.isrctn.com/search?",
"q=neuroblastoma+OR+lymphoma&filters=phase%3APhase+III"),
con = dbc
)
# Retrieve information trials in CTIS mentioning neonates
ctrLoadQueryIntoDb(
queryterm = paste0("https://euclinicaltrials.eu/ctis-public/",
"search#searchCriteria={%22containAll%22:%22%22,",
"%22containAny%22:%22neonates%22,%22containNot%22:%22%22}"),
con = dbc
)
## End(Not run)