... | ... | @@ -53,6 +53,8 @@ library(ETLSyntheaBuilder) |
|
|
# Download drivers
|
|
|
DatabaseConnector::downloadJdbcDrivers('postgresql', '.')
|
|
|
|
|
|
# Connect to your database
|
|
|
|
|
|
cd <- DatabaseConnector::createConnectionDetails(
|
|
|
dbms = "postgresql",
|
|
|
server = "localhost/demo_omop",
|
... | ... | @@ -62,6 +64,8 @@ cd <- DatabaseConnector::createConnectionDetails( |
|
|
pathToDriver = "./"
|
|
|
)
|
|
|
|
|
|
# OMOP-CDM Database configuration
|
|
|
|
|
|
cdmSchema <- "cdm"
|
|
|
cdmVersion <- "5.4"
|
|
|
syntheaVersion <- "2.7.0"
|
... | ... | @@ -69,13 +73,21 @@ syntheaSchema <- "native" |
|
|
syntheaFileLoc <- "./csv"
|
|
|
vocabFileLoc <- "./vocabulary_download_v5_minimal"
|
|
|
|
|
|
# Create OMOP-CDM tables
|
|
|
|
|
|
ETLSyntheaBuilder::CreateCDMTables(connectionDetails = cd, cdmSchema = cdmSchema, cdmVersion = cdmVersion)
|
|
|
|
|
|
# Load OMOP vocabularies
|
|
|
|
|
|
ETLSyntheaBuilder::LoadVocabFromCsv(connectionDetails = cd, cdmSchema = cdmSchema, vocabFileLoc = vocabFileLoc)
|
|
|
|
|
|
# Load Synthea data
|
|
|
|
|
|
ETLSyntheaBuilder::CreateSyntheaTables(connectionDetails = cd, syntheaSchema = syntheaSchema, syntheaVersion = syntheaVersion)
|
|
|
|
|
|
ETLSyntheaBuilder::LoadSyntheaTables(connectionDetails = cd, syntheaSchema = syntheaSchema, syntheaFileLoc = syntheaFileLoc)
|
|
|
|
|
|
ETLSyntheaBuilder::LoadVocabFromCsv(connectionDetails = cd, cdmSchema = cdmSchema, vocabFileLoc = vocabFileLoc)
|
|
|
# Execute ETL
|
|
|
|
|
|
ETLSyntheaBuilder::LoadEventTables(connectionDetails = cd, cdmSchema = cdmSchema, syntheaSchema = syntheaSchema, cdmVersion = cdmVersion, syntheaVersion = syntheaVersion)
|
|
|
|
... | ... | |