Skip to content

Commit

Permalink
closes #140, #144, #135
Browse files Browse the repository at this point in the history
  • Loading branch information
clairblacketer committed Feb 7, 2018
1 parent ced0af0 commit 9bfa59a
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 71 deletions.
8 changes: 4 additions & 4 deletions BigQuery/OMOP CDM bigquery ddl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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
)
;
Expand Down Expand Up @@ -390,8 +390,8 @@ create table measurement
person_id integer not null ,
measurement_concept_id integer not null ,
measurement_date date not null ,
measurement_datetime datetime null ,
measurement_time varchar(10) null ,
measurement_datetime datetime null ,
measurement_type_concept_id integer not null ,
operator_concept_id integer null ,
value_as_number float null ,
Expand Down Expand Up @@ -551,7 +551,7 @@ create table payer_plan_period
sponsor_source_concept_id integer null ,
family_source_value varchar(50) null ,
stop_reason_concept_id integer null ,
stop_reason_source_value integer null ,
stop_reason_source_value varchar(50) null ,
stop_reason_source_concept_id integer null
)
;
Expand All @@ -578,7 +578,7 @@ create table cost
payer_plan_period_id integer null ,
amount_allowed float null ,
revenue_code_concept_id integer null ,
reveue_code_source_value varchar(50) null,
revenue_code_source_value varchar(50) null,
drg_concept_id integer null,
drg_source_value varchar(3) null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Field|Required|Type|Description
|definition_type_concept_id|Yes|integer|Type defining what kind of Cohort Definition the record represents and how the syntax may be executed|
|cohort_definition_syntax|No|varchar(MAX)|Syntax or code to operationalize the Cohort definition|
|subject_concept_id|Yes|integer|A foreign key to the Concept to which defines the domain of subjects that are members of the cohort (e.g., Person, Provider, Visit).|
|cohort_instantiation_date|No|Date|A date to indicate when the Cohort was instantiated in the COHORT table|
|cohort_initiation_date|No|Date|A date to indicate when the Cohort was instantiated in the COHORT table|

### Conventions
* The cohort_definition_syntax does not prescribe any specific syntax or programming language. Typically, it would be any flavor SQL, a cohort definition language, or a free-text description of the algorithm.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ The CONCEPT_SYNONYM table is used to store alternate names and descriptions for

### Conventions

* The concept_name field contains a valid Synonym of a concept, including the description in the concept_name itself. I.e. each Concept has at least one Synonym in the CONCEPT_SYNONYM table. As an example, for a SNOMED-CT Concept, if the fully specified name is stored as the concept_name of the CONCEPT table, then the Preferred Term and Synonyms associated with the Concept are stored in the CONCEPT_SYNONYM table.
* The concept_synonym_name field contains a valid Synonym of a concept, including the description in the concept_name itself. I.e. each Concept has at least one Synonym in the CONCEPT_SYNONYM table. As an example, for a SNOMED-CT Concept, if the fully specified name is stored as the concept_name of the CONCEPT table, then the Preferred Term and Synonyms associated with the Concept are stored in the CONCEPT_SYNONYM table.
* Only Synonyms that are active and current are stored in the CONCEPT_SYNONYM table. Tracking synonym/description history and mapping of obsolete synonyms to current Concepts/Synonyms is out of scope for the Standard Vocabularies.
* Currently, only English Synonyms are included.
6 changes: 4 additions & 2 deletions Impala/OMOP CDM impala ddl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ CREATE TABLE measurement

measurement_datetime TIMESTAMP,

measurement_time VARCHAR(10),

measurement_type_concept_id INTEGER,

operator_concept_id INTEGER,
Expand Down Expand Up @@ -1134,7 +1136,7 @@ CREATE TABLE payer_plan_period

stop_reason_concept_id INTEGER,

stop_reason_source_value INTEGER,
stop_reason_source_value VARCHAR(50),

stop_reason_source_concept_id INTEGER
)
Expand Down Expand Up @@ -1185,7 +1187,7 @@ CREATE TABLE cost

revenue_code_concept_id INTEGER,

reveue_code_source_value VARCHAR(50),
revenue_code_source_value VARCHAR(50),

drg_concept_id INTEGER,

Expand Down
11 changes: 6 additions & 5 deletions Netezza/OMOP CDM netezza ddl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

netezza script to create OMOP common data model version 5.3

last revised: 6-Nov-2017
last revised: 8-Jan-2018

