From a4834a1991bb0e72761cc7473f5c7965bce21bce Mon Sep 17 00:00:00 2001 From: schuemie Date: Wed, 13 Dec 2017 09:08:16 +0100 Subject: [PATCH] Adding cdmDatabaseSchema parameter to TRUNACTE and lookup queries --- src/org/ohdsi/rabbitInAHat/ETLTestFrameWorkGenerator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/ohdsi/rabbitInAHat/ETLTestFrameWorkGenerator.java b/src/org/ohdsi/rabbitInAHat/ETLTestFrameWorkGenerator.java index 0b14f9a0..21b622ba 100644 --- a/src/org/ohdsi/rabbitInAHat/ETLTestFrameWorkGenerator.java +++ b/src/org/ohdsi/rabbitInAHat/ETLTestFrameWorkGenerator.java @@ -58,7 +58,7 @@ public class ETLTestFrameWorkGenerator { public static void main(String[] args) { ETL etl = ETL.fromFile("C:\\Home\\Research\\ETLs\\JMDC ETL\\JMDC ETL CDMv5\\JMDC to CDMv5 ETL v08.json.gz", FileFormat.GzipJson); ETLTestFrameWorkGenerator generator = new ETLTestFrameWorkGenerator(); - generator.generate(etl, "c:/temp/tf.R"); + generator.generate(etl, "C:\\Home\\Research\\ETLs\\JMDC ETL\\JMDC ETL CDMv5\\JmdcTestFramework.R"); } public ETLTestFrameWorkGenerator() { @@ -273,7 +273,7 @@ protected void createLookupFunctions() { line.append(") {"); r.add(line.toString()); line = new StringBuilder(); - line.append(" statement <- paste0('SELECT ', fetchField , ' FROM "); + line.append(" statement <- paste0('SELECT ', fetchField , ' FROM @cdm_database_schema."); line.append(sqlTableName); line.append(" WHERE')"); r.add(line.toString()); @@ -305,7 +305,7 @@ protected void createGenerateInsertSqlFunction() { r.add(" insertSql <- c()"); for (Table table : sourceDb.getTables()) if (!table.isStem()) - r.add(" insertSql <- c(insertSql, \"TRUNCATE TABLE " + convertToSqlName(table.getName()) + ";\")"); + r.add(" insertSql <- c(insertSql, \"TRUNCATE TABLE @cdm_database_schema." + convertToSqlName(table.getName()) + ";\")"); r.add(" createInsertStatement <- function(insert, env) {"); r.add(" s <- c()"); r.add(" if (env$testId != insert$testId) {");