ohdsi-studies / PioneerWatchfulWaiting

This study is part of the joint PIONEER - EHDEN - OHDSI studyathon in March 2021, and aims to advance understanding of clinical management and outcomes of watchful waiting in prostate cancer.
Apache License 2.0
7 stars 18 forks source link

Error in runStudy step #20

Closed rfherrerac closed 3 years ago

rfherrerac commented 3 years ago

after runStep, I got this error : Error: Error executing SQL: java.sql.SQLException: Amazon Invalid operation: syntax error at or near ")" Position: 593; attached the error report.

errorReportSql.txt

YorgosA commented 3 years ago

Hi Ronald,

The query is expecting a number of cohort ids but there is none. Check line 20 in the errorReportSql.txt ( _AND o.cohort_definitionid IN () )

keesvanbochove commented 3 years ago

Right exactly @YorgosA. Just stepping through, this is caused by this line: https://github.com/ohdsi-studies/PioneerWatchfulWaiting/blob/862b0dbc03c85aebee3ce023f929943fa6dd19c0/R/RunStudy.R#L189 Which if you isolate and run it, creates an empty list.

>   combinedOutcomeIds <- allStudyCohorts[allStudyCohorts$name %in% c('Death', 'Symptoms'), 'cohortId'][[1]]
> combinedOutcomeIds
numeric(0)

Which is caused in turn by getAllStudyCohorts returning a table that contains ids instead of names in the ids column.

> getAllStudyCohorts()
# A tibble: 1,614 x 2
   name  cohortId
   <chr>    <dbl>
 1 101        101
 2 103        103
 3 111        111
 4 117        117
 5 105        105
 6 107        107
 7 109        109
 8 113        113
 9 115        115
10 102        102
# ... with 1,604 more rows
keesvanbochove commented 3 years ago

We can fix this by restoring the names in the 'name' columns in inst/settings/CohortsToCreate...csv, but it does beg the question which of the outcomes cohorts should be included in the combined survival analysis. Still only Death and Symptomatic progression? (see https://github.com/ohdsi-studies/PioneerWatchfulWaiting/blob/master/inst/settings/CohortsToCreateOutcome.csv) @MaximMoinat would it be possible to re-insert names in the names column, or was there another reason why the autogenerated cohort files now contain identifiers there?

MaximMoinat commented 3 years ago

The name column is used to create the filenames for the cohorts (.json, .sql) by ROhdsiWebApi::insertCohortDefinitionSetInPackage(). I did not want to change the filenames, so I added the ids in there as well.

MaximMoinat commented 3 years ago

@keesvanbochove Simple fix made by simply referencing to the cohorts using the id