Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTGOV changed website layout #23

Closed
rfhb opened this issue Jun 23, 2023 · 9 comments
Closed

CTGOV changed website layout #23

rfhb opened this issue Jun 23, 2023 · 9 comments

Comments

@rfhb
Copy link
Owner

rfhb commented Jun 23, 2023

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
Copy link
Owner Author

rfhb commented Jun 23, 2023

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
Copy link

TWDGit commented Jun 23, 2023

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

@rfhb rfhb self-assigned this Jun 24, 2023
@rfhb
Copy link
Owner Author

rfhb commented Jun 24, 2023

@TWDGit
Copy link

TWDGit commented Jun 27, 2023

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
Copy link
Owner Author

rfhb commented Jun 27, 2023

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
Copy link

TWDGit commented Jun 27, 2023

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
Copy link
Owner Author

rfhb commented Aug 4, 2023

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:

  • Mapping of classic and new fields, for CTGOV or across registers, at least at top levels, targeting FHIR? (Consider recently refactored dfMergeVariables(), automated schema extraction, search for relevant mapping tools, review e.g. https://json-ld.org/ with https://www.w3.org/TR/json-ld-framing/, https://github.com/dvdln/jsonpath-object-transform)
  • Introduce an dbUpdate() function that iterates for identifiers and registers?
  • How to hand data for a trial having been loaded from both classic and new CTGOV?
  • Can ctrLoadQueryIntoDb() for EUCTR and ISRCTN also be changed to JSON?
  • Create roadmap in GitHub?

@rfhb
Copy link
Owner Author

rfhb commented Aug 5, 2023

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
Copy link
Owner Author

rfhb commented Aug 28, 2023

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

@rfhb rfhb closed this as completed Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants