Updated files to include optional vocabulary version and datetimes in era tables

This commit is contained in:
clairblacketer 2018-10-02 09:50:48 -04:00
parent 046feb3fea
commit df9e11a2d5
6 changed files with 131 additions and 131 deletions

View File

@ -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
@ -739,8 +739,8 @@ 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_era_start_datetime DATETIME NOT NULL ,
drug_era_end_datetime DATETIME NOT NULL ,
drug_exposure_count INTEGER NULL ,
gap_days INTEGER NULL
)
@ -756,8 +756,8 @@ CREATE TABLE dose_era
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_start_datetime DATETIME NOT NULL ,
dose_era_end_datetime DATETIME NOT NULL
)
DISTRIBUTE ON (person_id)
;
@ -769,8 +769,8 @@ 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_era_start_datetime DATETIME NOT NULL ,
condition_era_end_datetime DATETIME NOT NULL ,
condition_occurrence_count INTEGER NULL
)
DISTRIBUTE ON (person_id)

View File

@ -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
)
;
@ -707,8 +707,8 @@ 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_era_start_datetime TIMESTAMP NOT NULL ,
drug_era_end_datetime TIMESTAMP NOT NULL ,
drug_exposure_count INTEGER NULL ,
gap_days INTEGER NULL
)
@ -723,8 +723,8 @@ CREATE TABLE dose_era
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_start_datetime TIMESTAMP NOT NULL ,
dose_era_end_datetime TIMESTAMP NOT NULL
)
;
@ -735,8 +735,8 @@ 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_era_start_datetime TIMESTAMP NOT NULL ,
condition_era_end_datetime TIMESTAMP NOT NULL ,
condition_occurrence_count INTEGER NULL
)
;

View File

@ -65,7 +65,7 @@ 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
)
WITH (DISTRIBUTION = REPLICATE);
@ -717,8 +717,8 @@ 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_era_start_datetime DATETIME2 NOT NULL ,
drug_era_end_datetime DATETIME2 NOT NULL ,
drug_exposure_count INTEGER NULL ,
gap_days INTEGER NULL
)
@ -733,8 +733,8 @@ dose_era (
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_start_datetime DATETIME2 NOT NULL ,
dose_era_end_datetime DATETIME2 NOT NULL
)
WITH (DISTRIBUTION = HASH(person_id));
@ -745,8 +745,8 @@ 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_era_start_datetime DATETIME2 NOT NULL ,
condition_era_end_datetime DATETIME2 NOT NULL ,
condition_occurrence_count INTEGER NULL
)
WITH (DISTRIBUTION = HASH(person_id));

View File

@ -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
)
;
@ -732,8 +732,8 @@ 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_era_start_datetime TIMESTAMP NOT NULL ,
drug_era_end_datetime TIMESTAMP NOT NULL ,
drug_exposure_count INTEGER NULL ,
gap_days INTEGER NULL
)
@ -748,8 +748,8 @@ CREATE TABLE dose_era
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_start_datetime TIMESTAMP NOT NULL ,
dose_era_end_datetime TIMESTAMP NOT NULL
)
;
@ -760,8 +760,8 @@ 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_era_start_datetime TIMESTAMP NOT NULL ,
condition_era_end_datetime TIMESTAMP NOT NULL ,
condition_occurrence_count INTEGER NULL
)
;

View File

@ -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;
@ -683,8 +683,8 @@ 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_era_start_datetime TIMESTAMP NOT NULL ,
drug_era_end_datetime TIMESTAMP NOT NULL ,
drug_exposure_count INTEGER NULL ,
gap_days INTEGER NULL
)
@ -698,8 +698,8 @@ CREATE TABLE dose_era (
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_start_datetime TIMESTAMP NOT NULL ,
dose_era_end_datetime TIMESTAMP NOT NULL
)
DISTKEY(person_id);
@ -709,8 +709,8 @@ 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_era_start_datetime TIMESTAMP NOT NULL ,
condition_era_end_datetime TIMESTAMP NOT NULL ,
condition_occurrence_count INTEGER NULL
)
DISTKEY(person_id);

View File

@ -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
)
;
@ -707,8 +707,8 @@ 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_era_start_datetime DATETIME2 NOT NULL ,
drug_era_end_datetime DATETIME2 NOT NULL ,
drug_exposure_count INTEGER NULL ,
gap_days INTEGER NULL
)
@ -723,8 +723,8 @@ CREATE TABLE dose_era
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_start_datetime DATETIME2 NOT NULL ,
dose_era_end_datetime DATETIME2 NOT NULL
)
;
@ -735,8 +735,8 @@ 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_era_start_datetime DATETIME2 NOT NULL ,
condition_era_end_datetime DATETIME2 NOT NULL ,
condition_occurrence_count INTEGER NULL
)
;