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. Can also contain a query term such as from dbQueryHistory()["query-term"]

register

Optional name of register (i.e., "EUCTR" or "CTGOV") in case url is a query term

Value

A data frame (or tibble, if dplyr 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)

# extract query parameters from search result URL
# (URL was cut for the purpose of formatting only)
ctrGetQueryUrl(
  url = paste0("https://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="))
#> * 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