Get identifiers of deduplicated trial records
Source:R/dbFindIdsUniqueTrials.R
dbFindIdsUniqueTrials.Rd
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"
)
#> RSQLite version has enabled accelerating docdb_create() and docdb_update() functions when used with value = <NDJSON file name>.
dbFindIdsUniqueTrials(con = dbc)
#> 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 ISRCTN ISRCTN EUCTR
#> "12949496" "13281214" "17473621" "2012-003632-23-SE"
#> EUCTR EUCTR CTIS CTIS
#> "2014-002606-20-PT" "2014-003556-31-SE" "2022-501142-30-00" "2023-505613-24-00"
#> CTIS ISRCTN ISRCTN ISRCTN
#> "2024-510663-34-00" "20343063" "61070850" "76463425"
#> ISRCTN ISRCTN CTGOV2 CTGOV2
#> "80181452" "88261002" "NCT00617929" "NCT01125800"
#> CTGOV2 CTGOV2 CTGOV2 CTGOV
#> "NCT01483820" "NCT01505608" "NCT01592045" "NCT02620761"
#> CTGOV CTGOV CTGOV CTGOV
#> "NCT03280147" "NCT03325439" "NCT03431558" "NCT03876704"
#> CTGOV CTGOV CTGOV
#> "NCT04001712" "NCT04041765" "NCT05969327"
#> attr(,"ctrdata-dbname")
#> [1] "/Users/ralfherold/Library/R/arm64/4.4/library/ctrdata/extdata/demo.sqlite"
#> attr(,"ctrdata-table")
#> [1] "my_trials"
#> attr(,"ctrdata-table-note")
#> [1] "^^^ attr ctrdata-table will be removed by end 2024"
#> attr(,"ctrdata-collection")
#> [1] "my_trials"
#> attr(,"ctrdata-dbqueryhistory")
#> query-timestamp query-register query-records
#> 1 2024-05-16 14:05:23 EUCTR 5
#> 2 2024-05-16 14:06:43 CTGOV 8
#> 3 2024-05-16 14:07:32 ISRCTN 8
#> 4 2024-05-16 14:07:57 CTGOV2 5
#> 5 2024-06-23 16:14:56 CTIS 3
#> 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 distance=50&cond=neuroblastoma&aggFilters=phase:2,results:with&primComp=2014-01-01_2014-12-31
#> 5 searchCriteria={"containAll":"infection","containAny":"neonates","containNot":""}