Hello Katy and Fabricio, first of all thank you for your answers, they are very helpful. Sorry for the delay in responding, we have been trying ways to solve the problem and Christmas has come.
We are still having problems connecting to the server.
Here is a list of the changes we have made:
As Fabricio indicates, we have verified that the server is open and working. We have also assigned a path to the folder where the driver is located. The driver we have installed is the one provided by postgresql on its website (Download | pgJDBC).
Below I attach the script and the error that we get.
Thank you very much for your help, have a nice day!
#Script to analyze the quality of the OMOP database using the DataQualityDashboard library
#The RJDBC package is an implementation of R’s DBI (DataBase Interface) using JDBC (Java Database Connectivity) as a back-end.
#This allows R to connect to any DBMS (Database Management System) that has a JDBC driver.
install.packages(“RJDBC”)
library(RJDBC)
#We assign a path to the installed driver (Download | pgJDBC)
drv = JDBC (driverClass = “org.postgresql.Driver”, classPath = “C:/Users/BRACONS/Downloads/driver/postgresql-42.5.1.jar”, identifier.quote = NA)
#We make the connection, in the function we give the link, the name of the database and the password
conn = dbConnect(drv, “jdbc:postgresql://localhost:5432/postgres”, “ddbbname”, “password”)
#Package to perform DataQualityDashboard (Fix for error trying to install Data Quality Dashboard)
install.packages(“devtools”)
devtools::install_github(“OHDSI/DataQualityDashboard”)
library(DataQualityDashboard)
library(DatabaseConnector)
connectionDetails ← DatabaseConnector::createConnectionDetails(
dbms = “postgresql”,
user = “postgres”,
password = “password”,
server = “covid/postgres”,
port = “5432”,
extraSettings = “”,
pathToDriver = “C:/Users/BRACONS/Downloads/driver”
)
cdmDatabaseSchema ← “public” # the fully qualified database schema name of the CDM
resultsDatabaseSchema ← “public” # the fully qualified database schema name of the results schema (that you can write to)
cdmSourceName ← “COVID HCB OMOP” # a human readable name for your CDM source
cdmVersion ← “5.4” # the CDM version you are targetting. Currently supporst 5.2.2, 5.3.1, and 5.4
determine how many threads (concurrent SQL sessions) to use ----------------------------------------
numThreads ← 1 # on Redshift, 3 seems to work well
specify if you want to execute the queries or inspect them ------------------------------------------
sqlOnly ← FALSE # set to TRUE if you just want to get the SQL scripts and not actually run the queries
where should the results and logs go? ----------------------------------------------------------------
outputFolder ← “C:/Users/BRACONS/Downloads/resultados”
outputFile ← “results.json”
logging type -------------------------------------------------------------------------------------
verboseMode ← TRUE # set to FALSE if you don’t want the logs to be printed to the console
write results to table? -----------------------------------------------------------------------
writeToTable ← FALSE # set to TRUE if you want to write to a SQL table in the results schema
write results to a csv file? -----------------------------------------------------------------------
writeToCsv ← FALSE # set to FALSE if you want to skip writing to csv file
csvFile ← “” # only needed if writeToCsv is set to TRUE
if writing to table and using Redshift, bulk loading can be initialized -------------------------------
Sys.setenv(“AWS_ACCESS_KEY_ID” = “”,
“AWS_SECRET_ACCESS_KEY” = “”,
“AWS_DEFAULT_REGION” = “”,
“AWS_BUCKET_NAME” = “”,
“AWS_OBJECT_KEY” = “”,
“AWS_SSE_TYPE” = “AES256”,
“USE_MPP_BULK_LOAD” = TRUE)
which DQ check levels to run -------------------------------------------------------------------
checkLevels ← c(“TABLE”, “FIELD”, “CONCEPT”)
which DQ checks to run? ------------------------------------
checkNames ← c() #Names can be found in inst/csv/OMOP_CDM_v5.3.1_Check_Desciptions.csv
which CDM tables to exclude? ------------------------------------
tablesToExclude ← c()
#Aqui es donde no puedo realizar la conexión
run the job --------------------------------------------------------------------------------------
DataQualityDashboard::executeDqChecks(connectionDetails = connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
resultsDatabaseSchema = resultsDatabaseSchema,
cdmSourceName = cdmSourceName,
numThreads = numThreads,
sqlOnly = sqlOnly,
outputFolder = outputFolder,
verboseMode = verboseMode,
writeToTable = writeToTable,
writeToCsv = writeToCsv,
csvFile = csvFile,
checkLevels = checkLevels,
tablesToExclude = tablesToExclude,
checkNames = checkNames)
inspect logs ----------------------------------------------------------------------------
ParallelLogger::launchLogViewer(logFileName = file.path(outputFolder,
sprintf(“log_DqDashboard_%s.txt”, cdmSourceName)))
View the Data Quality Dashboard using the integrated shiny application
DataQualityDashboard::viewDqDashboard(
jsonPath = file.path(getwd(), outputFolder, outputFile))
)
(OPTIONAL) if you want to write the JSON file to the results table separately -----------------------------
jsonFilePath ← “” # put the path to the outputted JSON file
DataQualityDashboard::writeJsonResultsToTable(connectionDetails = connectionDetails,
resultsDatabaseSchema = resultsDatabaseSchema,
jsonFilePath = jsonFilePath)