Skip to contents

If used interactively, the function shows a widget of all data in the trial as a tree of field names and values. The widget opens in the default browser. Fields names and values can be search and selected. Selected fields can be copied to the clipboard for use with function dbGetFieldsIntoDf. The trial is retrieved with ctrLoadQueryIntoDb if no database con is provided or if the trial is not in database con.

Usage

ctrShowOneTrial(identifier = NULL, con = NULL)

Arguments

identifier

A trial identifier string

con

A database connection object, created with nodbi. See section `1 - Database connection` in ctrdata.

Value

Invisibly, the trial data for constructing an HTML widget.

Details

This is the widget for CTIS trial 2022-501142-30-00:

Examples


dbc <- nodbi::src_sqlite(
   dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"),
   collection = "my_trials",
   RSQLite::SQLITE_RO)
#> RSQLite version has enabled accelerating docdb_create() and docdb_update() functions when used with value = <NDJSON file name>.

# all such identifiers work
id <- "2014-003556-31"
id <- "2014-003556-31-SE"
id <- "76463425"
id <- "ISRCTN76463425"
id <- "NCT03431558"
id <- "2022-501142-30-00"

# the id also works with
# ctrGetQueryUrl(url = id) and
# ctrLoadQueryIntoDb(queryterm = id, ...)

# show widget for user to explore and search content as well as to
# select fields of interest and to click on "Copy names of selected
# fields to clipboard..." to use them with dbGetFieldsIntoDf()
ctrShowOneTrial(identifier = id, con = dbc)
#> Error in utils::browseURL(tf): 'browser' must be a non-empty character string

# get sample of identifiers of trials in database
sample(dbFindIdsUniqueTrials(con = dbc), 5L)
#> Searching for duplicate trials... 
#> - Getting all trial identifiers...
#>  (may take some time)...
#> , 29 found in collection
#> - Finding duplicates among registers' and sponsor ids...
#> - 2 EUCTR _id were not preferred EU Member State record for 8 trials
#> - Keeping 3 / 8 / 5 / 8 / 3 records from EUCTR / CTGOV / CTGOV2 / ISRCTN / CTIS
#> = Returning keys (_id) of 27 records in collection "my_trials"
#>              ISRCTN               CTGOV              ISRCTN               EUCTR 
#>          "80181452"       "NCT03431558"          "76463425" "2014-002606-20-PT" 
#>               EUCTR 
#> "2014-003556-31-SE"