OHDSI / StudyProtocolSandbox

This repository is for developing study packages for OHDSI studies. Once completed, they can be moved to the StudyProtocols repository.
32 stars 40 forks source link

Error running sample code #9

Closed solie closed 6 years ago

solie commented 7 years ago

I've successfully installed all required packages, but when I try to run the sample code, it gave me error:

fetchAllDataFromServer(connectionDetails = conn,cdmDatabaseSchema="OHDSI_V5.dbo",workDatabaseSchema="shabbir.dbo",studyCohortTable="cohort", workFolder = workFolder)


INFO [2017-06-05 12:02:44] Starting data extraction


INFO [2017-06-05 12:02:44] Connecting to database INFO [2017-06-05 12:02:44] Connected Connecting using SQL Server driver INFO [2017-06-05 12:02:44] Checking work cohort table exists INFO [2017-06-05 12:02:44] Creating work cohort table INFO [2017-06-05 12:02:44] Cohort table created |==========================================================================================================================| 100% Executing SQL took 0.00401 secs INFO [2017-06-05 12:02:44] Inserting risk cohort into cohort table |==========================================================================================================================| 100% INFO [2017-06-05 12:02:44] Inserting 22 outcomes into cohort table INFO [2017-06-05 12:02:44] Inserting Ventricular arrhythmia and sudden cardiac death (1/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:44] Inserting Hyperprolactinemia (2/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:44] Inserting Acute liver injury (3/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:44] Inserting Hypotension (4/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Fracture (5/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Decreased libido (6/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Hyponatremia (7/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Vertigo (8/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Tinnitus (9/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Alopecia (10/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Delirium (11/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Seizure (12/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Constipation (13/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Hypothyroidism (14/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:45] Inserting Nausea (15/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:46] Inserting Diarrhea (16/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:46] Inserting Insomnia (17/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:46] Inserting Suicide and suicidal ideation (18/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:46] Inserting Stroke (19/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:46] Inserting Open-angle glaucoma (20/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:46] Inserting Gastrointestinal hemhorrage (21/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:46] Inserting Acute myocardial infarction (22/22) |==========================================================================================================================| 100% INFO [2017-06-05 12:02:46] Extracting plpData Connecting using SQL Server driver

Constructing the at risk cohort |==========================================================================================================================| 100% Executing SQL took 0.0101 secs Fetching cohorts from server Loading cohorts took 0.0775 secs Error in FeatureExtraction::getDbCovariateData(connection = connection, : promise already under evaluation: recursive default argument reference or earlier problems? In addition: Warning messages: 1: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateProcedureOccurrence365d is deprecated. Use useCovariateProcedureOccurrenceLongTerm instead 2: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateConditionOccurrence365d is deprecated. Use useCovariateConditionOccurrenceLongTerm instead 3: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateDrugEra365d is deprecated. Use useCovariateDrugEraLongTerm instead 4: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateObservation365d is deprecated. Use useCovariateObservationLongTerm instead 5: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateObservationCount365d is deprecated. Use useCovariateObservationCountLongTerm instead 6: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateConditionOccurrenceInpt180d is deprecated. Use useCovariateConditionOccurrenceInptMediumTerm instead 7: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateConditionOccurrence30d is deprecated. Use useCovariateConditionOccurrenceShortTerm instead 8: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateDrugEra30d is deprecated. Use useCovariateDrugEraShortTerm instead 9: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateObservation30d is deprecated. Use useCovariateObservationShortTerm instead 10: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE, : Argument useCovariateProcedureOccurrence30d is deprecated. Use useCovariateProcedureOccurrenceShortTerm instead

schuemie commented 7 years ago

@PRijnbeek , @jreps : the error is caused by the weird circular references here. What exactly should the value of oracleTempSchema be if the user didn't specify it?

@solie , for now you should be able to avoid the error by adding the argument oracleTempSchema = NULL to the function call:

fetchAllDataFromServer(connectionDetails = conn,
                                       cdmDatabaseSchema="OHDSI_V5.dbo",
                                       workDatabaseSchema="shabbir.dbo",
                                       studyCohortTable="cohort", 
                                       workFolder = workFolder, 
                                       oracleTempSchema = NULL) 
solie commented 7 years ago

Afk now, I'll try asap. Thanks for the hint.

solie commented 7 years ago

Ok, filling oracleTempSchema with NULL did the job, but I have another problem, I guess our ohdsi source just incomplete yet, so the cohort table is just empty, so further execution is impossible. Since I just take over these ohdsi things from another guy, I don't really know where to start, so can you guys give me another hints on the minimal tables that can't be empty to be able to generate the cohort (and the others) table for the next steps? Meanwhile I'll try to read any documentation about it...

This is the warnings:

Warning messages:
1: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateProcedureOccurrence365d is deprecated. Use useCovariateProcedureOccurrenceLongTerm instead
2: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateConditionOccurrence365d is deprecated. Use useCovariateConditionOccurrenceLongTerm instead
3: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateDrugEra365d is deprecated. Use useCovariateDrugEraLongTerm instead
4: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateObservation365d is deprecated. Use useCovariateObservationLongTerm instead
5: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateObservationCount365d is deprecated. Use useCovariateObservationCountLongTerm instead
6: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateConditionOccurrenceInpt180d is deprecated. Use useCovariateConditionOccurrenceInptMediumTerm  instead
7: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateConditionOccurrence30d is deprecated. Use useCovariateConditionOccurrenceShortTerm instead
8: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateDrugEra30d is deprecated. Use useCovariateDrugEraShortTerm instead
9: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateObservation30d is deprecated. Use useCovariateObservationShortTerm instead
10: In FeatureExtraction::createCovariateSettings(useCovariateDemographics = TRUE,  ... :
  Argument useCovariateProcedureOccurrence30d is deprecated. Use useCovariateProcedureOccurrenceShortTerm instead
11: In lowLevelQuerySql.ffdf(connection, sql) :
  Data has zero rows, returning an empty data frame
12: In FeatureExtraction::getDbCovariateData(connection = connection,  ... :
  No data found

and here's the working folder content:

screen shot 2017-06-06 at 10 24 32

Thanks!

schuemie commented 7 years ago

This is quite an ambitious project to start in OHDSI ;-)

Did you check to see if any rows were created in shabbir.dbo.cohort?

For running this project, at the very least the following tables in the CDM should be fully populated:

as well as the vocabulary tables, including

Also, because combinations of exclusion criteria quickly add up, you will need a reasonable population size for this study. 100,000 subject will not be enough to even run.

solie commented 7 years ago

No row at all in shabbir.dbo.cohort, that's why I suspected something wrong with the cdm source, let me take a look at it. I see all the tables you mention above, but I don't know yet about its content.

We have 1m patient with all their diags, drugs, visits, etc, so I guess it will be enough to run.

PRijnbeek commented 7 years ago

Hi All,

Thanks Martijn for catching some emails during the Pentecost days off.

In our database we had the same issue of an empty cohort because the study required a Major Depression Disorder as index rule (see this link for the cohort definition: http://www.ohdsi.org/web/atlas/#/cohortdefinition/157911). In The Netherlands we do not have a code for Major Depressive Disorder so I had to change this to Depressive Disorder. Do you have concept_id 4152280 in your database?

solie commented 7 years ago

After I took a look at our cdm source, I found out that I'm missing drug_era and condition_era data, the tables exist but empty. I'll continue my searching...

For 4152280 I found nothing exist in our data, so I guess I can use the same approach as Peter's

vojtechhuser commented 6 years ago

closing as old issue