GithubHelp home page GithubHelp logo

legendt2dm's Introduction

Large-scale Evidence Generation and Evaluation across a Network of Databases for Type 2 Diabetes Mellitus (LEGEND-T2DM)

Study Status: Results Available

  • Analytics use case(s): Population-Level Estimation
  • Study type: Clinical Application
  • Tags: -
  • Study lead: Marc A. Suchard
  • Study lead forums tag: msuchard
  • Study start date: 1 November 2021
  • Study end date: -
  • Protocol: HTML document
  • Publications: -
  • Results explorer: -

Requirements

  • A database in Common Data Model version 5 in one of these platforms: SQL Server, Oracle, PostgreSQL, IBM Netezza, Apache Impala, Amazon RedShift, Google BigQuery, or Microsoft APS.
  • R version 4.0.5
  • On Windows: RTools
  • Java
  • 100 GB of free disk space

How to run

  1. Follow these instructions for setting up your R environment, including RTools and Java.

  2. Open your study package in RStudio. Use the following code to install all the dependencies:

    install.packages("renv")
    renv::activate()
    renv::restore()
  3. In RStudio, select 'Build' then 'Install and Restart' to install the LegendT2dm package.

  4. For class v.s. class studies, follow the instructions in Steps 6-11 below. For your convenience, all code is also provided under extras/CodeToRun.R.

  5. For drug v.s. drug studies across all drug classes, follow the instructions in Steps 6-11. Replace the argument indicationId = "class" with indicationId = "drug" and also replace cohorts = "class" with cohorts = "drug" to view/upload diagnostics and results. It is strongly recommended to run all the code provided under extras/CodeToRunAllDrugs.R for more reliable execution.

  6. Once the LegendT2dm package is installed, you can execute the feasibility assessment portion of the study by modifying and using the code below. You may also refer to the code provided under extras/CodeToRun.R (or indicationId = "drug" for drug-level studies):

    library(LegendT2dm)
    
    Sys.setenv(DATABASECONNECTOR_JAR_FOLDER="s:/DatabaseDrivers")
    
    # Run-once: set-up your database driver
    DatabaseConnector::downloadJdbcDrivers(dbms = "postgresql")
    
    # Optional: specify where the temporary files (used by the Andromeda package) will be created:
    options(andromedaTempFolder = "s:/AndromedaTemp")
    
    # Maximum number of cores to be used:
    maxCores <- min(4, parallel::detectCores()) # Or more depending on your hardware
    
    # Minimum cell count when exporting data:
    minCellCount <- 5
    
    # The folder where the study intermediate and result files will be written:
    outputFolder <- "s:/LegendT2dmStudy"
    
    # Details for connecting to the server:
    # See ?DatabaseConnector::createConnectionDetails for help
    connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = "postgresql",
    								server = "some.server.com/ohdsi",
    								user = "joe",
    								password = "secret")
    
    # The name of the database schema where the CDM data can be found:
    cdmDatabaseSchema <- "cdm_synpuf"
    
    # The name of the database schema and table where the study-specific cohorts will be instantiated:
    cohortDatabaseSchema <- "scratch.dbo"
    tablePrefix <- "legendt2dm_study"
    
    # Some meta-information that will be used by the export function:
    databaseId <- "Synpuf"
    databaseName <- "Medicare Claims Synthetic Public Use Files (SynPUFs)"
    databaseDescription <- "Medicare Claims Synthetic Public Use Files (SynPUFs) were created to allow interested parties to gain familiarity using Medicare claims data while protecting beneficiary privacy. These files are intended to promote development of software and applications that utilize files in this format, train researchers on the use and complexities of Centers for Medicare and Medicaid Services (CMS) claims, and support safe data mining innovations. The SynPUFs were created by combining randomized information from multiple unique beneficiaries and changing variable values. This randomization and combining of beneficiary information ensures privacy of health information."
    
    # For some database platforms (e.g. Oracle): define a schema that can be used to emulate temp tables:
    options(sqlRenderTempEmulationSchema = NULL)
    
    # Feasibility assessment ---------------------------------------------------------
    assessPhenotypes(connectionDetails = connectionDetails,
    				 cdmDatabaseSchema = cdmDatabaseSchema,
    				 oracleTempSchema = oracleTempSchema,
    				 cohortDatabaseSchema = cohortDatabaseSchema,
    				 outputFolder = outputFolder,
    				 tablePrefix = tablePrefix,
    				 indicationId = 'class',
    				 databaseId = databaseId,
    				 databaseName = databaseName,
    				 databaseDescription = databaseDescription,
    				 createExposureCohorts = TRUE,
    				 runExposureCohortDiagnostics = TRUE,
    				 createOutcomeCohorts = TRUE,
    				 runOutcomeCohortDiagnostics = TRUE)
    
  7. Upload the files class/cohortDiagnosticsExport/Results_class_exposures_<DatabaseId>.zip and outcome/cohortDiagnosticsExport/Results_outcomes_<DatabaseId>.zip in the output folder to the study coordinator:

    uploadPhenotypeResults(cohorts = "class",
                           outputFolder, privateKeyFileName = "<file>", userName = "<name>"
    uploadPhenotypeResults(cohorts = "outcome",
                           outputFolder, privateKeyFileName = "<file>", userName = "<name>")

    where <file> and <name> are the credentials provided to you personally by the study coordinator.

  8. View your cohort diagnostics locally via:

    CohortDiagnostics::preMergeDiagnosticsFiles(dataFolder = file.path(outputFolder, 
                                                                       "class/cohortDiagnosticsExport"))
    LegendT2dmCohortExplorer::launchCohortExplorer(cohorts = "class",
                                                   dataFolder = file.path(outputFolder, 
    					                              "class/cohortDiagnosticsExport"))
    
    CohortDiagnostics::preMergeDiagnosticsFiles(dataFolder = file.path(outputFolder, 
                                                                       "outcome/cohortDiagnosticsExport"))
    LegendT2dmCohortExplorer::launchCohortExplorer(cohorts = "outcome",
                                                   dataFolder = file.path(outputFolder, 
    					                              "outcome/cohortDiagnosticsExport"))
  9. Complete the feasibility assessment by constructing sample-restricted propensity models:

    assessPropensityModels(connectionDetails = connectionDetails,
                           cdmDatabaseSchema = cdmDatabaseSchema,
                           oracleTempSchema = oracleTempSchema,
                           cohortDatabaseSchema = cohortDatabaseSchema,
                           outputFolder = outputFolder,
                           indicationId = "class",
                           tablePrefix = tablePrefix,
                           databaseId = databaseId,
                           maxCores = maxCores)

    and uploading the file class/assessmentOfPropensityScores/Results_class_ps_<DatabaseId>.zip in the output folder to the study coordinator:

    uploadPsAssessmentResults(cohorts = "class",
                              outputFolder, privateKeyFileName = "<file>", userName = "<name>")
  10. To prepare to execute the class-vs-class comparative effectiveness and safety (CES) study, first update your LegendT2dm to version >= 2.0.0. You can accomplish this via a git pull in RStudio and then select 'Build' and 'Install and Restart'. To check your package version:

    packageVersion("LegendT2dm")
    
  11. Execute the CES study via:

    execute(connectionDetails = connectionDetails,
        	cdmDatabaseSchema = cdmDatabaseSchema,
        	oracleTempSchema = oracleTempSchema,
        	cohortDatabaseSchema = cohortDatabaseSchema,
        	outputFolder = outputFolder,
        	indicationId = "class",
        	databaseId = databaseId,
        	databaseName = databaseName,
        	databaseDescription = databaseDescription,
        	tablePrefix = tablePrefix,
        	createExposureCohorts = TRUE, 
        	createOutcomeCohorts = TRUE,  
        	fetchAllDataFromServer = TRUE,
        	generateAllCohortMethodDataObjects = TRUE,
        	runCohortMethod = TRUE,
        	computeCovariateBalance = TRUE,
        	exportToCsv = TRUE,
        	maxCores = maxCores)
    

    and upload the file class/export/Results_class_study_<DatabaseId>.zip in the output folder to the study coordinator:

    uploadStudyResults(cohorts = "class",
                       outputFolder, privateKeyFileName = "<file>", userName = "<name>")
    

License

The LegendT2dm package is licensed under Apache License 2.0

Development

LegendT2dm was developed in ATLAS and R Studio.

Development status

Collecting cohort diagnostics from data partners.

legendt2dm's People

Contributors

aki-nishimura avatar aostropolets avatar clairblacketer avatar fanbu1995 avatar jdposada avatar k-m-li avatar msuchard avatar rohankhera avatar schuemie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

legendt2dm's Issues

ERROR: operator does not exist: character varying = bigint Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.

We had previously run LegendT2dm on a dataset and we are now trying to do the same on another dataset.

We have a problem running the very first sql.

Starting assessPhenotypes() for LEGEND-T2DM class-vs-class studies
Creating class exposure cohorts
- Populating table again_legendt2dm_study_class_cohort
Connecting using PostgreSQL driver
Warning: the condition has length > 1 and only the first element will be used
Warning: only the first element is used as variable name
Creating cohort table
Creating cohort table took 0.183 secs
Number of cohorts 176
Creating temporary inclusion statistics tables
  |====================================================================================| 100%
Executing SQL took 0.107 secs
Instantiation cohort DPP4I main (Cohort id: 101100000)
  |===========================================                                         |  52%**Error: Error executing SQL:
org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bigint
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 989**
An error report has been created at  D:/OHDSI-LegendT2DM-THIN/LegendT2dm/errorReportSql.txt
Run `rlang::last_error()` to see where the error occurred.
An error report has been created at  d:/OHDSI-LegendT2DM - HADM results/errorReportR.txt

Notice

Error: Error executing SQL:
org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bigint
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 989**

We are not quite sure which columns we are doing character varying = bigint

Related sql seems to be \class\ID101100000.sql

Below are errors:

errorReportR.txt

Error:
org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bigint
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 989

SQL:
CREATE TEMP TABLE drugTarget

AS
WITH ctePersons(person_id)  AS (
	select distinct person_id from included_events
)

 SELECT
person_id, drug_exposure_start_date, drug_exposure_end_date

FROM
(
	select de.PERSON_ID, DRUG_EXPOSURE_START_DATE,  COALESCE(DRUG_EXPOSURE_END_DATE, (DRUG_EXPOSURE_START_DATE + DAYS_SUPPLY*INTERVAL'1 day'), (DRUG_EXPOSURE_START_DATE + 1*INTERVAL'1 day')) as DRUG_EXPOSURE_END_DATE 
	FROM ohdsiv5_jan2022_ha_dm.DRUG_EXPOSURE de
	JOIN ctePersons p on de.person_id = p.person_id
	JOIN Codesets cs on cs.codeset_id = 1 AND de.drug_concept_id = cs.concept_id

	UNION ALL

	select de.PERSON_ID, DRUG_EXPOSURE_START_DATE,  COALESCE(DRUG_EXPOSURE_END_DATE, (DRUG_EXPOSURE_START_DATE + DAYS_SUPPLY*INTERVAL'1 day'), (DRUG_EXPOSURE_START_DATE + 1*INTERVAL'1 day')) as DRUG_EXPOSURE_END_DATE 
	FROM ohdsiv5_jan2022_ha_dm.DRUG_EXPOSURE de
	JOIN ctePersons p on de.person_id = p.person_id
	JOIN Codesets cs on cs.codeset_id = 1 AND de.drug_source_concept_id = cs.concept_id
) E


R version:
R version 4.0.5 (2021-03-31)

Platform:
x86_64-w64-mingw32

Attached base packages:
- stats
- graphics
- grDevices
- datasets
- utils
- methods
- base

Other attached packages:
- LegendT2dm (0.0.1)
- DatabaseConnector (4.0.2)

errorReportR.txt


Thread: Main
Message:  Error: Error executing SQL: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bigint   Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.   Position: 989 An error report has been created at  D:/OHDSI-LegendT2DM-THIN/LegendT2dm/errorReportSql.txt �[90mRun `rlang::last_error()` to see where the error occurred.�[39m 
Level:  FATAL
Time:  2022-01-12 21:45:32

Stack trace:
12: stop(fallback)
11: signal_abort(cnd)
10: abort(paste("Error executing SQL:", message, paste("An error report has been created at ", f
9: .createErrorReport(connection@dbms, err$message, sqlStatement, errorReportFile)
8: value[[3]](cond)
7: tryCatchOne(expr, names, parentenv, handlers[[1]])
6: tryCatchList(expr, classes, parentenv, handlers)
5: tryCatch({
    startQuery <- Sys.time()
    lowLevelExecuteSql(connection, sqlStatement)
   
4: DatabaseConnector::executeSql(connection, sql)
3: CreateAllCohorts.R#63: CohortDiagnostics::instantiateCohortSet(connectionDetails = connectio
2: Assessment.R#75: createExposureCohorts(connectionDetails = connectionDetails, cdmDatabaseSch
1: assessPhenotypes(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchem

R version:
R version 4.0.5 (2021-03-31)

Platform:
x86_64-w64-mingw32

Attached base packages:
- stats
- graphics
- grDevices
- datasets
- utils
- methods
- base

Other attached packages:
- LegendT2dm (0.0.1)
- DatabaseConnector (4.0.2)

Odd, it seems Position: 989 in errorReportR.txt and the actual line 989 in ID101100000.sql are saying two different position.

Anyway, how to solve this? We do not even use bigint in our database already

SQL error while running `assessPropensityModels()`

We have successfully run the phenotype assessment at Johns Hopkins, but are having troubles with the propensity model part. We get an SQL error while retrieving cohorts. Below is the content of errorReportSql.txt --- do you have insights as to where the "NA" in cohort_definition_id IN (NA, NA) is coming from?

DBMS:
sql server

Error:
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'NA'.

SQL:
SELECT ROW_NUMBER() OVER (ORDER BY person_id, cohort_start_date) AS row_id,
	subject_id,

	cohort_definition_id,

	cohort_start_date,
	DATEDIFF(DAY, observation_period_start_date, cohort_start_date) AS days_from_obs_start,
	
		DATEDIFF(DAY, cohort_start_date, cohort_end_date)
	 AS days_to_cohort_end,
	
		DATEDIFF(DAY, cohort_start_date, observation_period_end_date)
	 AS days_to_obs_end,
	cohort_end_date
INTO #cohort_person
FROM (




	SELECT exposure_table.subject_id,

		cohort_definition_id,

		cohort_start_date,
		cohort_end_date
	FROM JHM_OMOP_20220203.Results.legendt2dm_study_class_sample_cohort exposure_table
	
		
			WHERE
		
		cohort_definition_id IN (NA, NA)
	


	) raw_cohorts



INNER JOIN JHM_OMOP_20220203.dbo.observation_period
	ON subject_id = person_id
WHERE cohort_start_date <= observation_period_end_date
	AND cohort_start_date >= observation_period_start_date




R version:
R version 4.0.5 (2021-03-31)

Platform:
x86_64-pc-linux-gnu

Attached base packages:
- stats
- graphics
- grDevices
- utils
- datasets
- methods
- base

Other attached packages:
- LegendT2dm (1.0.2)
- DatabaseConnector (4.0.2)

Quota limits in GBQ while generating LEGEND cohorts

Error:
java.sql.SQLException: [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Quota exceeded: Your table exceeded quota for imports or query appends per table. For more information, see https://cloud.google.com/bigquery/docs/troubleshoot-quotas

SQL:
create table j6p09yq2codesets (
  codeset_id INT64 not null,
  concept_id INT64 not null
)
 

Have benefitted from discussions with @jdposada , @msuchard , @ and others. May be of relevance to @chrisknoll and @mgkahn.

This is from an attempt using this docker image (v 0.6) deployed in a GCP VM.

From looking at the assessment.log, this was on the 112th cohort instantiation (Cohort id 201201000).
Each cohort is generated using ATLAS generated SQL. E.g. the one where the error was hit is this one.

Each of those SQL scripts has a series of insert statements. Some of these act on a newly created #codesets table (generated for each cohort), and others that insert the cohort into the cumulative study cohort table, and track inclusion / summary stats. Each of those is preceded by a delete (although this started with a clean project, so there shouldn’t have been a need to delete tables).

All of this relevant because it seems like the relevant limit is either table operations / day (1500) (which includes inserts or deletes) or possibly tables.insert method requests / 10 seconds (and tables.insert here is possibly inclusive of CREATE? – wondering here because of the snippet that’s blamed).

Some solutions being explored include

  1. Looking into raising the relevant quota (preferred - but doesn't necessarily address such problems in the future).
  2. Staging the execution somehow (it doesn't look like inclusion stats can be deferred as they are implicit to the SQL for each cohort, but perhaps cohort creation can proceed in batches according to the quota limit).

Discussion as to whether there's a longer term SQLRender approach to this problem, deferred to those more knowledgeable than I :)

errorReportR.txt
ErrorReportSql.txt
assessmentLog.txt

R Version Clarification

Additional clarification requested: is R version 4.0.5 required as listed on the README or will any R (>= 4.0) work as detailed in [https://github.com/ohdsi-studies/LegendT2dm/blob/master/DESCRIPTION]?

Is RStudio required? Or are we able to build package with just R?

Warning: 8 parsing failures. - actual columns less than expected.

When running LegendT2dm codes, I realize there are a few lines of errors

Warning: the condition has length > 1 and only the first element will be used
- Populating table legendt2dm_study_outcome_cohort
Creating cohort table
Creating cohort table took 0.054 secs

****Warning: 8 parsing failures.
row col  expected    actual                                                                                                              file
 15  -- 8 columns 7 columns 'D:/OHDSI-LegendT2DM/LegendT2dm/renv/library/R-4.0/x86_64-w64-mingw32/LegendT2dm/settings/OutcomesOfInterest.csv'
 16  -- 8 columns 7 columns 'D:/OHDSI-LegendT2DM/LegendT2dm/renv/library/R-4.0/x86_64-w64-mingw32/LegendT2dm/settings/OutcomesOfInterest.csv'
 17  -- 8 columns 7 columns 'D:/OHDSI-LegendT2DM/LegendT2dm/renv/library/R-4.0/x86_64-w64-mingw32/LegendT2dm/settings/OutcomesOfInterest.csv'
 24  -- 8 columns 7 columns 'D:/OHDSI-LegendT2DM/LegendT2dm/renv/library/R-4.0/x86_64-w64-mingw32/LegendT2dm/settings/OutcomesOfInterest.csv'
 27  -- 8 columns 7 columns 'D:/OHDSI-LegendT2DM/LegendT2dm/renv/library/R-4.0/x86_64-w64-mingw32/LegendT2dm/settings/OutcomesOfInterest.csv'**
... ... ......... ......... .................................................................................................................
See problems(...) for more details.**

Number of cohorts 32
Instantiation cohort 3-point MACE (Cohort id: 1)
  |=========================================================================================================| 100%
Executing SQL took 8.22 mins

I do not want to risk pausing the code since it has been running for 72h+

Would it be any problem?

Below are lines in the files

cohortId,atlasId,atlasName,name,description,cite,isNew,hyperlink
1,538,3-point MACE,outcome/3pt_MACE,"Condition record of acute myocardial infarction, hemorrhagic or ischemic stroke or sudden cardiac death during an inpatient or ER visit",[@Ammann2018-kh;@Floyd2016-ch;@Rubbo2015-rh;@Singh2018-jg;@Wahl2010-ii;@Normand1995-ag;@Andrade2012-sp;@Park2016-wa;@Gon2017-rp;@Sung2016-xi;@Tu2013-qv;@Yuan2017-wm;@Hennessy2010-gn],no,"{[}\protect\hyperlink{ref-Ammann2018-kh}{49}--\protect\hyperlink{ref-Hennessy2010-gn}{61}{]}"
2,539,4-point MACE,outcome/4pt_MACE,3-Point MACE $+$ inpatient or ER visit (hospitalization) with heart failure condition record,[@Ryan2018-ci;@Ammann2018-kh;@Floyd2016-ch;@Rubbo2015-rh;@Singh2018-jg;@Wahl2010-ii;@Normand1995-ag;@Andrade2012-sp;@Park2016-wa;@Gon2017-rp;@Sung2016-xi;@Tu2013-qv;@Yuan2017-wm;@Hennessy2010-gn;@Kaspar2018-ol;@Feder2018-nj;@Rosenman2014-vv;@Voors2017-rd;@Floyd2016-fi;@Gini2016-gf],no,"{[}\protect\hyperlink{ref-Ryan2018-ci}{44},\protect\hyperlink{ref-Ammann2018-kh}{49}--\protect\hyperlink{ref-Gini2016-gf}{67}{]}"
3,540,Acute myocardial infarction,outcome/Acute_myocardial_infarction,Condition record of acute myocardial infarction during an inpatient or ER vist,[@Ammann2018-kh;@Floyd2016-ch;@Rubbo2015-rh;@Singh2018-jg;@Wahl2010-ii;@Normand1995-ag],no,"{[}\protect\hyperlink{ref-Ammann2018-kh}{49}--\protect\hyperlink{ref-Normand1995-ag}{54}{]}"
4,541,Acute renal failure,outcome/Acute_renal_failure,Condition record of acute renal failure during an inpatient or ER visit,[@Weinstein2020-ic;@Afzal2013-uz;@Lenihan2013-id;@Winkelmayer2005-jh;@Grams2014-zx;@Arnold2018-rq;@Sutherland2015-ya;@Waikar2006-uq;@Rhee2015-mm],no,"{[}\protect\hyperlink{ref-Weinstein2020-ic}{47},\protect\hyperlink{ref-Afzal2013-uz}{68}--\protect\hyperlink{ref-Rhee2015-mm}{75}{]}"
5,558,Glycemic control,outcome/Glycemic_control,First hemoglobin A1c measurement with value $\le$ 7\%,[@Vashisht2018-qk],no,"{[}\protect\hyperlink{ref-Vashisht2018-qk}{76}{]}"
6,542,Hospitalization with heart failure,outcome/Hospitalization_with_heart_failure,Inpatient or ER visit with heart failure condition record,[@Ryan2018-ci;@Kaspar2018-ol;@Feder2018-nj;@Rosenman2014-vv;@Voors2017-rd;@Floyd2016-fi;@Gini2016-gf],no,"{[}\protect\hyperlink{ref-Ryan2018-ci}{44},\protect\hyperlink{ref-Kaspar2018-ol}{62}--\protect\hyperlink{ref-Gini2016-gf}{67}{]}"
7,543,Measured renal dysfunction,outcome/Measured_renal_dysfunction,First creatinine measurement with value > 3 mg/dL,[@Rhee2015-mm],no,"{[}\protect\hyperlink{ref-Rhee2015-mm}{75}{]}"
8,557,Revascularization,outcome/Revascularization,Procedure record of percutaneous coronary intervention or coronary artery bypass grafting during an inpatient or ER visit,[@You_undated-fz],no,"{[}\protect\hyperlink{ref-You_undated-fz}{45}{]}"
9,544,Stroke,outcome/Stroke,Condition record of hemorrhagic or ischemic stroke during an inpatient or ER visit,[@Andrade2012-sp;@Park2016-wa;@Gon2017-rp;@Sung2016-xi;@Tu2013-qv;@Yuan2017-wm],no,"{[}\protect\hyperlink{ref-Andrade2012-sp}{55}--\protect\hyperlink{ref-Yuan2017-wm}{60}{]}"
10,545,Sudden cardiac death,outcome/Sudden_cardiac_death,Condition record of sudden cardiac death during an inpatient or ER visit,[@Singh2018-jg;@Hennessy2010-gn],no,"{[}\protect\hyperlink{ref-Singh2018-jg}{52},\protect\hyperlink{ref-Hennessy2010-gn}{61}{]}"
21,546,Abnormal weight gain,outcome/Abnormal_weight_gain,"Abnormal weight gain record of any type; successive records with > 90 day gap are considered independent episodes; note, weight measurements not used",[@Broder2016-qq],no,"{[}\protect\hyperlink{ref-Broder2016-qq}{77}{]}"
22,547,Abnormal weight loss,outcome/Abnormal_weight_loss,"Abnormal weight loss record of any type; successive records with > 90 day gap are considered independent episodes; note, weight measurements not used",[@Williams2017-zb],no,"{[}\protect\hyperlink{ref-Williams2017-zb}{78}{]}"
23,548,Acute pancreatitis,outcome/Acute_pancreatitis,Condition record of acute pancreatitis during an inpatient or ER visit,[@Yabe2015-da;@Dore2013-km;@Dore2011-gx;@Chen2017-bb],no,"{[}\protect\hyperlink{ref-Yabe2015-da}{79}--\protect\hyperlink{ref-Chen2017-bb}{82}{]}"
24,549,All-cause mortality,outcome/All-cause_mortality,Death record of any type,[@Singh2018-jg;@Ooba2013;@Robinson2015],no,"{[}\protect\hyperlink{ref-Singh2018-jg}{52},\protect\hyperlink{ref-Ooba2013}{83},\protect\hyperlink{ref-Robinson2015}{84}{]}"
25,559,Bladder cancer,outcome/Bladder_cancer,Malignant tumor of urinary bladder condition record of any type; limited to earliest event per person,,yes
26,575,Bone fracture,outcome/Bone_fracture,Bone fracture condition record of any type; successive records with > 90 day gap are considered independent episodes,,yes
27,560,Breast cancer,outcome/Breast_cancer,Malignant tumor of breast condition record of any type; limited to earliest event per person,,yes
28,572,Diabetic ketoacidosis,outcome/Diabetic_ketoacidosis,Diabetic ketoacidosis condition record during an inpatient or ER visit,[@Wang2017-su;@wang2019diabetic],no,"{[}\protect\hyperlink{ref-Wang2017-su}{46},\protect\hyperlink{ref-wang2019diabetic}{85}{]}"
29,550,Diarrhea,outcome/Diarrhea,Diarrhea condition record of any type; successive records with > 30 day gap are considered independent episodes,[@Buono2017-rg;@Krishnarajah2016-af;@Panozzo2014-tt],no,"{[}\protect\hyperlink{ref-Buono2017-rg}{86}--\protect\hyperlink{ref-Panozzo2014-tt}{88}{]}"
30,563,Genitourinary infection,outcome/Genitourinary_infection,Condition record of any type of genital or urinary tract infection during an outpatient or ER vists,[@Nichols2017-ah],no,"{[}\protect\hyperlink{ref-Nichols2017-ah}{89}{]}"
31,552,Hyperkalemia,outcome/Hyperkalemia,Condition record for hyperkalemia or potassium measurements > 5.6 mmol/L; successive records with >90 day gap are considered independent episodes,[@Abbas2015;@Betts2018;@Fitch2017],no,"{[}\protect\hyperlink{ref-Abbas2015}{90}--\protect\hyperlink{ref-Fitch2017}{92}{]}"
32,564,Hypoglycemia,outcome/Hypoglycemia,Hypoglycemia condition record of any type; successive records with > 90 day gap are considered independent episodes,[@leonard2018comparative],yes,"{[}\protect\hyperlink{ref-leonard2018comparative}{93}{]}"
33,553,Hypotension,outcome/Hypotension,Hypotension condition record of any type; successive records with > 90 day gap are considered independent episodes,[@Chrischilles2001-ak],no,"{[}\protect\hyperlink{ref-Chrischilles2001-ak}{94}{]}"
34,569,Joint pain,outcome/Joint_pain,Joint pain condition record of any type; successive records with > 90 days gap are considered independent episodes,,yes
35,570,Lower extremity amputation,outcome/LE_amputation,Procedure record of below knee lower extremity amputation during inpatient or outpatient visit,[@Ryan2018-ci;@Yuan2018-am],no,"{[}\protect\hyperlink{ref-Ryan2018-ci}{44},\protect\hyperlink{ref-Yuan2018-am}{48}{]}"
36,554,Nausea,outcome/Nausea,Nausea condition record of any type; successive records with > 30 day gap are considered independent episodes,[@Goldstein2003-mx;@Donga2017-vh;@Marrett2016-rr],no,"{[}\protect\hyperlink{ref-Goldstein2003-mx}{95}--\protect\hyperlink{ref-Marrett2016-rr}{97}{]}"
37,551,Peripheral edema,outcome/Edema,Edema condition record of any type; successive records with > 180 day gap are considered independent episodes,,yes
38,574,Photosensitivity,outcome/Photosensitivity,Condition record of drug-induced photosensitivity during any type of visit,,yes
39,571,Renal cancer,outcome/Renal_cancer,Primary malignant neoplasm of kidney condition record of any type; limited to earliest event per person,,yes
40,573,Thyroid tumor,outcome/Thyroid_tumor,Neoplasm of thyroid gland condition record of any type; limited to earliest event per person,,yes
41,555,Venous thromboembolism,outcome/Venous_thromboembolic_events,Venous thromboembolism condition record of any type; successive records with > 180 day gap are considered independent episodes,[@Tamariz2012b;@Burwen2017;@Coleman2016;@Ammann2018b],no,"{[}\protect\hyperlink{ref-Tamariz2012b}{98}--\protect\hyperlink{ref-Ammann2018b}{101}{]}"
42,556,Vomiting,outcome/Vomiting,Vomiting condition record of any type; successive records with > 30 day gap are considered independent episodes,[@Goldstein2003-mx;@Donga2017-vh;@Marrett2016-rr],no,"{[}\protect\hyperlink{ref-Goldstein2003-mx}{95}--\protect\hyperlink{ref-Marrett2016-rr}{97}{]}"

Thanks

Add LegendT2dm to renv.lock

The current instructions assume the user has git installed, and knows how to clone a project. Worse still, the instructions don't mention that that is what the user is expected to do, causing confusion.

I recommend adding LegendT2dm to the renv lock file, and instruct users to download the lock file and initialize renv like this

Error: Error executing SQL: org.postgresql.util.PSQLException: ERROR: UNION types integer and character varying cannot be matched Position: 325

Similar to last issue #13 , which is 'solved' by changing our source id columns of our database (which does not make sense, wasn't the source id and the source value columns are not recommended for analysis)?

This time, we have an issue in the middle of the analysis.

image

Note

Error: Error executing SQL:
org.postgresql.util.PSQLException: ERROR: UNION types integer and character varying cannot be matched
  Position: 325
An error report has been created at  D:/OHDSI-LegendT2DM-THIN/LegendT2dm/errorReportSql.txt

Below are the errorReportR.txt

Thread: Main
Message:  Error: Error executing SQL: org.postgresql.util.PSQLException: ERROR: UNION types integer and character varying cannot be matched   Position: 325 An error report has been created at  D:/OHDSI-LegendT2DM-THIN/LegendT2dm/errorReportSql.txt �[90mRun `rlang::last_error()` to see where the error occurred.�[39m 
Level:  FATAL
Time:  2022-01-13 18:19:06

Stack trace:
14: stop(fallback)
13: signal_abort(cnd)
12: abort(paste("Error executing SQL:", message, paste("An error report has been created at ", f
11: .createErrorReport(connection@dbms, err$message, sqlStatement, errorReportFile)
10: value[[3]](cond)
9: tryCatchOne(expr, names, parentenv, handlers[[1]])
8: tryCatchList(expr, classes, parentenv, handlers)
7: tryCatch({
    startQuery <- Sys.time()
    lowLevelExecuteSql(connection, sqlStatement)
   
6: DatabaseConnector::executeSql(connection, sql)
5: createConceptCountsTable(connection = connection, cdmDatabaseSchema = cdmDatabaseSchema, tem
4: runConceptSetDiagnostics(connection = connection, tempEmulationSchema = tempEmulationSchema,
3: CohortDiagnostics.R#30: CohortDiagnostics::runCohortDiagnostics(packageName = "LegendT2dm", 
2: Assessment.R#103: runExposureCohortDiagnostics(connectionDetails, cdmDatabaseSchema, vocabul
1: assessPhenotypes(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchem

R version:
R version 4.0.5 (2021-03-31)

Platform:
x86_64-w64-mingw32

Attached base packages:
- stats
- graphics
- grDevices
- datasets
- utils
- methods
- base

Other attached packages:
- LegendT2dm (0.0.1)
- DatabaseConnector (4.0.2)

errorReportSql.txt

DBMS:
postgresql

Error:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "#"
  Position: 15

SQL:
SELECT * FROM #exposure_cohorts;

R version:
R version 4.0.5 (2021-03-31)

Platform:
x86_64-w64-mingw32

Attached base packages:
- stats
- graphics
- grDevices
- datasets
- utils
- methods
- base

Other attached packages:
- LegendT2dm (0.0.1)
- DatabaseConnector (4.0.2)

Could it have to do with a null cdm_source table?

What are they comparing when a SQL does not match that deep into the script?

Thanks

Warning: failed to find binary for 'XXXXX' in package repositories

When doing renv::restore(), we realize there are quite a few warnings:

Warning: failed to find binary for 'Andromeda 0.5.0' in package repositories
Warning: failed to retrieve 'https://mran.microsoft.com/snapshot/2021-07-06/bin/windows/contrib/4.0/Andromeda_0.5.0.zip' [error code 22]
Warning: failed to find source for 'Andromeda 0.5.0' in package repositories
Warning: failed to find binary for 'RSQLite 2.2.7' in package repositories
Warning: failed to retrieve 'https://mran.microsoft.com/snapshot/2021-07-06/bin/windows/contrib/4.0/RSQLite_2.2.7.zip' [error code 22]
Error: failed to retrieve package '[email protected]'
In addition: There were 30 warnings (use warnings() to see them)

Not sure if we should use a updated package in renv.lock in order to mitigate the errors

Warning: All coefficients (except maybe the intercept) are zero. Either the covariates are completely uninformative or completely predictive of the treatment. Did you remember to exclude the treatment variables from the covariates?

Hello Marc,

When running assessPropensityModels(...), there is such an error:

Warning: All coefficients (except maybe the intercept) are zero. Either the covariates are completely uninformative or completely predictive of the treatment. Did you remember to exclude the treatment variables from the covariates?

It seems there is obvious we can do to fix. What is wrong?

Error while initializing environment - "revocation server was offline"

Hello, I am attempting to setup and run the study but I am running into this error when running the renv:restore()

Any advice/comments welcome:
Thanks!

-----------------Error Message--------------------------

Retrieving 'https://cran.rstudio.com/src/contrib/Archive/renv/renv_0.13.2.tar.gz' ...
OK [file is up to date]
Retrieving 'https://cran.rstudio.com/src/contrib/Archive/lattice/lattice_0.20-44.tar.gz' ...
OK [file is up to date]
Retrieving 'https://cran.rstudio.com/src/contrib/Archive/Matrix/Matrix_1.3-3.tar.gz' ...
OK [file is up to date]
Retrieving 'https://cran.rstudio.com/src/contrib/Archive/mgcv/mgcv_1.8-35.tar.gz' ...
OK [file is up to date]
Warning: failed to find binary for 'mgcv 1.8-35' in package repositories
Warning: failed to find source for 'mgcv 1.8-35' in package repositories
Warning: failed to find binary for 'nlme 3.1-152' in package repositories
Error: failed to retrieve package '[email protected]'
In addition: Warning messages:
1: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.
2: failed to retrieve 'https://rstudio-buildtools.s3.amazonaws.com/renv/mran/packages.rds' [error code 35]
3: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.
4: failed to retrieve 'https://rstudio-buildtools.s3.amazonaws.com/renv/mran/packages.rds' [error code 35]
5: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.
6: failed to retrieve 'https://rstudio-buildtools.s3.amazonaws.com/renv/mran/packages.rds' [error code 35]
7: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.
8: failed to retrieve 'https://rstudio-buildtools.s3.amazonaws.com/renv/mran/packages.rds' [error code 35]
9: curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.

Negative control list needs finalization

Current list includes those found for T2DM (labeled CEM) as well as negative controls previously used for hypertension. 2 immediate issues: 1- redundancy between lists, 2-hypertension list includes controls that are not appropriate to use for T2DM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.