From df9e11a2d59097b4e5fa11868810a447e6b95f93 Mon Sep 17 00:00:00 2001 From: clairblacketer Date: Tue, 2 Oct 2018 09:50:48 -0400 Subject: [PATCH] Updated files to include optional vocabulary version and datetimes in era tables --- Netezza/OMOP CDM netezza ddl.txt | 42 +++++++++--------- Oracle/OMOP CDM oracle ddl.txt | 42 +++++++++--------- ParallelDataWarehouse/OMOP CDM pdw ddl.txt | 44 +++++++++---------- PostgreSQL/OMOP CDM postgresql ddl.txt | 42 +++++++++--------- Redshift/OMOP CDM redshift ddl.txt | 50 +++++++++++----------- Sql Server/OMOP CDM sql server ddl.txt | 42 +++++++++--------- 6 files changed, 131 insertions(+), 131 deletions(-) diff --git a/Netezza/OMOP CDM netezza ddl.txt b/Netezza/OMOP CDM netezza ddl.txt index a37a69d..a6a743b 100644 --- a/Netezza/OMOP CDM netezza ddl.txt +++ b/Netezza/OMOP CDM netezza ddl.txt @@ -64,7 +64,7 @@ CREATE TABLE vocabulary ( vocabulary_id VARCHAR(20) NOT NULL, vocabulary_name VARCHAR(255) NOT NULL, vocabulary_reference VARCHAR(255) NOT NULL, - vocabulary_version VARCHAR(255) NOT NULL, + vocabulary_version VARCHAR(255) NULL, vocabulary_concept_id INTEGER NOT NULL ) DISTRIBUTE ON RANDOM @@ -736,13 +736,13 @@ Standardized derived elements --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE drug_era ( - drug_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - drug_era_start_date DATE NOT NULL , - drug_era_end_date DATE NOT NULL , - drug_exposure_count INTEGER NULL , - gap_days INTEGER NULL + drug_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + drug_era_start_datetime DATETIME NOT NULL , + drug_era_end_datetime DATETIME NOT NULL , + drug_exposure_count INTEGER NULL , + gap_days INTEGER NULL ) DISTRIBUTE ON (person_id) ; @@ -751,13 +751,13 @@ DISTRIBUTE ON (person_id) --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE dose_era ( - dose_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - unit_concept_id INTEGER NOT NULL , - dose_value REAL NOT NULL , - dose_era_start_date DATE NOT NULL , - dose_era_end_date DATE NOT NULL + dose_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + unit_concept_id INTEGER NOT NULL , + dose_value REAL NOT NULL , + dose_era_start_datetime DATETIME NOT NULL , + dose_era_end_datetime DATETIME NOT NULL ) DISTRIBUTE ON (person_id) ; @@ -766,12 +766,12 @@ DISTRIBUTE ON (person_id) --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE condition_era ( - condition_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - condition_concept_id INTEGER NOT NULL , - condition_era_start_date DATE NOT NULL , - condition_era_end_date DATE NOT NULL , - condition_occurrence_count INTEGER NULL + condition_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + condition_concept_id INTEGER NOT NULL , + condition_era_start_datetime DATETIME NOT NULL , + condition_era_end_datetime DATETIME NOT NULL , + condition_occurrence_count INTEGER NULL ) DISTRIBUTE ON (person_id) ; diff --git a/Oracle/OMOP CDM oracle ddl.txt b/Oracle/OMOP CDM oracle ddl.txt index 79cfb16..c78116a 100644 --- a/Oracle/OMOP CDM oracle ddl.txt +++ b/Oracle/OMOP CDM oracle ddl.txt @@ -63,7 +63,7 @@ CREATE TABLE vocabulary ( vocabulary_id VARCHAR(20) NOT NULL, vocabulary_name VARCHAR(255) NOT NULL, vocabulary_reference VARCHAR(255) NOT NULL, - vocabulary_version VARCHAR(255) NOT NULL, + vocabulary_version VARCHAR(255) NULL, vocabulary_concept_id INTEGER NOT NULL ) ; @@ -704,13 +704,13 @@ Standardized derived elements --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE drug_era ( - drug_era_id NUMBER(19) NOT NULL , - person_id NUMBER(19) NOT NULL , - drug_concept_id INTEGER NOT NULL , - drug_era_start_date DATE NOT NULL , - drug_era_end_date DATE NOT NULL , - drug_exposure_count INTEGER NULL , - gap_days INTEGER NULL + drug_era_id NUMBER(19) NOT NULL , + person_id NUMBER(19) NOT NULL , + drug_concept_id INTEGER NOT NULL , + drug_era_start_datetime TIMESTAMP NOT NULL , + drug_era_end_datetime TIMESTAMP NOT NULL , + drug_exposure_count INTEGER NULL , + gap_days INTEGER NULL ) ; @@ -718,13 +718,13 @@ CREATE TABLE drug_era --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE dose_era ( - dose_era_id NUMBER(19) NOT NULL , - person_id NUMBER(19) NOT NULL , - drug_concept_id INTEGER NOT NULL , - unit_concept_id INTEGER NOT NULL , - dose_value FLOAT NOT NULL , - dose_era_start_date DATE NOT NULL , - dose_era_end_date DATE NOT NULL + dose_era_id NUMBER(19) NOT NULL , + person_id NUMBER(19) NOT NULL , + drug_concept_id INTEGER NOT NULL , + unit_concept_id INTEGER NOT NULL , + dose_value FLOAT NOT NULL , + dose_era_start_datetime TIMESTAMP NOT NULL , + dose_era_end_datetime TIMESTAMP NOT NULL ) ; @@ -732,11 +732,11 @@ CREATE TABLE dose_era --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE condition_era ( - condition_era_id NUMBER(19) NOT NULL , - person_id NUMBER(19) NOT NULL , - condition_concept_id INTEGER NOT NULL , - condition_era_start_date DATE NOT NULL , - condition_era_end_date DATE NOT NULL , - condition_occurrence_count INTEGER NULL + condition_era_id NUMBER(19) NOT NULL , + person_id NUMBER(19) NOT NULL , + condition_concept_id INTEGER NOT NULL , + condition_era_start_datetime TIMESTAMP NOT NULL , + condition_era_end_datetime TIMESTAMP NOT NULL , + condition_occurrence_count INTEGER NULL ) ; diff --git a/ParallelDataWarehouse/OMOP CDM pdw ddl.txt b/ParallelDataWarehouse/OMOP CDM pdw ddl.txt index 2a12c1a..93db1ab 100644 --- a/ParallelDataWarehouse/OMOP CDM pdw ddl.txt +++ b/ParallelDataWarehouse/OMOP CDM pdw ddl.txt @@ -65,8 +65,8 @@ vocabulary ( vocabulary_id VARCHAR(20) NOT NULL, vocabulary_name VARCHAR(255) NOT NULL, vocabulary_reference VARCHAR(255) NOT NULL, - vocabulary_version VARCHAR(255) NOT NULL, - vocabulary_concept_id INTEGER NOT NULL + vocabulary_version VARCHAR(255) NULL, + vocabulary_concept_id INTEGER NOT NULL ) WITH (DISTRIBUTION = REPLICATE); @@ -714,13 +714,13 @@ Standardized derived elements --HINT DISTRIBUTE_ON_KEY(person_id) IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_era ( - drug_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - drug_era_start_date DATE NOT NULL , - drug_era_end_date DATE NOT NULL , - drug_exposure_count INTEGER NULL , - gap_days INTEGER NULL + drug_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + drug_era_start_datetime DATETIME2 NOT NULL , + drug_era_end_datetime DATETIME2 NOT NULL , + drug_exposure_count INTEGER NULL , + gap_days INTEGER NULL ) WITH (DISTRIBUTION = HASH(person_id)); @@ -728,13 +728,13 @@ WITH (DISTRIBUTION = HASH(person_id)); --HINT DISTRIBUTE_ON_KEY(person_id) IF XACT_STATE() = 1 COMMIT; CREATE TABLE dose_era ( - dose_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - unit_concept_id INTEGER NOT NULL , - dose_value FLOAT NOT NULL , - dose_era_start_date DATE NOT NULL , - dose_era_end_date DATE NOT NULL + dose_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + unit_concept_id INTEGER NOT NULL , + dose_value FLOAT NOT NULL , + dose_era_start_datetime DATETIME2 NOT NULL , + dose_era_end_datetime DATETIME2 NOT NULL ) WITH (DISTRIBUTION = HASH(person_id)); @@ -742,11 +742,11 @@ WITH (DISTRIBUTION = HASH(person_id)); --HINT DISTRIBUTE_ON_KEY(person_id) IF XACT_STATE() = 1 COMMIT; CREATE TABLE condition_era ( - condition_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - condition_concept_id INTEGER NOT NULL , - condition_era_start_date DATE NOT NULL , - condition_era_end_date DATE NOT NULL , - condition_occurrence_count INTEGER NULL + condition_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + condition_concept_id INTEGER NOT NULL , + condition_era_start_datetime DATETIME2 NOT NULL , + condition_era_end_datetime DATETIME2 NOT NULL , + condition_occurrence_count INTEGER NULL ) WITH (DISTRIBUTION = HASH(person_id)); diff --git a/PostgreSQL/OMOP CDM postgresql ddl.txt b/PostgreSQL/OMOP CDM postgresql ddl.txt index 23f0d6f..070881c 100644 --- a/PostgreSQL/OMOP CDM postgresql ddl.txt +++ b/PostgreSQL/OMOP CDM postgresql ddl.txt @@ -63,7 +63,7 @@ CREATE TABLE vocabulary ( vocabulary_id VARCHAR(20) NOT NULL, vocabulary_name VARCHAR(255) NOT NULL, vocabulary_reference VARCHAR(255) NOT NULL, - vocabulary_version VARCHAR(255) NOT NULL, + vocabulary_version VARCHAR(255) NULL, vocabulary_concept_id INTEGER NOT NULL ) ; @@ -729,13 +729,13 @@ Standardized derived elements --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE drug_era ( - drug_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - drug_era_start_date DATE NOT NULL , - drug_era_end_date DATE NOT NULL , - drug_exposure_count INTEGER NULL , - gap_days INTEGER NULL + drug_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + drug_era_start_datetime TIMESTAMP NOT NULL , + drug_era_end_datetime TIMESTAMP NOT NULL , + drug_exposure_count INTEGER NULL , + gap_days INTEGER NULL ) ; @@ -743,13 +743,13 @@ CREATE TABLE drug_era --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE dose_era ( - dose_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - unit_concept_id INTEGER NOT NULL , - dose_value NUMERIC NOT NULL , - dose_era_start_date DATE NOT NULL , - dose_era_end_date DATE NOT NULL + dose_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + unit_concept_id INTEGER NOT NULL , + dose_value NUMERIC NOT NULL , + dose_era_start_datetime TIMESTAMP NOT NULL , + dose_era_end_datetime TIMESTAMP NOT NULL ) ; @@ -757,11 +757,11 @@ CREATE TABLE dose_era --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE condition_era ( - condition_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - condition_concept_id INTEGER NOT NULL , - condition_era_start_date DATE NOT NULL , - condition_era_end_date DATE NOT NULL , - condition_occurrence_count INTEGER NULL + condition_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + condition_concept_id INTEGER NOT NULL , + condition_era_start_datetime TIMESTAMP NOT NULL , + condition_era_end_datetime TIMESTAMP NOT NULL , + condition_occurrence_count INTEGER NULL ) ; diff --git a/Redshift/OMOP CDM redshift ddl.txt b/Redshift/OMOP CDM redshift ddl.txt index d86f1d5..9f586d1 100644 --- a/Redshift/OMOP CDM redshift ddl.txt +++ b/Redshift/OMOP CDM redshift ddl.txt @@ -63,7 +63,7 @@ CREATE TABLE vocabulary ( vocabulary_id VARCHAR(20) NOT NULL, vocabulary_name VARCHAR(255) NOT NULL, vocabulary_reference VARCHAR(255) NOT NULL, - vocabulary_version VARCHAR(255) NOT NULL, + vocabulary_version VARCHAR(255) NULL, vocabulary_concept_id INTEGER NOT NULL ) DISTSTYLE ALL; @@ -122,10 +122,10 @@ DISTSTYLE ALL; --HINT DISTRIBUTE ON RANDOM CREATE TABLE concept_ancestor ( -ancestor_concept_id INTEGER NOT NULL, - descendant_concept_id INTEGER NOT NULL, - min_levels_of_separation INTEGER NOT NULL, - max_levels_of_separation INTEGER NOT NULL + ancestor_concept_id INTEGER NOT NULL, + descendant_concept_id INTEGER NOT NULL, + min_levels_of_separation INTEGER NOT NULL, + max_levels_of_separation INTEGER NOT NULL ) DISTSTYLE ALL; @@ -680,37 +680,37 @@ Standardized derived elements --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE drug_era ( - drug_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - drug_era_start_date DATE NOT NULL , - drug_era_end_date DATE NOT NULL , - drug_exposure_count INTEGER NULL , - gap_days INTEGER NULL + drug_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + drug_era_start_datetime TIMESTAMP NOT NULL , + drug_era_end_datetime TIMESTAMP NOT NULL , + drug_exposure_count INTEGER NULL , + gap_days INTEGER NULL ) DISTKEY(person_id); --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE dose_era ( - dose_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - unit_concept_id INTEGER NOT NULL , - dose_value FLOAT NOT NULL , - dose_era_start_date DATE NOT NULL , - dose_era_end_date DATE NOT NULL + dose_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + unit_concept_id INTEGER NOT NULL , + dose_value FLOAT NOT NULL , + dose_era_start_datetime TIMESTAMP NOT NULL , + dose_era_end_datetime TIMESTAMP NOT NULL ) DISTKEY(person_id); --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE condition_era ( - condition_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - condition_concept_id INTEGER NOT NULL , - condition_era_start_date DATE NOT NULL , - condition_era_end_date DATE NOT NULL , - condition_occurrence_count INTEGER NULL + condition_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + condition_concept_id INTEGER NOT NULL , + condition_era_start_datetime TIMESTAMP NOT NULL , + condition_era_end_datetime TIMESTAMP NOT NULL , + condition_occurrence_count INTEGER NULL ) DISTKEY(person_id); diff --git a/Sql Server/OMOP CDM sql server ddl.txt b/Sql Server/OMOP CDM sql server ddl.txt index 0bfc7c5..923cd6e 100644 --- a/Sql Server/OMOP CDM sql server ddl.txt +++ b/Sql Server/OMOP CDM sql server ddl.txt @@ -63,7 +63,7 @@ CREATE TABLE vocabulary ( vocabulary_id VARCHAR(20) NOT NULL, vocabulary_name VARCHAR(255) NOT NULL, vocabulary_reference VARCHAR(255) NOT NULL, - vocabulary_version VARCHAR(255) NOT NULL, + vocabulary_version VARCHAR(255) NULL, vocabulary_concept_id INTEGER NOT NULL ) ; @@ -704,13 +704,13 @@ Standardized derived elements --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE drug_era ( - drug_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - drug_era_start_date DATE NOT NULL , - drug_era_end_date DATE NOT NULL , - drug_exposure_count INTEGER NULL , - gap_days INTEGER NULL + drug_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + drug_era_start_datetime DATETIME2 NOT NULL , + drug_era_end_datetime DATETIME2 NOT NULL , + drug_exposure_count INTEGER NULL , + gap_days INTEGER NULL ) ; @@ -718,13 +718,13 @@ CREATE TABLE drug_era --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE dose_era ( - dose_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - drug_concept_id INTEGER NOT NULL , - unit_concept_id INTEGER NOT NULL , - dose_value FLOAT NOT NULL , - dose_era_start_date DATE NOT NULL , - dose_era_end_date DATE NOT NULL + dose_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + drug_concept_id INTEGER NOT NULL , + unit_concept_id INTEGER NOT NULL , + dose_value FLOAT NOT NULL , + dose_era_start_datetime DATETIME2 NOT NULL , + dose_era_end_datetime DATETIME2 NOT NULL ) ; @@ -732,11 +732,11 @@ CREATE TABLE dose_era --HINT DISTRIBUTE_ON_KEY(person_id) CREATE TABLE condition_era ( - condition_era_id BIGINT NOT NULL , - person_id BIGINT NOT NULL , - condition_concept_id INTEGER NOT NULL , - condition_era_start_date DATE NOT NULL , - condition_era_end_date DATE NOT NULL , - condition_occurrence_count INTEGER NULL + condition_era_id BIGINT NOT NULL , + person_id BIGINT NOT NULL , + condition_concept_id INTEGER NOT NULL , + condition_era_start_datetime DATETIME2 NOT NULL , + condition_era_end_datetime DATETIME2 NOT NULL , + condition_occurrence_count INTEGER NULL ) ;