diff --git a/CodeExcerpts/DerivedTables/GenerateEra.sql b/CodeExcerpts/DerivedTables/GenerateEra.sql index 48fb365..2db0e6f 100644 --- a/CodeExcerpts/DerivedTables/GenerateEra.sql +++ b/CodeExcerpts/DerivedTables/GenerateEra.sql @@ -22,6 +22,31 @@ last revised: Jun 2017 authors: Patrick Ryan, Chris Knoll, Anthony Sena, Vojtech Huser +OHDSI-SQL File Instructions +----------------------------- + + 1. Set parameter name of schema that contains CDMv4 instance + (@SOURCE_CDMV4, @SOURCE_CDMV4_SCHEMA) + 2. Set parameter name of schema that contains CDMv5 instance + (@TARGET_CDMV5, @TARGET_CDMV5_SCHEMA) + 3. Run this script through SqlRender to produce a script that will work in your + source dialect. SqlRender can be found here: https://github.com/OHDSI/SqlRender + 4. Run the script produced by SQL Render on your target RDBDMS. + + File Instructions +------------------------- + + 1. This script will hold a number of placeholders for your CDM V4 and CDMV5 + database/schema. In order to make this file work in your environment, you + should plan to do a global "FIND AND REPLACE" on this file to fill in the + file with values that pertain to your environment. The following are the + tokens you should use when doing your "FIND AND REPLACE" operation: + + + [CMD] + [CDM].[CDMSCHEMA] + + *********************************************************************************/ /* SCRIPT PARAMETERS */ diff --git a/CodeExcerpts/DerivedTables/README.md b/CodeExcerpts/DerivedTables/README.md index 9e92740..cd7bdad 100644 --- a/CodeExcerpts/DerivedTables/README.md +++ b/CodeExcerpts/DerivedTables/README.md @@ -1,3 +1,5 @@ # Derived tables -R script is used to take -parametized.sql and generate -flavor.sql files in flavor folders \ No newline at end of file +R script is used to take parametized sql (in this folder) and generate flavored SQL files (see respective flavor folder) + + diff --git a/CodeExcerpts/DerivedTables/TranslateSnippet.R b/CodeExcerpts/DerivedTables/TranslateSnippet.R index 455df40..e8cfd0f 100644 --- a/CodeExcerpts/DerivedTables/TranslateSnippet.R +++ b/CodeExcerpts/DerivedTables/TranslateSnippet.R @@ -30,6 +30,14 @@ ttb<-SqlRender::translateSql(tta$sql,targetDialect = 'postgresql') cat(ttb$sql,file='c:/temp/drug_era_2017.sql') sql<-ttb$sql + + + + + + +#loop for making flavors + fname<-'GenerateEra.sql' flavors<-c( 'oracle' diff --git a/CodeExcerpts/DerivedTables/impala/GenerateEra.sql b/CodeExcerpts/DerivedTables/impala/GenerateEra.sql index 034d7a5..73a42a0 100644 --- a/CodeExcerpts/DerivedTables/impala/GenerateEra.sql +++ b/CodeExcerpts/DerivedTables/impala/GenerateEra.sql @@ -22,6 +22,31 @@ last revised: Jun 2017 authors: Patrick Ryan, Chris Knoll, Anthony Sena, Vojtech Huser +OHDSI-SQL File Instructions +----------------------------- + + 1. Set parameter name of schema that contains CDMv4 instance + (@SOURCE_CDMV4, @SOURCE_CDMV4_SCHEMA) + 2. Set parameter name of schema that contains CDMv5 instance + ([CDM], [CDM].[CDMSCHEMA]) + 3. Run this script through SqlRender to produce a script that will work in your + source dialect. SqlRender can be found here: https://github.com/OHDSI/SqlRender + 4. Run the script produced by SQL Render on your target RDBDMS. + + File Instructions +------------------------- + + 1. This script will hold a number of placeholders for your CDM V4 and CDMV5 + database/schema. In order to make this file work in your environment, you + should plan to do a global "FIND AND REPLACE" on this file to fill in the + file with values that pertain to your environment. The following are the + tokens you should use when doing your "FIND AND REPLACE" operation: + + + [CMD] + [CDM].[CDMSCHEMA] + + *********************************************************************************/ /* SCRIPT PARAMETERS */ diff --git a/CodeExcerpts/DerivedTables/netezza/GenerateEra.sql b/CodeExcerpts/DerivedTables/netezza/GenerateEra.sql index f57a818..cc0b8d6 100644 --- a/CodeExcerpts/DerivedTables/netezza/GenerateEra.sql +++ b/CodeExcerpts/DerivedTables/netezza/GenerateEra.sql @@ -22,6 +22,31 @@ last revised: Jun 2017 authors: Patrick Ryan, Chris Knoll, Anthony Sena, Vojtech Huser +OHDSI-SQL File Instructions +----------------------------- + + 1. Set parameter name of schema that contains CDMv4 instance + (@SOURCE_CDMV4, @SOURCE_CDMV4_SCHEMA) + 2. Set parameter name of schema that contains CDMv5 instance + ([CDM], [CDM].[CDMSCHEMA]) + 3. Run this script through SqlRender to produce a script that will work in your + source dialect. SqlRender can be found here: https://github.com/OHDSI/SqlRender + 4. Run the script produced by SQL Render on your target RDBDMS. + + File Instructions +------------------------- + + 1. This script will hold a number of placeholders for your CDM V4 and CDMV5 + database/schema. In order to make this file work in your environment, you + should plan to do a global "FIND AND REPLACE" on this file to fill in the + file with values that pertain to your environment. The following are the + tokens you should use when doing your "FIND AND REPLACE" operation: + + + [CMD] + [CDM].[CDMSCHEMA] + + *********************************************************************************/ /* SCRIPT PARAMETERS */ diff --git a/CodeExcerpts/DerivedTables/oracle/GenerateEra.sql b/CodeExcerpts/DerivedTables/oracle/GenerateEra.sql index 3b112f4..0dfc1b3 100644 --- a/CodeExcerpts/DerivedTables/oracle/GenerateEra.sql +++ b/CodeExcerpts/DerivedTables/oracle/GenerateEra.sql @@ -22,6 +22,31 @@ last revised: Jun 2017 authors: Patrick Ryan, Chris Knoll, Anthony Sena, Vojtech Huser +OHDSI-SQL File Instructions +----------------------------- + + 1. Set parameter name of schema that contains CDMv4 instance + (@SOURCE_CDMV4, @SOURCE_CDMV4_SCHEMA) + 2. Set parameter name of schema that contains CDMv5 instance + ([CDM], [CDM].[CDMSCHEMA]) + 3. Run this script through SqlRender to produce a script that will work in your + source dialect. SqlRender can be found here: https://github.com/OHDSI/SqlRender + 4. Run the script produced by SQL Render on your target RDBDMS. + + File Instructions +------------------------- + + 1. This script will hold a number of placeholders for your CDM V4 and CDMV5 + database/schema. In order to make this file work in your environment, you + should plan to do a global "FIND AND REPLACE" on this file to fill in the + file with values that pertain to your environment. The following are the + tokens you should use when doing your "FIND AND REPLACE" operation: + + + [CMD] + [CDM].[CDMSCHEMA] + + *********************************************************************************/ /* SCRIPT PARAMETERS */ diff --git a/CodeExcerpts/DerivedTables/pdw/GenerateEra.sql b/CodeExcerpts/DerivedTables/pdw/GenerateEra.sql index ed658eb..b057b2c 100644 --- a/CodeExcerpts/DerivedTables/pdw/GenerateEra.sql +++ b/CodeExcerpts/DerivedTables/pdw/GenerateEra.sql @@ -22,6 +22,31 @@ last revised: Jun 2017 authors: Patrick Ryan, Chris Knoll, Anthony Sena, Vojtech Huser +OHDSI-SQL File Instructions +----------------------------- + + 1. Set parameter name of schema that contains CDMv4 instance + (@SOURCE_CDMV4, @SOURCE_CDMV4_SCHEMA) + 2. Set parameter name of schema that contains CDMv5 instance + ([CDM], [CDM].[CDMSCHEMA]) + 3. Run this script through SqlRender to produce a script that will work in your + source dialect. SqlRender can be found here: https://github.com/OHDSI/SqlRender + 4. Run the script produced by SQL Render on your target RDBDMS. + + File Instructions +------------------------- + + 1. This script will hold a number of placeholders for your CDM V4 and CDMV5 + database/schema. In order to make this file work in your environment, you + should plan to do a global "FIND AND REPLACE" on this file to fill in the + file with values that pertain to your environment. The following are the + tokens you should use when doing your "FIND AND REPLACE" operation: + + + [CMD] + [CDM].[CDMSCHEMA] + + *********************************************************************************/ /* SCRIPT PARAMETERS */ diff --git a/CodeExcerpts/DerivedTables/postgresql/GenerateEra.sql b/CodeExcerpts/DerivedTables/postgresql/GenerateEra.sql index ebe2b95..58bf22d 100644 --- a/CodeExcerpts/DerivedTables/postgresql/GenerateEra.sql +++ b/CodeExcerpts/DerivedTables/postgresql/GenerateEra.sql @@ -22,6 +22,31 @@ last revised: Jun 2017 authors: Patrick Ryan, Chris Knoll, Anthony Sena, Vojtech Huser +OHDSI-SQL File Instructions +----------------------------- + + 1. Set parameter name of schema that contains CDMv4 instance + (@SOURCE_CDMV4, @SOURCE_CDMV4_SCHEMA) + 2. Set parameter name of schema that contains CDMv5 instance + ([CDM], [CDM].[CDMSCHEMA]) + 3. Run this script through SqlRender to produce a script that will work in your + source dialect. SqlRender can be found here: https://github.com/OHDSI/SqlRender + 4. Run the script produced by SQL Render on your target RDBDMS. + + File Instructions +------------------------- + + 1. This script will hold a number of placeholders for your CDM V4 and CDMV5 + database/schema. In order to make this file work in your environment, you + should plan to do a global "FIND AND REPLACE" on this file to fill in the + file with values that pertain to your environment. The following are the + tokens you should use when doing your "FIND AND REPLACE" operation: + + + [CMD] + [CDM].[CDMSCHEMA] + + *********************************************************************************/ /* SCRIPT PARAMETERS */ diff --git a/CodeExcerpts/DerivedTables/redshift/GenerateEra.sql b/CodeExcerpts/DerivedTables/redshift/GenerateEra.sql index ebe2b95..58bf22d 100644 --- a/CodeExcerpts/DerivedTables/redshift/GenerateEra.sql +++ b/CodeExcerpts/DerivedTables/redshift/GenerateEra.sql @@ -22,6 +22,31 @@ last revised: Jun 2017 authors: Patrick Ryan, Chris Knoll, Anthony Sena, Vojtech Huser +OHDSI-SQL File Instructions +----------------------------- + + 1. Set parameter name of schema that contains CDMv4 instance + (@SOURCE_CDMV4, @SOURCE_CDMV4_SCHEMA) + 2. Set parameter name of schema that contains CDMv5 instance + ([CDM], [CDM].[CDMSCHEMA]) + 3. Run this script through SqlRender to produce a script that will work in your + source dialect. SqlRender can be found here: https://github.com/OHDSI/SqlRender + 4. Run the script produced by SQL Render on your target RDBDMS. + + File Instructions +------------------------- + + 1. This script will hold a number of placeholders for your CDM V4 and CDMV5 + database/schema. In order to make this file work in your environment, you + should plan to do a global "FIND AND REPLACE" on this file to fill in the + file with values that pertain to your environment. The following are the + tokens you should use when doing your "FIND AND REPLACE" operation: + + + [CMD] + [CDM].[CDMSCHEMA] + + *********************************************************************************/ /* SCRIPT PARAMETERS */