forked from ohdsi-studies/Glp1Dili
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.R
57 lines (52 loc) · 1.82 KB
/
app.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
################################################################################
# INSTRUCTIONS: The code below assumes you uploaded results to a PostgreSQL
# database per the UploadResults.R script.This script will launch a Shiny
# results viewer to analyze results from the study.
#
# See the Working with results section
# of the UsingThisTemplate.md for more details.
#
# More information about working with results produced by running Glp1Dili
# is found at:
# https://ohdsi.github.io/Glp1Dili/articles/WorkingWithResults.html
# ##############################################################################
library(ShinyAppBuilder)
library(OhdsiShinyModules)
resultsDatabaseSchema <- "results"
# Specify the connection to the results database
resultsConnectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = "postgresql",
server = Sys.getenv("OHDSI_RESULTS_DATABASE_SERVER"),
user = Sys.getenv("OHDSI_RESULTS_DATABASE_USER"),
password = Sys.getenv("OHDSI_RESULTS_DATABASE_PASSWORD")
)
# ADD OR REMOVE MODULES TAILORED TO YOUR STUDY
shinyConfig <- initializeModuleConfig() |>
addModuleConfig(
createDefaultAboutConfig()
) |>
addModuleConfig(
createDefaultDatasourcesConfig()
) |>
addModuleConfig(
createDefaultCohortGeneratorConfig()
) |>
addModuleConfig(
createDefaultCohortDiagnosticsConfig()
) |>
addModuleConfig(
createDefaultCharacterizationConfig()
) |>
addModuleConfig(
createDefaultPredictionConfig()
) |>
addModuleConfig(
createDefaultEstimationConfig()
)
# now create the shiny app based on the config file and view the results
# based on the connection
ShinyAppBuilder::createShinyApp(
config = shinyConfig,
connectionDetails = resultsConnectionDetails,
resultDatabaseSettings = createDefaultResultDatabaseSettings(schema = resultsDatabaseSchema)
)