rfhb / ctrdata

Aggregate and analyse information on clinical trials from public registers
https://rfhb.github.io/ctrdata/
Other
43 stars 6 forks source link

CTGOV changed website layout #23

Closed rfhb closed 1 year ago

rfhb commented 1 year ago

ClinicalTrials.Gov just made the previous beta website layout now the default layout. Links to the previous website start now with https://classic.clinicaltrials.gov/. Search parameters are different. ctrdata is being updated to handle the situation.

rfhb commented 1 year ago

Insert "classic." into search URLs, that is, change e.g.:

Then try the development version with these install steps; it should work with such URLs and with previously stored queries:

install.packages("devtools")

devtools::install_github("rfhb/ctrdata", build_vignettes = TRUE)

library(ctrdata)

q <- "https://classic.clinicaltrials.gov/ct2/results?cond=Neuroblastoma&term=&intr=Investigational+Agent"

dbc <- nodbi::src_sqlite(collection = "my_collection")

ctrLoadQueryIntoDb(q, con = dbc)

# * Found search query from CTGOV: cond=Neuroblastoma&intr=Investigational+Agent
# Checking helper binaries: . . . done
# (1/3) Checking trials in CTGOV:
# Retrieved overview, records of 272 trial(s) are to be downloaded (estimate: 2.2 MB)
# Download status: 1 done; 0 in progress. Total size: 1.85 Mb (100%)... done!             
# (2/3) Converting to JSON, 272 records converted
# (3/3) Importing JSON records into database...
# = Imported or updated 272 trial(s)                 
# No history found in expected format.
# Updated history ("meta-info" in "my_collection")
# $n
# [1] 272
# 
# $success
#  [1] "NCT00002825" "NCT00003119" "NCT00003191" "NCT00003234" "NCT00003425"
TWDGit commented 1 year ago

Confirmed. Tested 88 "results?spons=" queries and 23 "cond=xxxx&term=xxx" queries. Everything worked perfectly. Thanks for tackling this so quickly.

rfhb commented 1 year ago
TWDGit commented 1 year ago

Ralf. I got the error below when trying the new package today. I tried tracing the process through the ctrGetQueryUrl function but could not find an issue. I assume you are already on this, but FYI. Thanks, as always, for your work with this package. It is a HUGE help.

ScreenURL <- paste0("https://classic.clinicaltrials.gov/ct2/results?spons=%22",CoStr,"%22") ScreenURL [1] "https://classic.clinicaltrials.gov/ct2/results?spons=%22ACADIA+Pharmaceuticals%22" ResultsTable <- nodbi::src_sqlite(collection="Results")

Status <- try(ctrLoadQueryIntoDb(queryterm=ScreenURL, con=ResultsTable, verbose=FALSE)) Warning: ctrGetQueryUrl(): no clinical trial register search URL found in parameter 'url' or in clipboard. Error : 'queryterm' does not seem to result from ctrQueryHistoryInDb() or ctrGetQueryUrl(): NULL

rfhb commented 1 year ago

Thanks! Sorry, but I could not reproduce the error using the ScreenURL value that is above; here I found 42 records with this value using ctrLoadQueryIntoDb(ScreenURL, only.count = TRUE). Do these URLs have the search results you are interested in?

https://classic.clinicaltrials.gov/ct2/results?spons="ACADIA Pharmaceuticals"

https://classic.clinicaltrials.gov/ct2/results?spons=ACADIA+Pharmaceuticals

These work for me. For composing the string for parameter queryterm, no need to escape characters, it can be kept simple, e.g.

ScreenURL <- paste0('https://classic.clinicaltrials.gov/ct2/results?spons="', CoStr, '"')
TWDGit commented 1 year ago

Thanks for checking into this, Ralf. l must have messed up a dependency somewhere. I force reinstalled the package from GitHub and completely rebooted my machine. That cleared out everything. All good now. Thanks, again.

rfhb commented 1 year ago

Design considerations: create new ctrLoadQueryIntoDb() internal function for CTGOV API, using only JSON, based on experience with implementing this function for CTIS. Aspects for implementation:

Further questions:

rfhb commented 1 year ago

Check out the branch ctgov2023api for compatibility with CTGOV REST API 2.0.0-test and CTGOV Classic web interface. Install in R with

devtools::install_github(repo = "rfhb/ctrdata",  ref = "ctgov2023api", build_vignettes = TRUE)

Please report issues here.

rfhb commented 1 year ago

Completed with release https://github.com/rfhb/ctrdata/releases/tag/v1.15.0