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)