Title: Validating acute pancreatitis using a probabilistic reference standard supported by comprehensive clinical characterization
Description: Medical condition misclassification is acknowledged but rarely estimated in observational health sciences research. In this study, we use a probabilistic reference standard validation method to rapidly estimate the measurement errors of 5 phenotype definitions for acute pancreatitis without manual chart review. Further, this study comprehensively characterizes the cohorts returned by these phenotype definitions.
This study is part of the Phenotype Development and Evaluation Workgroup activity at the 2022 OHDSI Symposium.
Use one R
session only. Close other open R
sessions before beginning. Open a new R
script from which you will run the code that installs the ApPhenotypeEvaluation
package to a new local directory. There is no need to clone the ApPhenotypeEvaluation
package and open it as an R
project. Copy the following code into the blank script and replace C:/ApPhenotypeEvaluation
with a local directory location of your choice. The ApPhenotypeEvaluation
package and all of its dependencies will be downloaded to this location. This local directory should not be where your R
libraries are stored. This is an independent package environment for this study.
install.packages("renv")
packageLocation <- "C:/ApPhenotypeEvaluation" # will need >=510MB of disk space for all packages and dependencies
if (!file.exists(packageLocation)) {
dir.create(packageLocation, recursive = TRUE)
}
setwd(packageLocation)
download.file("https://raw.githubusercontent.com/ohdsi-studies/ApPhenotypeEvaluation/main/renv.lock", "renv.lock")
renv::init()
If/when asked if the project already has a lockfile, select "1: Restore the project from the lockfile.".
Modify the code below to add your specifications and execute the study. Replace C:/StudyResults/ApPhenotypeEvaluation
and C:/AndromedaTemp
with local directories of your choice. Your final and intermediary files will be saved in these locations. If you are asked to install additional packages during study execution, reply "y" to install, make note of which packages were installed, and please inform the study coordinator.
# database settings ==========================================================
databaseId <- "my_cdm" # a short name of your database with no special characters please :)
cdmDatabaseSchema <- "my_cdm_v12345"
cohortDatabaseSchema <- "my_database" # must have write access
cohortTable <- "ap_phe_eval"
tempEmulationSchema <- NULL # add schema where temp tables will be emulated if your database platform doesn't support temp tables
# local settings =============================================================
studyFolder <- "C:/ApPheEvalResults/" # will need >=250MB of disk space for all intermediary and final results files
tempFolder <- "C:/AndromedaTemp"
options(andromedaTempFolder = tempFolder,
spipen = 999,
sqlRenderTempEmulationSchema = tempEmulationSchema)
outputFolder <- file.path(studyFolder, databaseId)
# specify connection details =================================================
connectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = "",
server = "",
port = "",
user = "",
password = ""
)
# execute study ==============================================================
library(magrittr)
ApPhenotypeEvaluation::execute(
connectionDetails = connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
cohortDatabaseSchema = cohortDatabaseSchema,
cohortTable = cohortTable,
outputFolder = outputFolder,
databaseId = databaseId,
createCohortTable = TRUE, # TRUE will delete the cohort table and all existing cohorts if already built X_X
createCohorts = TRUE,
runCohortDiagnostics = TRUE,
runValidation = TRUE,
minCellCount = 5
)
# review results =============================================================
ApPhenotypeEvaluation::compileShinyData(outputFolder)
ApPhenotypeEvaluation::launchResultsExplorer(outputFolder)
# share results =============================================================
ApPhenotypeEvaluation::shareResults(
outputFolder = outputFolder,
keyFileName = "", # data sites will receive via email
userName = "" # data sites will receive via email
)