This function uploads results in csv format into a result database
Usage
insertResultsToDatabase(
connectionDetails,
schema,
resultsFolder,
tablePrefix = "",
csvTablePrefix = "c_"
)
Arguments
- connectionDetails
The connection details to the result database
- schema
The schema for the result database
- resultsFolder
The folder containing the csv results
- tablePrefix
A prefix to append to the result tables for the characterization results
- csvTablePrefix
The prefix added to the csv results - default is 'c_'
See also
Other Database:
createCharacterizationTables()
,
createSqliteDatabase()
Examples
# generate results into resultsFolder
conDet <- exampleOmopConnectionDetails()
drSet <- createDechallengeRechallengeSettings(
targetIds = c(1,2),
outcomeIds = 3
)
cSet <- createCharacterizationSettings(
dechallengeRechallengeSettings = drSet
)
runCharacterizationAnalyses(
connectionDetails = conDet,
targetDatabaseSchema = 'main',
targetTable = 'cohort',
outcomeDatabaseSchema = 'main',
outcomeTable = 'cohort',
cdmDatabaseSchema = 'main',
characterizationSettings = cSet,
outputDirectory = tempdir()
)
#> Creating directory /tmp/RtmpEZab1m/execution
#> Currently in a tryCatch or withCallingHandlers block, so unable to add global calling handlers. ParallelLogger will not capture R messages, errors, and warnings, only explicit calls to ParallelLogger. (This message will not be shown again this R session)
#> Creating new cluster
#> Inputs checked
#> Connecting using SQLite driver
#> Computing dechallenge rechallenge results
#> | | | 0% | |======== | 11% | |================ | 22% | |======================= | 33% | |=============================== | 44% | |======================================= | 56% | |=============================================== | 67% | |====================================================== | 78% | |============================================================== | 89% | |======================================================================| 100%
#> Executing SQL took 0.00809 secs
#> Computing dechallenge rechallenge for 2 target ids and 1 outcome ids took 0.0753 secs
#> exporting to csv file
#> Writing 0 rows to csv
#> Inputs checked
#> Connecting using SQLite driver
#> Computing dechallenge rechallenge fails results
#> | | | 0% | |======== | 11% | |================ | 22% | |======================= | 33% | |=============================== | 44% | |======================================= | 56% | |=============================================== | 67% | |====================================================== | 78% | |============================================================== | 89% | |======================================================================| 100%
#> Executing SQL took 0.0142 secs
#> Computing dechallenge failed case series for 2 target IDs and 1 outcome IDs took 0.077 secs
#> exporting to csv file
#> Writing 0 rows to csv
# create sqlite database
charResultDbCD <- createSqliteDatabase()
# create database results tables
createCharacterizationTables(
connectionDetails = charResultDbCD,
resultSchema = 'main'
)
#> Connecting using SQLite driver
#> Deleting existing tables
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.0027 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00265 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00265 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00274 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00264 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00271 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00258 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.0027 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00265 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00262 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00256 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00261 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00264 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00276 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00266 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00261 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00254 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00264 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00255 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00272 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00257 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00265 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00671 secs
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00269 secs
#> Creating characterization results tables
#> | | | 0% | |======= | 10% | |============== | 20% | |===================== | 30% | |============================ | 40% | |=================================== | 50% | |========================================== | 60% | |================================================= | 70% | |======================================================== | 80% | |=============================================================== | 90% | |======================================================================| 100%
#> Executing SQL took 0.00791 secs
#> Migrating data set
#> Migrator using SQL files in Characterization
#> Connecting using SQLite driver
#> Creating migrations table
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00264 secs
#> Migrations table created
#> Executing migration: Migration_1-v0_3_0_store_version.sql
#> | | | 0% | |=================================== | 50% | |======================================================================| 100%
#> Executing SQL took 0.00308 secs
#> Saving migration: Migration_1-v0_3_0_store_version.sql
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00258 secs
#> Migration complete Migration_1-v0_3_0_store_version.sql
#> Executing migration: Migration_2-v2_1_1_mean_exposure_time_type.sql
#> | | | 0% | |================== | 25% | |=================================== | 50% | |==================================================== | 75% | |======================================================================| 100%
#> Executing SQL took 0.00469 secs
#> Saving migration: Migration_2-v2_1_1_mean_exposure_time_type.sql
#> | | | 0% | |======================================================================| 100%
#> Executing SQL took 0.00256 secs
#> Migration complete Migration_2-v2_1_1_mean_exposure_time_type.sql
#> Closing database connection
#> Updating version number
#> | | | 0% | |=================================== | 50% | |======================================================================| 100%
#> Executing SQL took 0.00327 secs
# insert results
insertResultsToDatabase(
connectionDetails = charResultDbCD,
schema = 'main',
resultsFolder = tempdir()
)
#> Connecting using SQLite driver
#> Warning: c_time_to_event.csv not found
#> Warning: c_rechallenge_fail_case_series.csv not found
#> Warning: c_dechallenge_rechallenge.csv not found
#> Warning: c_analysis_ref.csv not found
#> Warning: c_covariate_ref.csv not found
#> Warning: c_covariates.csv not found
#> Warning: c_covariates_continuous.csv not found
#> Warning: c_settings.csv not found
#> Warning: c_cohort_details.csv not found
#> Warning: c_cohort_counts.csv not found
#> Uploading data took 0.0117 secs