Development and validation of patient-level prediction models for hospitalization and death amongst young patients presenting with a clinical diagnosis or positive test for COVID-19: a rapid network study to inform the management of COVID-19
Make sure you have R, Java and rJava all set up.
# get the latest PatientLevelPrediction
install.packages("devtools")
devtools::install_github("OHDSI/FeatureExtraction")
devtools::install_github("OHDSI/PatientLevelPrediction")
# check the package
PatientLevelPrediction::checkPlpInstallation()
# install the network package
devtools::install_github("ohdsi-studies/CoverAge")
library(CoverAge)
# USER INPUTS
#=======================
# The folder where the study intermediate and result files will be written:
outputFolder <- "./CoverAgeResults"
# Specify where the temporary files (used by the ff package) will be created:
options(fftempdir = "location with space to save big data")
# 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 sharebale name for the database containing the OMOP CDM data
cdmDatabaseName <- 'a friendly shareable name for your database'
# Add a database with read/write access as this is where the cohorts will be generated
cohortDatabaseSchema <- 'work database schema'
oracleTempSchema <- NULL
# table name where the cohorts will be generated
cohortTable <- 'CoverAgeCohort'
#=======================
execute(connectionDetails = connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
cdmDatabaseName = cdmDatabaseName,
cohortDatabaseSchema = cohortDatabaseSchema,
cohortTable = cohortTable,
oracleTempSchema = oracleTempSchema,
outputFolder = outputFolder,
createProtocol = F,
createCohorts = T,
runAnalyses = T,
createResultsDoc = F,
packageResults = F,
createValidationPackage = F,
minCellCount= 5)
The 'createCohorts' option will create the target and outcome cohorts into cohortDatabaseSchema.cohortTable if set to T. The 'runAnalyses' option will create/extract the data for each prediction problem setting (each Analysis), develop a prediction model, internally validate it if set to T. The results of each Analysis are saved in the 'outputFolder' directory under the subdirectories 'Analysis_1' to 'Analysis_N', where N is the total analyses specified. After running execute with 'runAnalyses set to T, a 'Validation' subdirectory will be created in the 'outputFolder' directory where you can add the external validation results to make them viewable in the shiny app or journal document that can be automatically generated.
execute(connectionDetails = connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
cdmDatabaseName = cdmDatabaseName,
cohortDatabaseSchema = cohortDatabaseSchema,
cohortTable = cohortTable,
outputFolder = outputFolder,
createValidationPackage = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.