Updated files to include optional vocabulary version and datetimes in era tables
This commit is contained in:
parent
046feb3fea
commit
df9e11a2d5
|
@ -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)
|
||||
;
|
||||
|
|
|
@ -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
|
||||
)
|
||||
;
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
)
|
||||
;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
)
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue