OHDSI / PheValuator

An R package for evaluating phenotype algorithms.
https://ohdsi.github.io/PheValuator/
17 stars 6 forks source link

ERROR: relation "ohdsi.cohort_person" does not exist #39

Open afurmanchuk opened 9 months ago

afurmanchuk commented 9 months ago

I am running PheValuator for the first time.

CovSettings <- createDefaultCovariateSettings(startDayWindow1 = 0, endDayWindow1 = 10, startDayWindow2 = 11, endDayWindow2 = 20, startDayWindow3 = 21, endDayWindow3 = 30)

CohortArgs <- createCreateEvaluationCohortArgs(xSpecCohortId = 47, xSensCohortId = 12, prevalenceCohortId = 87, evaluationPopulationCohortId = 73, covariateSettings = CovSettings) conditionAlg1TestArgs <- createTestPhenotypeAlgorithmArgs(phenotypeCohortId = 1778259) analysis1 <- createPheValuatorAnalysis(analysisId = 1, description = "PD(prevalent)", createEvaluationCohortArgs = CohortArgs, testPhenotypeAlgorithmArgs = conditionAlg1TestArgs) pheValuatorAnalysisList <- list(analysis1)

Got the following:

Error in .createErrorReport(): ! Error executing SQL: org.postgresql.util.PSQLException: ERROR: relation "ohdsi.cohort_person" does not exist.

image

Does anyone experience this issue? Appreciate guidance about how to fix it. Thank you. A.

jswerdel commented 9 months ago

Hi @afurmanchuk. The cohort_person is a temp table that gets created when developing the model and the evaluation cohort. it should get created by the sql code and dropped at the end of the query. This has worked in all the databases we tested. What is the backend database that you are using for your system?

afurmanchuk commented 9 months ago

Dear @jswerdel, we are using postgresql.

jswerdel commented 9 months ago

hi - i think you may be running an older version pf PheValuator. would you be able to download the latest version? when you do please change the evaluationPopulationCohortId = 73 to inclusionEvaluationCohortId = 73 and add: inclusionEvaluationDaysFromStart = 0 inclusionEvaluationDaysFromEnd = 365

setting inclusionEvaluationCohortId (or evaluationPopulationCohortId in the older version) is not usually done. It limits the subjects to be evaluated into a specific subset of the dataset as defined by the cohort rather than simply a random set of subjects. Was this intended?

afurmanchuk commented 9 months ago

Upgraded to version 2.2.10. Corrected code in line with your guidance. The result is following: image

jswerdel commented 9 months ago

could you send a screen shot of the errorReportSql.txt file you received? Thanks.

afurmanchuk commented 9 months ago

image

jswerdel commented 9 months ago

In the R command: runPheValuatorAnalyses(), are you setting cohortTable = "cohort_person"? Is that the name of the table where your cohorts are generated? That value should be the name of the cohort table located within your cohort schema (ohdsi?). Try changing that parameter to whatever the cohort table is. Also the schema name, in your case set to ohdsi, should be what is set in that command for cohortDatabaseSchema. If your cohort schema isn't ohdsi, set that parameter to whatever your schema is.

afurmanchuk commented 8 months ago

Thank you.