Authors: Patrick Ryan, Christian Reich, Clair Blacketer

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -479,7 +479,8 @@ CREATE TABLE measurement
person_id INTEGER NOT NULL ,
measurement_concept_id INTEGER NOT NULL ,
measurement_date DATE NOT NULL ,
measurement_datetime DATETIME NULL ,
measurement_datetime DATETIME NULL ,
measurement_time VARCHAR(10) NULL ,
measurement_type_concept_id INTEGER NOT NULL ,
operator_concept_id INTEGER NULL ,
value_as_number REAL NULL ,
Expand Down Expand Up @@ -665,7 +666,7 @@ CREATE TABLE payer_plan_period
sponsor_source_concept_id INTEGER NULL ,
family_source_value VARCHAR(50) NULL ,
stop_reason_concept_id INTEGER NULL ,
stop_reason_source_value INTEGER NULL ,
stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL
)
DISTRIBUTE ON (person_id)
Expand Down Expand Up @@ -694,7 +695,7 @@ CREATE TABLE cost
payer_plan_period_id INTEGER NULL ,
amount_allowed REAL NULL ,
revenue_code_concept_id INTEGER NULL ,
reveue_code_source_value VARCHAR(50) NULL,
revenue_code_source_value VARCHAR(50) NULL,
drg_concept_id INTEGER NULL,
drg_source_value VARCHAR(3) NULL
)
Expand Down
8 changes: 4 additions & 4 deletions Oracle/OMOP CDM oracle ddl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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
)
;
Expand Down Expand Up @@ -447,8 +447,8 @@ CREATE TABLE measurement
person_id INTEGER NOT NULL ,
measurement_concept_id INTEGER NOT NULL ,
measurement_date DATE NOT NULL ,
measurement_datetime TIMESTAMP NULL ,
measurement_time VARCHAR(10) NULL ,
measurement_datetime TIMESTAMP NULL ,
measurement_type_concept_id INTEGER NOT NULL ,
operator_concept_id INTEGER NULL ,
value_as_number FLOAT NULL ,
Expand Down Expand Up @@ -623,7 +623,7 @@ CREATE TABLE payer_plan_period
sponsor_source_concept_id INTEGER NULL ,
family_source_value VARCHAR(50) NULL ,
stop_reason_concept_id INTEGER NULL ,
stop_reason_source_value INTEGER NULL ,
stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL
)
;
Expand All @@ -650,7 +650,7 @@ CREATE TABLE cost
payer_plan_period_id INTEGER NULL ,
amount_allowed FLOAT NULL ,
revenue_code_concept_id INTEGER NULL ,
reveue_code_source_value VARCHAR(50) NULL,
revenue_code_source_value VARCHAR(50) NULL,
drg_concept_id INTEGER NULL,
drg_source_value VARCHAR(3) NULL
)
Expand Down
46 changes: 23 additions & 23 deletions ParallelDataWarehouse/OMOP CDM pdw ddl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ WITH (DISTRIBUTION = REPLICATE);
IF XACT_STATE() = 1 COMMIT; 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
)
WITH (DISTRIBUTION = REPLICATE);
Expand Down Expand Up @@ -207,7 +207,7 @@ Standardized clinical data

************************/

--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE person
(person_id INTEGER NOT NULL ,
gender_concept_id INTEGER NOT NULL ,
Expand All @@ -231,7 +231,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE person
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE observation_period
(observation_period_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -242,7 +242,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE observation_period
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE specimen
(specimen_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -263,7 +263,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE specimen
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE death
(person_id INTEGER NOT NULL ,
death_date DATE NOT NULL ,
Expand All @@ -276,7 +276,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE death
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE visit_occurrence
(visit_occurrence_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -299,7 +299,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE visit_occurrence
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE visit_detail
(visit_detail_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -324,7 +324,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE visit_detail
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE procedure_occurrence
(procedure_occurrence_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -344,7 +344,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE procedure_occurrence
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_exposure
(drug_exposure_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand Down Expand Up @@ -373,7 +373,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_exposure
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE device_exposure
(device_exposure_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -394,7 +394,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE device_exposure
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE condition_occurrence
(condition_occurrence_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -416,14 +416,14 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE condition_occurrence
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE measurement
(measurement_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
measurement_concept_id INTEGER NOT NULL ,
measurement_date DATE NOT NULL ,
measurement_datetime DATETIME NULL ,
measurement_time VARCHAR(10) NULL ,
measurement_datetime DATETIME NULL ,
measurement_type_concept_id INTEGER NOT NULL ,
operator_concept_id INTEGER NULL ,
value_as_number FLOAT NULL ,
Expand All @@ -442,7 +442,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE measurement
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE note
(note_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand Down Expand Up @@ -482,7 +482,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE note_nlp
WITH (DISTRIBUTION = REPLICATE);


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE observation
(observation_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand Down Expand Up @@ -573,7 +573,7 @@ Standardized health economics
************************/


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE payer_plan_period
(payer_plan_period_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -590,7 +590,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE payer_plan_period
sponsor_source_concept_id INTEGER NULL ,
family_source_value VARCHAR(50) NULL ,
stop_reason_concept_id INTEGER NULL ,
stop_reason_source_value INTEGER NULL ,
stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL
)
WITH (DISTRIBUTION = HASH(person_id));
Expand All @@ -616,7 +616,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE cost
payer_plan_period_id INTEGER NULL ,
amount_allowed FLOAT NULL ,
revenue_code_concept_id INTEGER NULL ,
reveue_code_source_value VARCHAR(50) NULL,
revenue_code_source_value VARCHAR(50) NULL,
drg_concept_id INTEGER NULL,
drg_source_value VARCHAR(3) NULL
)
Expand All @@ -630,7 +630,7 @@ Standardized derived elements
************************/


--HINT DISTRIBUTE_ON_KEY(subject_id)
--HINT DISTRIBUTE_ON_KEY(subject_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort
(cohort_definition_id INTEGER NOT NULL ,
subject_id INTEGER NOT NULL ,
Expand All @@ -640,7 +640,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort
WITH (DISTRIBUTION = HASH(subject_id));


--HINT DISTRIBUTE_ON_KEY(subject_id)
--HINT DISTRIBUTE_ON_KEY(subject_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort_attribute
(cohort_definition_id INTEGER NOT NULL ,
subject_id INTEGER NOT NULL ,
Expand All @@ -653,7 +653,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort_attribute
WITH (DISTRIBUTION = HASH(subject_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_era
(drug_era_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -666,7 +666,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_era
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE dose_era
(dose_era_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand All @@ -679,7 +679,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE dose_era
WITH (DISTRIBUTION = HASH(person_id));


--HINT DISTRIBUTE_ON_KEY(person_id)
--HINT DISTRIBUTE_ON_KEY(person_id)
IF XACT_STATE() = 1 COMMIT; CREATE TABLE condition_era
(condition_era_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL ,
Expand Down
Loading

0 comments on commit 9bfa59a

Please sign in to comment.