Skip to contents

Extracts query parameters and register name from parameter `url` or from the clipboard, into which the URL of a register search was copied.

Usage

ctrGetQueryUrl(url = "", register = "")

Arguments

url

URL such as from the browser address bar. If not specified, clipboard contents will be checked for a suitable URL. For automatically copying the user's query of a register in a web browser to the clipboard, see here. Can also contain a query term such as from dbQueryHistory()["query-term"].

register

Optional name of register (one of "EUCTR", "CTGOV", "ISRCTN" or "CTIS") in case `url` is a query term

Value

A data frame (or tibble, if tibble is loaded) with column names `query-term` and `query-register`. The data frame (or tibble) can be passed as such as parameter `query-term` to ctrLoadQueryIntoDb and as parameter `url` to ctrOpenSearchPagesInBrowser.

Examples


# user copied into the clipboard the URL from
# the address bar of the browser that shows results
# from a query in one of the trial registers
try(ctrGetQueryUrl(), silent = TRUE)
#> * Using clipboard content as register query URL: https://www.clinicaltrials.gov/search?distance=50&cond=neuroblastoma&aggFilters=phase:2,results:with&primComp=2014-01-01_2014-12-31
#> * Appears specific for CTGOV REST API 2.0
#> * Found search query from CTGOV2: distance=50&cond=neuroblastoma&aggFilters=phase:2,results:with&primComp=2014-01-01_2014-12-31
#>                                                                                      query-term
#> 1 distance=50&cond=neuroblastoma&aggFilters=phase:2,results:with&primComp=2014-01-01_2014-12-31
#>   query-register
#> 1         CTGOV2

# extract query parameters from search result URL
# (URL was cut for the purpose of formatting only)
ctrGetQueryUrl(
    url = paste0(
        "https://classic.clinicaltrials.gov/ct2/results?",
        "cond=&term=AREA%5BMaximumAge%5D+RANGE%5B0+days%2C+28+days%5D",
        "&type=Intr&rslt=&age_v=&gndr=&intr=Drugs%2C+Investigational",
        "&titles=&outc=&spons=&lead=&id=&cntry=&state=&city=&dist=",
        "&locn=&phase=2&rsub=&strd_s=01%2F01%2F2015&strd_e=01%2F01%2F2016",
        "&prcd_s=&prcd_e=&sfpd_s=&sfpd_e=&rfpd_s=&rfpd_e=&lupd_s=&lupd_e=&sort="
    )
)
#> * Appears specific for CTGOV Classic website
#> * Found search query from CTGOV: term=AREA[MaximumAge]+RANGE[0+days,+28+days]&type=Intr&intr=Drugs,+Investigational&phase=2&strd_s=01/01/2015&strd_e=01/01/2016
#>                                                                                                                       query-term
#> 1 term=AREA[MaximumAge]+RANGE[0+days,+28+days]&type=Intr&intr=Drugs,+Investigational&phase=2&strd_s=01/01/2015&strd_e=01/01/2016
#>   query-register
#> 1          CTGOV

ctrGetQueryUrl("https://www.clinicaltrialsregister.eu/ctr-search/trial/2007-000371-42/results")
#> * Found search query from EUCTR: query=2007-000371-42
#>             query-term query-register
#> 1 query=2007-000371-42          EUCTR
ctrGetQueryUrl("https://euclinicaltrials.eu/app/#/view/2022-500041-24-00")
#> * Found search query from CTIS: number=2022-500041-24-00
#>                 query-term query-register
#> 1 number=2022-500041-24-00           CTIS
ctrGetQueryUrl("https://euclinicaltrials.eu/app/#/search?sponsorTypeCode=1")
#> * Found search query from CTIS: sponsorTypeCode=1
#>          query-term query-register
#> 1 sponsorTypeCode=1           CTIS
ctrGetQueryUrl("https://classic.clinicaltrials.gov/ct2/show/NCT01492673?cond=neuroblastoma")
#> * Appears specific for CTGOV Classic website
#> * Note: 'url' shows a single trial (and is returned by the function) but also had search parameters: If interested in search results, click 'Return to List' in browser and use this as 'url'.
#> * Found search query from CTGOV: term=NCT01492673
#>         query-term query-register
#> 1 term=NCT01492673          CTGOV
ctrGetQueryUrl("https://clinicaltrials.gov/ct2/show/NCT01492673?cond=neuroblastoma")
#> * Appears specific for CTGOV Classic website
#> * Note: 'url' shows a single trial (and is returned by the function) but also had search parameters: If interested in search results, click 'Return to List' in browser and use this as 'url'.
#> * Found search query from CTGOV: term=NCT01492673
#>         query-term query-register
#> 1 term=NCT01492673          CTGOV
ctrGetQueryUrl("https://www.clinicaltrials.gov/study/NCT01467986?aggFilters=ages:child")
#> * Appears specific for CTGOV REST API 2.0
#> * Note: 'url' shows a single trial (and is returned by the function) but also had search parameters: If interested in search results, click on 'Search Results' in browser and use this as 'url'.
#> * Found search query from CTGOV2: id=NCT01467986
#>       query-term query-register
#> 1 id=NCT01467986         CTGOV2
ctrGetQueryUrl("https://www.isrctn.com/ISRCTN70039829")
#> * Found search query from ISRCTN: q=ISRCTN70039829
#>         query-term query-register
#> 1 q=ISRCTN70039829         ISRCTN