OHDSI Home | Forums | Wiki | Github

Patient level prediction Package no connection

Hi all,

I developed a Targeted and Outcome cohort using Atlas. I followed the instructions to customize the R-package but I receive every time an error while I can successfully build the package. For example, in the CodeToRun.R function I receive an error that there is no file called “setting.csv” if I want the argument createShiny = T in the function execute. If I leave createShiny = F and follow the instructions in the readme.md file I receive the error that the connection (org.postgresql.util.PSQLException) failed. However, I can access the database with my credentials in Jupyter Notebook.

I feel like I am missing something and I hope someone can help me.

Thank you in advance!

Sebastiaan

BTW, this is specified in my logs.txt

2021-03-02 10:16:08 [Main thread] INFO ERSPCdiagnosisdeath execute Creating cohorts
2021-03-02 10:16:08 [Main thread] FATAL rJava .jcheck Error in rJava::.jcall(jdbcDriver, “Ljava/sql/Connection;”, “connect”, : org.postgresql.util.PSQLException: The connection attempt failed.
2021-03-02 10:19:41 [Main thread] WARN utils read.table cannot open file ‘./ERSPCdiagnosisdeathResults/settings.csv’: No such file or directory
2021-03-02 10:19:41 [Main thread] WARN utils read.table cannot open file ‘./ERSPCdiagnosisdeathResults/settings.csv’: No such file or directory
2021-03-02 10:19:41 [Main thread] FATAL utils read.table Error in file(file, “rt”) : cannot open the connection
2021-03-02 10:19:41 [Main thread] FATAL utils read.table Error in file(file, “rt”) : cannot open the connection
2021-03-02 10:21:45 [Main thread] INFO ERSPCdiagnosisdeath execute Creating cohorts
2021-03-02 10:21:45 [Main thread] INFO ERSPCdiagnosisdeath execute Creating cohorts
2021-03-02 10:21:45 [Main thread] INFO ERSPCdiagnosisdeath execute Creating cohorts
2021-03-02 10:21:45 [Main thread] FATAL rJava .jcheck Error in rJava::.jcall(jdbcDriver, “Ljava/sql/Connection;”, “connect”, : org.postgresql.util.PSQLException: The connection attempt failed.
2021-03-02 10:21:45 [Main thread] FATAL rJava .jcheck Error in rJava::.jcall(jdbcDriver, “Ljava/sql/Connection;”, “connect”, : org.postgresql.util.PSQLException: The connection attempt failed.
2021-03-02 10:21:45 [Main thread] FATAL rJava .jcheck Error in rJava::.jcall(jdbcDriver, “Ljava/sql/Connection;”, “connect”, : org.postgresql.util.PSQLException: The connection attempt failed.

Hi, It seems to be because the shiny data folder is not created. Would you like to change the populateShinyApp.R code as shown below and rebuild it?

image

And - do you get an error when running the “PatientLevelPrediction::viewMultiplePlp(outputFolder)” code with createShiny = F? It can show the model results with this function whether or not doing the createShiny function.

Hi,

Thank you for your fast reply! Unfortunately, this does not work properly.
If I do createShiny = T, the error is that there is no write permission for directory.
If I do cheateShiny = F, the error is “Error in checkPlpInput(result) : Incorrect class for input result”

I am running the package on my own computer, so rights and permissions shouldn’t be an issue.

I hope you have another possibility to solve this issue.

Attached is the log,

2021-03-02 13:27:48 [Main thread] FATAL ERSPCdiagnosisdeath populateShinyApp Error in file.path(outputDirectory, “data”) : object ‘outputDirectory’ not found
2021-03-02 13:45:01 [Main thread] WARN utils download.file cannot open URL ‘https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES.rds’: HTTP status was ‘404 Not Found’
2021-03-02 13:45:01 [Main thread] WARN utils download.file cannot open URL ‘https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES.rds’: HTTP status was ‘404 Not Found’

I think the issue is using a relative path rather than absolute (e.g., ‘./myfolder’) - make the path absolute and I think it will work

t