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

issue with cohorts #82

Closed andrepist closed 3 years ago

andrepist commented 3 years ago

Hi, while running the cohort Diagnostics I have the following error: Error when running CohortDiagnostics::runCohortDiagnostics on CohortGroup: target Error in CohortDiagnostics::runCohortDiagnostics(packageName = getThisPackageName(), : All cohorts were either not instantiated or all have 0 records.

Since it was catched I continued executing the package and I got: Error: 'C:...\GitHub\PioneerWatchfulWaiting-master (1)\PioneerWatchfulWaiting-master\SIDIAP/cohort_count.csv' does not exist.

I have no hint of what could be gone wrong, can you help me? I attach the log file. Thanks, Andrea cohortDiagnosticsLog.txt

keesvanbochove commented 3 years ago

Hi @andrepist thanks for running the package! A few questions to clarify:

Indeed it seems like the target cohort creation was unsuccessful and then the rest of package wouldn't work (there wouldn't be much to analyze in that case).

To debug, one thing you could do is use https://data.ohdsi.org/SqlDeveloper, paste the contents of https://github.com/ohdsi-studies/PioneerWatchfulWaiting/blob/master/inst/sql/sql_server/101.sql in the OHDSI SQL box and input your parameters on the right. That will give you a SQL command you can execute directly in a SQL browser (to (re)create the first target cohort) and hopefully that will give you a bit more context on what is going on.

andrepist commented 3 years ago

Hi @keesvanbochove ,

I'm not sure how to execute the SQL command produced in a SQL browser... With this new information do you have an idea of what happened?

keesvanbochove commented 3 years ago

@andrepist thanks, after reviewing the SQL error report it looks to me like vocabulary_database_schema is not populated. Which value did you provide for the cdmDatabaseSchema argument when invoking runCohortDiagnostics and runStudy?

andrepist commented 3 years ago

@keesvanbochove I kept the script as it is there: runCohortDiagnostics(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, ... and in the definition of cdmDatabaseSchema I put our db schema.

May be a problem of cohort definition?

keesvanbochove commented 3 years ago

@andrepist in the log, I see select concept_id from .CONCEPT where concept_id in (4163261). Right before .CONCEPT, the value of the vocabulary_database_schema is inserted by SqlRender, and this is set to the same as cdmDatabaseSchema (https://github.com/ohdsi-studies/PioneerWatchfulWaiting/blob/423661b6b55168f33dcb954e2698dde79bb39870/R/CohortConstruction.R#L379). So it looks like your value for cdmDatabaseSchema is empty at the point you are executing that line. Can you make sure it is populated with the name of the Postgres schema which contains the CDM tables?

Also, do you have access to PGAdmin or psql command line so you could try out queries in the database? That's what I meant earlier with 'SQL browser'.

andrepist commented 3 years ago

@keesvanbochove yes, I defined it in the script, it shoud not change. I do have access, I can try but I'm not very familiar with that, but I can try of course! Thank you

keesvanbochove commented 3 years ago

OK so we looked at this together, and it seems like none of the patients in the database have procedure codes matching the PCa biopsy concept set, which is causing all of the target cohorts to show up empty.