Skip to contents

Records for a clinical trial can be loaded from more than one register into a collection. This function returns deduplicated identifiers for all trials in the collection, respecting the register(s) preferred by the user. All registers are recording identifiers also from other registers, which are used by this function to provide a vector of identifiers of deduplicated trials.

Usage

dbFindIdsUniqueTrials(
  preferregister = c("EUCTR", "CTGOV", "CTGOV2", "ISRCTN", "CTIS"),
  prefermemberstate = "DE",
  include3rdcountrytrials = TRUE,
  con,
  verbose = FALSE
)

Arguments

preferregister

A vector of the order of preference for registers from which to generate unique _id's, default c("EUCTR", "CTGOV", "CTGOV2", "ISRCTN", "CTIS")

prefermemberstate

Code of single EU Member State for which records should returned. If not available, a record for DE or lacking this, any random Member State's record for the trial will be returned. For a list of codes of EU Member States, please see vector countriesEUCTR. Specifying "3RD" will return the Third Country record of trials, where available.

include3rdcountrytrials

A logical value if trials should be retained that are conducted exclusively in third countries, that is, outside the European Union. Ignored if prefermemberstate is set to "3RD".

con

A connection object, see section `Databases` in ctrdata.

verbose

If TRUE, prints out the fields of registers used to find corresponding trial records

Value

A named vector with strings of keys (field "_id") of records in the collection that represent unique trials, where names correspond to the register of the record.

Details

Note that the content of records may differ between registers (and, for "EUCTR", between records for different Member States). Such differences are not considered by this function.

Examples


dbc <- nodbi::src_sqlite(
    dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"),
    collection = "my_trials"
)

dbFindIdsUniqueTrials(con = dbc)
#> Searching for duplicate trials... 
#>  - Getting all trial identifiers...
#>  (may take some time)...
#> , 36 found in collection
#>  - Finding duplicates among registers' and sponsor ids...
#>  - 10 EUCTR _id were not preferred EU Member State record for 9 trials
#>  - Keeping 2 / 8 / 5 / 8 / 3 records from EUCTR / CTGOV / CTGOV2 / ISRCTN / CTIS
#> = Returning keys (_id) of 26 records in collection "my_trials"
#>              ISRCTN              ISRCTN              ISRCTN               EUCTR 
#>          "12949496"          "13281214"          "17473621" "2012-003632-23-DE" 
#>               EUCTR                CTIS                CTIS                CTIS 
#> "2014-003556-31-SE" "2022-500676-59-00" "2022-501180-40-00" "2022-502516-37-00" 
#>              ISRCTN              ISRCTN              ISRCTN              ISRCTN 
#>          "20343063"          "61070850"          "76463425"          "80181452" 
#>              ISRCTN              CTGOV2              CTGOV2              CTGOV2 
#>          "88261002"       "NCT00617929"       "NCT01125800"       "NCT01483820" 
#>              CTGOV2              CTGOV2               CTGOV               CTGOV 
#>       "NCT01505608"       "NCT01592045"       "NCT02620761"       "NCT03280147" 
#>               CTGOV               CTGOV               CTGOV               CTGOV 
#>       "NCT03325439"       "NCT03431558"       "NCT03876704"       "NCT04001712" 
#>               CTGOV               CTGOV 
#>       "NCT04041765"       "NCT05969327" 
#> attr(,"ctrdata-dbname")
#> [1] "/Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/library/ctrdata/extdata/demo.sqlite"
#> attr(,"ctrdata-table")
#> [1] "my_trials"
#> attr(,"ctrdata-dbqueryhistory")
#>       query-timestamp query-register query-records
#> 1 2023-12-03 11:35:44          EUCTR            12
#> 2 2023-12-03 11:35:58          CTGOV             8
#> 3 2023-12-03 11:36:02         ISRCTN             8
#> 4 2023-12-03 11:36:11           CTIS             3
#> 5 2023-12-03 11:36:16         CTGOV2             5
#>                                                                                                                       query-term
#> 1                                    query=&age=newborn&phase=phase-three&dateFrom=2015-02-28&dateTo=2015-03-31&status=completed
#> 2 term=AREA[MaximumAge]+RANGE[0+days,+28+days]&intr=Drugs,+Investigational&strd_s=01/01/2018&strd_e=01/01/2020&type=Intr&phase=2
#> 3                                                                                    q=&filters=ageRange:Neonate,phase:Phase+III
#> 4                               basicSearchInputAND=cancer&status=Ongoing, recruiting&ageGroupCode=2&haveOrphanDesignation=false
#> 5                                  distance=50&cond=neuroblastoma&aggFilters=phase:2,results:with&primComp=2014-01-01_2014-12-31