STUDY-PACKAGE-EXECUTE.md

Instructions To Run Study

Step 1a - Register (skip this if you already have an account)

Step 1b - Sign Up for the Alpha wave and Delta wave studies

Step 2 - Feasibility

You need to specify the database details for the OMOP CDM database you are analyzing, siteId the unique reference for your site and outputFolder the directory to saved the plot to (this should be the same place as Step 1b). After running the code you will see a new file in outputFolder called countPerDate.pdf.

library(dGEMcovid)
# USER INPUTS
#=======================

siteId <- 'an id given to you by the study lead'

# The folder where the study intermediate and result files will be written:
outputFolder <- "your dirctory to save results" # e.g., "C:/dGEMcovidResults"

# Details for connecting to the server:
dbms <- "you dbms"
user <- 'your username'
pw <- 'your password'
server <- 'your server'
port <- 'your port'

connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = dbms,
                                                                server = server,
                                                                user = user,
                                                                password = pw,
                                                                port = port)

# Add the database containing the OMOP CDM data
cdmDatabaseSchema <- 'cdm database schema'

# Add a database with read/write access as this is where the cohorts will be generated
cohortDatabaseSchema <- 'work database schema'

tempEmulationSchema <- NULL

# table name where the cohorts will be generated
cohortTable <- 'dGemCohort'

databaseDetails <- PatientLevelPrediction::createDatabaseDetails(
  connectionDetails = connectionDetails, 
  cdmDatabaseSchema = cdmDatabaseSchema, 
  cdmDatabaseName = cdmDatabaseSchema,
  tempEmulationSchema = tempEmulationSchema,
  cohortDatabaseSchema = cohortDatabaseSchema,
  cohortTable = cohortTable,
  outcomeDatabaseSchema = cohortDatabaseSchema,
  outcomeTable = cohortTable,
  cdmVersion = 5
)

execute(
  databaseDetails = databaseDetails,
  siteId = siteId,
  outputFolder = outputFolder,
  createCohorts = T,
  verbosity = "INFO"
        )

Open the countPerDate.pdf file to view the covid trajectory for your dataset. Determine when the alpha wave started (yyyymmdd) and ended (yyyymmdd) and when the delta wave started (yyyymmdd) and ended (yyyymmdd).

Now run the following code to extract summary data for each wave:

execute(
  databaseDetails = databaseDetails,
  siteId = siteId,
  outputFolder = outputFolder,
  createData = T,
  verbosity = "INFO",
  alphaStart = '20201101',
  alphaEnd = '20210201',
  deltaStart = '20210801',
  deltaEnd = '20211001'
        )

After running the code you will see two files called data.csv and dataSummary.csv in the directories outputFolder/alpha and outputFolder/delta.

Step 3 - Initialize

library(dGEMcovid)
# USER INPUTS
#=======================

siteId <- 'an id given to you by the study lead'

# The folder where the study intermediate and result files will be written:
outputFolder <- "your dirctory to save results" # e.g., "C:/dGEMcovidResults"

# Details for connecting to the server:
dbms <- "you dbms"
user <- 'your username'
pw <- 'your password'
server <- 'your server'
port <- 'your port'

connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = dbms,
                                                                server = server,
                                                                user = user,
                                                                password = pw,
                                                                port = port)

# Add the database containing the OMOP CDM data
cdmDatabaseSchema <- 'cdm database schema'

# Add a database with read/write access as this is where the cohorts will be generated
cohortDatabaseSchema <- 'work database schema'

tempEmulationSchema <- NULL

# table name where the cohorts will be generated
cohortTable <- 'dGemCohort'

databaseDetails <- PatientLevelPrediction::createDatabaseDetails(
  connectionDetails = connectionDetails, 
  cdmDatabaseSchema = cdmDatabaseSchema, 
  cdmDatabaseName = cdmDatabaseSchema,
  tempEmulationSchema = tempEmulationSchema,
  cohortDatabaseSchema = cohortDatabaseSchema,
  cohortTable = cohortTable,
  outcomeDatabaseSchema = cohortDatabaseSchema,
  outcomeTable = cohortTable,
  cdmVersion = 5
)

execute(
  databaseDetails = databaseDetails,
  siteId = siteId,
  outputFolder = outputFolder,
  runInitialize = T,
  verbosity = "INFO"
        )

Step 4 - Derive

library(dGEMcovid)
# USER INPUTS
#=======================

siteId <- 'an id given to you by the study lead'

# The folder where the study intermediate and result files will be written:
outputFolder <- "your dirctory to save results" # e.g., "C:/dGEMcovidResults"

#=======================

execute(
  siteId = siteId,
  outputFolder = outputFolder,
  runDerive = T,
  verbosity = "INFO"
        )

Step 5 - Estimate

library(dGEMcovid)
# USER INPUTS
#=======================

siteId <- 'an id given to you by the study lead'

# The folder where the study intermediate and result files will be written:
outputFolder <- "your dirctory to save results" # e.g., "C:/dGEMcovidResults"


#=======================

execute(
  siteId = siteId,
  outputFolder = outputFolder,
  runEstimate = T,
  verbosity = "INFO"
        )

Step 6 - Synthesize



ohdsi-studies/dGEMcovid documentation built on May 10, 2023, 3:38 a.m.