From 4a1d021f826a67f8db1ef6c92345e59443863090 Mon Sep 17 00:00:00 2001 From: Nils Christian <nils.christian@ittm-solutions.com> Date: Thu, 16 May 2024 10:11:17 +0200 Subject: [PATCH] Adjust example script to OPTIMA OHDSI stack environment, comment launchDiagnosticsExplorer Fix call of `launchDiagnosticsExplorer`, but comment it and `createMergedResultsFile` because these are not needed to create the zip file. --- extras/CodeToRun.R | 40 +++++++++++++++++++++++----------------- renv.lock | 6 ++++++ 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/extras/CodeToRun.R b/extras/CodeToRun.R index 402d9f5..f7774bb 100644 --- a/extras/CodeToRun.R +++ b/extras/CodeToRun.R @@ -1,10 +1,13 @@ library(OptimaTesting) +envkeyring <- keyring::backend_env$new() +envkeyring$set_with_value("DB_PASS", username = Sys.getenv("DB_USERNAME"), password = getPass::getPass()) + # Maximum number of cores to be used: maxCores <- parallel::detectCores() # The folder where the study intermediate and result files will be written: -outputFolder <- "D:/studyResults/OptimaTesting" +outputFolder <- "studyResults/OptimaTesting" # Optional: specify where the temporary files (used by the Andromeda package) will be created: options(andromedaTempFolder = file.path(outputFolder, "andromedaTemp")) @@ -12,26 +15,26 @@ options(andromedaTempFolder = file.path(outputFolder, "andromedaTemp")) # Details for connecting to the server: connectionDetails <- DatabaseConnector::createConnectionDetails( - dbms = "pdw", - server = Sys.getenv("PDW_SERVER"), - user = NULL, - password = NULL, - port = Sys.getenv("PDW_PORT") + dbms = "postgresql", + server = 'postgresql/ohdsi', + user = Sys.getenv("DB_USERNAME"), + password = envkeyring$get("DB_PASS", username = Sys.getenv("DB_USERNAME")), + port = 5432 ) # The name of the database schema where the CDM data can be found: -cdmDatabaseSchema <- "CDM_IBM_MDCD_V1153.dbo" +cdmDatabaseSchema <- "cdm_synthea1k" # The name of the database schema and table where the study-specific cohorts will be instantiated: -cohortDatabaseSchema <- "scratch.dbo" +cohortDatabaseSchema <- gsub('\\.', '', Sys.getenv("DB_USERNAME")) cohortTable <- "OptimaTesting" # Some meta-information that will be used by the export function: -databaseId <- "Synpuf" +databaseId <- "Synthea" databaseName <- - "Medicare Claims Synthetic Public Use Files (SynPUFs)" + "Synthea synthetic health database" 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." + "SyntheaTM is a Synthetic Patient Population Simulator. The goal is to output synthetic, realistic (but not real), patient data and associated health records in a variety of formats." # For some database platforms (e.g. Oracle): define a schema that can be used to emulate temp tables: options(sqlRenderTempEmulationSchema = NULL) @@ -48,10 +51,13 @@ OptimaTesting::execute( databaseDescription = databaseDescription ) -CohortDiagnostics::createMergedResultsFile( - dataFolder = outputFolder, - sqliteDbPath = file.path(outputFolder, - "MergedCohortDiagnosticsData.sqlite") -) +# CohortDiagnostics::createMergedResultsFile( +# dataFolder = outputFolder, +# sqliteDbPath = file.path(outputFolder, +# "MergedCohortDiagnosticsData.sqlite") +# ) -CohortDiagnostics::launchDiagnosticsExplorer(dataFolder = outputFolder) +# CohortDiagnostics::launchDiagnosticsExplorer( +# sqliteDbPath = file.path(outputFolder, +# "MergedCohortDiagnosticsData.sqlite"), +# publishDir = outputFolder) diff --git a/renv.lock b/renv.lock index 8316da6..1d0c40f 100644 --- a/renv.lock +++ b/renv.lock @@ -507,6 +507,12 @@ "Source" : "Repository", "Repository" : "CRAN" }, + "getPass": { + "Package": "getPass", + "Version": "0.2-4", + "Source": "Repository", + "Repository": "RSPM" + }, "CohortGenerator" : { "Package" : "CohortGenerator", "Version" : "0.8.0", -- GitLab