Hi again,
I am trying to use the computeMdrr function of the MethodEvaluation R package.
I can connect to my PostgreSQL server: I can list all tables in the database schema with the getTableNames function.
I am using the following script
library(DatabaseConnector)
connectionDetails<-createConnectionDetails(dbms = “postgresql”,
user = “test”,
password = “test”,
server = “10.2.4.148/postgres”,
schema = “alcapone”)
cdmDatabaseSchema<-“alcapone”
RefSet =read.table("/Users/thurin/Documents/R/Alcapone/Reference_set/R_ref_set_v0.4.csv", sep = “;”, header = TRUE)
cdmVersion<-“5”
library(MethodEvaluation)
MDRR<- computeMdrr(connectionDetails, cdmDatabaseSchema, exposureOutcomePairs=RefSet,
exposureDatabaseSchema = cdmDatabaseSchema, exposureTable = “drug_era”,
outcomeDatabaseSchema = cdmDatabaseSchema, outcomeTable = “cohort”,
cdmVersion = cdmVersion)
and I get this message:
Connecting using PostgreSQL driver
Computing minimumum detectable relative risks. This could take a while
|========== | 9%Error executing SQL: Error in .local(conn, statement, …): execute JDBC update query failed in dbSendUpdate (ERROR: syntax error at or near “)”
Position : 389)
An error report has been created at /Users/thurin/Documents/R/Alcapone/errorReport.txt
Error in value[3L] : no loop for break/next, jumping to top level
with this error report
DBMS:
postgresql
Error:
execute JDBC update query failed in dbSendUpdate (ERROR: syntax error at or near “)”
Position : 389)
SQL:
CREATE TEMP TABLE drug_prev_count
AS
SELECT
drug_concept_id AS drug_concept_id,
FLOOR((EXTRACT(YEAR FROM drug_era_start_date) - year_of_birth) / 10) AS age_group,
gender_concept_id,
COUNT(person.person_id) AS person_count
FROM
(
SELECT person_id AS person_id,
drug_concept_id,
MIN(drug_era_start_date) AS drug_era_start_date
FROM alcapone.drug_era
WHERE drug_concept_id IN ()
GROUP BY person_id,
drug_concept_id
) persons_with_drug
INNER JOIN person person
ON persons_with_drug.person_id = person.person_id
GROUP BY drug_concept_id,
FLOOR((EXTRACT(YEAR FROM drug_era_start_date) - year_of_birth) / 10),
gender_concept_id
R version:
R version 3.3.2 (2016-10-31)
Platform:
x86_64-apple-darwin13.4.0
Attached base packages:
- stats
- graphics
- grDevices
- utils
- datasets
- methods
- base
Other attached packages:
- MethodEvaluation (0.0.3)
- Cyclops (1.2.3)
- FeatureExtraction (1.0.2)
- DatabaseConnector (1.9.2)
- RJDBC (0.2-5)
- rJava (0.9-8)
- DBI (0.5-1)
Does someone know what is going wrong ?
Thank you for you help