Skip to contents

Trial concept calculated: Applies function dbFindIdsUniqueTrials() with its defaults.

Usage

f.isUniqueTrial(df = NULL)

Arguments

df

data frame such as from dbGetFieldsIntoDf. If `NULL`, prints fields needed in `df` for calculating this trial concept, which can be used with dbGetFieldsIntoDf.

Value

data frame with columns `_id` and `.isUniqueTrial`, a logical.

Examples

# fields needed
f.isUniqueTrial()
#> [1] "ctrname"

# apply trial concept when creating data frame
dbc <- nodbi::src_sqlite(
  dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"),
  collection = "my_trials", flags = RSQLite::SQLITE_RO)
trialsDf <- dbGetFieldsIntoDf(
  calculate = "f.isUniqueTrial",
  con = dbc)
#> Querying database (1 fields)...
#> Searching for duplicate trials... 
#> - Getting all trial identifiers...
#> , 31 found in collection
#> - Finding duplicates among registers' and sponsor ids...
#> - 2 EUCTR _id were not preferred EU Member State record for 9 trials
#> - Keeping 5 / 3 / 8 / 8 / 5 records from CTGOV2 / EUCTR / CTGOV / ISRCTN / CTIS
#> = Returning keys (_id) of 29 records in collection "my_trials"
trialsDf
#>                  _id .isUniqueTrial
#> 1           12949496           TRUE
#> 2           13281214           TRUE
#> 3           17473621           TRUE
#> 4  2012-003632-23-CZ           TRUE
#> 5  2012-003632-23-SE          FALSE
#> 6  2014-002606-20-PT           TRUE
#> 7  2014-003556-31-GB          FALSE
#> 8  2014-003556-31-SE           TRUE
#> 9  2022-500244-37-00           TRUE
#> 10 2022-501142-30-00           TRUE
#> 11 2023-505613-24-00           TRUE
#> 12 2023-508143-51-01           TRUE
#> 13 2024-510663-34-00           TRUE
#> 14          20343063           TRUE
#> 15          61070850           TRUE
#> 16          76463425           TRUE
#> 17          80181452           TRUE
#> 18          88261002           TRUE
#> 19       NCT00617929           TRUE
#> 20       NCT01125800           TRUE
#> 21       NCT01483820           TRUE
#> 22       NCT01505608           TRUE
#> 23       NCT01592045           TRUE
#> 24       NCT02620761           TRUE
#> 25       NCT03280147           TRUE
#> 26       NCT03325439           TRUE
#> 27       NCT03431558           TRUE
#> 28       NCT03876704           TRUE
#> 29       NCT04001712           TRUE
#> 30       NCT04041765           TRUE
#> 31       NCT05969327           TRUE