OHDSI Home | Forums | Wiki | Github

Issue with running population level effect estimation R study package

Hello OHDSI community. I am trying to run an R study package generated in the population level estimation. When running the execute function.

** ERROR IN CONSOLE **

Error in execute(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, :
1 assertions failed:

  • Variable ‘dbms’: Must be element of set {‘sql server’, ‘oracle’, ‘postgresql’, ‘pdw’, ‘impala’, ‘netezza’, ‘bigquery’, ‘spark’, ‘sqlite’, ‘redshift’, ‘hive’, ‘sqlite extended’}, but types do not match (character != factor).

** CODE EXECUTED **

#Set and view environment variable
Sys.setenv(“DATABASECONNECTOR_JAR_FOLDER” = “/home/ohdsi/JDBC/”)
Sys.getenv(“DATABASECONNECTOR_JAR_FOLDER”)
downloadJdbcDrivers(“postgresql”)

Database connection string

connectionDetails ← createConnectionDetails(
dbms = “postgresql”,
server=“localhost/omop”,
user="**",
password="****",
port=“5432”,
pathToDriver ="/home/ohdsi/JDBC/" )

oracleTempSchema ← NULL
options(andromedaTempFolder= “/home/ohdsi/temp/”)

execute(connectionDetails = connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
cohortDatabaseSchema = cohortDatabaseSchema,
cohortTable = cohortTable,
oracleTempSchema = oracleTempSchema,
outputFolder = outputFolder,
databaseId = databaseId,
databaseName = databaseName,
createCohorts = TRUE,
synthesizePositiveControls = FALSE,
runAnalyses = TRUE,
packageResults = TRUE,
maxCores = 1)

  • I have downloaded the postgresql driver and the .jar file is available in the path to driver
  • Specified “postgresql” in the connection string
  • Run the execute function

Correct me if I am wrong, Thank you in advance.

Sorry about that. This is a know issue with the current version of SqlRender in combination with R versions < 4. Either upgrade R or install the latest version from the SqlRender develop branch.

Thank you @schuemie. Uninstalled the SqlRender package and installed it from GitHub. Now its working

install.packages(“remotes”)
remotes::install_github(“ohdsi/SqlRender”, ref = “develop”)

Hope this will help post will others.

I just released SqlRender 1.9.2., which includes this bugfix.

t