Skip to content

Commit 9bfa59a

Browse files
closes #140, #144, #135
1 parent ced0af0 commit 9bfa59a

10 files changed

Lines changed: 74 additions & 71 deletions

File tree

BigQuery/OMOP CDM bigquery ddl.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ create table vocabulary (
1717
vocabulary_id varchar(20) not null,
1818
vocabulary_name varchar(255) not null,
1919
vocabulary_reference varchar(255) not null,
20-
vocabulary_version varchar(255) not null,
20+
vocabulary_version varchar(255) null,
2121
vocabulary_concept_id integer not null
2222
)
2323
;
@@ -390,8 +390,8 @@ create table measurement
390390
person_id integer not null ,
391391
measurement_concept_id integer not null ,
392392
measurement_date date not null ,
393+
measurement_datetime datetime null ,
393394
measurement_time varchar(10) null ,
394-
measurement_datetime datetime null ,
395395
measurement_type_concept_id integer not null ,
396396
operator_concept_id integer null ,
397397
value_as_number float null ,
@@ -551,7 +551,7 @@ create table payer_plan_period
551551
sponsor_source_concept_id integer null ,
552552
family_source_value varchar(50) null ,
553553
stop_reason_concept_id integer null ,
554-
stop_reason_source_value integer null ,
554+
stop_reason_source_value varchar(50) null ,
555555
stop_reason_source_concept_id integer null
556556
)
557557
;
@@ -578,7 +578,7 @@ create table cost
578578
payer_plan_period_id integer null ,
579579
amount_allowed float null ,
580580
revenue_code_concept_id integer null ,
581-
reveue_code_source_value varchar(50) null,
581+
revenue_code_source_value varchar(50) null,
582582
drg_concept_id integer null,
583583
drg_source_value varchar(3) null
584584
)

Documentation/CommonDataModel_Wiki_Files/StandardizedVocabularies/COHORT_DEFINITION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Field|Required|Type|Description
88
|definition_type_concept_id|Yes|integer|Type defining what kind of Cohort Definition the record represents and how the syntax may be executed|
99
|cohort_definition_syntax|No|varchar(MAX)|Syntax or code to operationalize the Cohort definition|
1010
|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).|
11-
|cohort_instantiation_date|No|Date|A date to indicate when the Cohort was instantiated in the COHORT table|
11+
|cohort_initiation_date|No|Date|A date to indicate when the Cohort was instantiated in the COHORT table|
1212

1313
### Conventions
1414
* 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.

Documentation/CommonDataModel_Wiki_Files/StandardizedVocabularies/CONCEPT_SYNONYM.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ The CONCEPT_SYNONYM table is used to store alternate names and descriptions for
88

99
### Conventions
1010

11-
* 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.
11+
* 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.
1212
* 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.
1313
* Currently, only English Synonyms are included.

Impala/OMOP CDM impala ddl.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,8 @@ CREATE TABLE measurement
818818

819819
measurement_datetime TIMESTAMP,
820820

821+
measurement_time VARCHAR(10),
822+
821823
measurement_type_concept_id INTEGER,
822824

823825
operator_concept_id INTEGER,
@@ -1134,7 +1136,7 @@ CREATE TABLE payer_plan_period
11341136

11351137
stop_reason_concept_id INTEGER,
11361138

1137-
stop_reason_source_value INTEGER,
1139+
stop_reason_source_value VARCHAR(50),
11381140

11391141
stop_reason_source_concept_id INTEGER
11401142
)
@@ -1185,7 +1187,7 @@ CREATE TABLE cost
11851187

11861188
revenue_code_concept_id INTEGER,
11871189

1188-
reveue_code_source_value VARCHAR(50),
1190+
revenue_code_source_value VARCHAR(50),
11891191

11901192
drg_concept_id INTEGER,
11911193

Netezza/OMOP CDM netezza ddl.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
netezza script to create OMOP common data model version 5.3
3030

31-
last revised: 6-Nov-2017
31+
last revised: 8-Jan-2018
3232

3333
Authors: Patrick Ryan, Christian Reich, Clair Blacketer
3434

@@ -64,7 +64,7 @@ CREATE TABLE vocabulary (
6464
vocabulary_id VARCHAR(20) NOT NULL,
6565
vocabulary_name VARCHAR(255) NOT NULL,
6666
vocabulary_reference VARCHAR(255) NOT NULL,
67-
vocabulary_version VARCHAR(255) NOT NULL,
67+
vocabulary_version VARCHAR(255) NULL,
6868
vocabulary_concept_id INTEGER NOT NULL
6969
)
7070
DISTRIBUTE ON RANDOM
@@ -479,7 +479,8 @@ CREATE TABLE measurement
479479
person_id INTEGER NOT NULL ,
480480
measurement_concept_id INTEGER NOT NULL ,
481481
measurement_date DATE NOT NULL ,
482-
measurement_datetime DATETIME NULL ,
482+
measurement_datetime DATETIME NULL ,
483+
measurement_time VARCHAR(10) NULL ,
483484
measurement_type_concept_id INTEGER NOT NULL ,
484485
operator_concept_id INTEGER NULL ,
485486
value_as_number REAL NULL ,
@@ -665,7 +666,7 @@ CREATE TABLE payer_plan_period
665666
sponsor_source_concept_id INTEGER NULL ,
666667
family_source_value VARCHAR(50) NULL ,
667668
stop_reason_concept_id INTEGER NULL ,
668-
stop_reason_source_value INTEGER NULL ,
669+
stop_reason_source_value VARCHAR(50) NULL ,
669670
stop_reason_source_concept_id INTEGER NULL
670671
)
671672
DISTRIBUTE ON (person_id)
@@ -694,7 +695,7 @@ CREATE TABLE cost
694695
payer_plan_period_id INTEGER NULL ,
695696
amount_allowed REAL NULL ,
696697
revenue_code_concept_id INTEGER NULL ,
697-
reveue_code_source_value VARCHAR(50) NULL,
698+
revenue_code_source_value VARCHAR(50) NULL,
698699
drg_concept_id INTEGER NULL,
699700
drg_source_value VARCHAR(3) NULL
700701
)

Oracle/OMOP CDM oracle ddl.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ CREATE TABLE vocabulary (
6262
vocabulary_id VARCHAR(20) NOT NULL,
6363
vocabulary_name VARCHAR(255) NOT NULL,
6464
vocabulary_reference VARCHAR(255) NOT NULL,
65-
vocabulary_version VARCHAR(255) NOT NULL,
65+
vocabulary_version VARCHAR(255) NULL,
6666
vocabulary_concept_id INTEGER NOT NULL
6767
)
6868
;
@@ -447,8 +447,8 @@ CREATE TABLE measurement
447447
person_id INTEGER NOT NULL ,
448448
measurement_concept_id INTEGER NOT NULL ,
449449
measurement_date DATE NOT NULL ,
450+
measurement_datetime TIMESTAMP NULL ,
450451
measurement_time VARCHAR(10) NULL ,
451-
measurement_datetime TIMESTAMP NULL ,
452452
measurement_type_concept_id INTEGER NOT NULL ,
453453
operator_concept_id INTEGER NULL ,
454454
value_as_number FLOAT NULL ,
@@ -623,7 +623,7 @@ CREATE TABLE payer_plan_period
623623
sponsor_source_concept_id INTEGER NULL ,
624624
family_source_value VARCHAR(50) NULL ,
625625
stop_reason_concept_id INTEGER NULL ,
626-
stop_reason_source_value INTEGER NULL ,
626+
stop_reason_source_value VARCHAR(50) NULL ,
627627
stop_reason_source_concept_id INTEGER NULL
628628
)
629629
;
@@ -650,7 +650,7 @@ CREATE TABLE cost
650650
payer_plan_period_id INTEGER NULL ,
651651
amount_allowed FLOAT NULL ,
652652
revenue_code_concept_id INTEGER NULL ,
653-
reveue_code_source_value VARCHAR(50) NULL,
653+
revenue_code_source_value VARCHAR(50) NULL,
654654
drg_concept_id INTEGER NULL,
655655
drg_source_value VARCHAR(3) NULL
656656
)

ParallelDataWarehouse/OMOP CDM pdw ddl.txt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ WITH (DISTRIBUTION = REPLICATE);
6060
IF XACT_STATE() = 1 COMMIT; CREATE TABLE vocabulary (vocabulary_id VARCHAR(20) NOT NULL,
6161
vocabulary_name VARCHAR(255) NOT NULL,
6262
vocabulary_reference VARCHAR(255) NOT NULL,
63-
vocabulary_version VARCHAR(255) NOT NULL,
63+
vocabulary_version VARCHAR(255) NULL,
6464
vocabulary_concept_id INTEGER NOT NULL
6565
)
6666
WITH (DISTRIBUTION = REPLICATE);
@@ -207,7 +207,7 @@ Standardized clinical data
207207

208208
************************/
209209

210-
--HINT DISTRIBUTE_ON_KEY(person_id)
210+
--HINT DISTRIBUTE_ON_KEY(person_id)
211211
IF XACT_STATE() = 1 COMMIT; CREATE TABLE person
212212
(person_id INTEGER NOT NULL ,
213213
gender_concept_id INTEGER NOT NULL ,
@@ -231,7 +231,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE person
231231
WITH (DISTRIBUTION = HASH(person_id));
232232

233233

234-
--HINT DISTRIBUTE_ON_KEY(person_id)
234+
--HINT DISTRIBUTE_ON_KEY(person_id)
235235
IF XACT_STATE() = 1 COMMIT; CREATE TABLE observation_period
236236
(observation_period_id INTEGER NOT NULL ,
237237
person_id INTEGER NOT NULL ,
@@ -242,7 +242,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE observation_period
242242
WITH (DISTRIBUTION = HASH(person_id));
243243

244244

245-
--HINT DISTRIBUTE_ON_KEY(person_id)
245+
--HINT DISTRIBUTE_ON_KEY(person_id)
246246
IF XACT_STATE() = 1 COMMIT; CREATE TABLE specimen
247247
(specimen_id INTEGER NOT NULL ,
248248
person_id INTEGER NOT NULL ,
@@ -263,7 +263,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE specimen
263263
WITH (DISTRIBUTION = HASH(person_id));
264264

265265

266-
--HINT DISTRIBUTE_ON_KEY(person_id)
266+
--HINT DISTRIBUTE_ON_KEY(person_id)
267267
IF XACT_STATE() = 1 COMMIT; CREATE TABLE death
268268
(person_id INTEGER NOT NULL ,
269269
death_date DATE NOT NULL ,
@@ -276,7 +276,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE death
276276
WITH (DISTRIBUTION = HASH(person_id));
277277

278278

279-
--HINT DISTRIBUTE_ON_KEY(person_id)
279+
--HINT DISTRIBUTE_ON_KEY(person_id)
280280
IF XACT_STATE() = 1 COMMIT; CREATE TABLE visit_occurrence
281281
(visit_occurrence_id INTEGER NOT NULL ,
282282
person_id INTEGER NOT NULL ,
@@ -299,7 +299,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE visit_occurrence
299299
WITH (DISTRIBUTION = HASH(person_id));
300300

301301

302-
--HINT DISTRIBUTE_ON_KEY(person_id)
302+
--HINT DISTRIBUTE_ON_KEY(person_id)
303303
IF XACT_STATE() = 1 COMMIT; CREATE TABLE visit_detail
304304
(visit_detail_id INTEGER NOT NULL ,
305305
person_id INTEGER NOT NULL ,
@@ -324,7 +324,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE visit_detail
324324
WITH (DISTRIBUTION = HASH(person_id));
325325

326326

327-
--HINT DISTRIBUTE_ON_KEY(person_id)
327+
--HINT DISTRIBUTE_ON_KEY(person_id)
328328
IF XACT_STATE() = 1 COMMIT; CREATE TABLE procedure_occurrence
329329
(procedure_occurrence_id INTEGER NOT NULL ,
330330
person_id INTEGER NOT NULL ,
@@ -344,7 +344,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE procedure_occurrence
344344
WITH (DISTRIBUTION = HASH(person_id));
345345

346346

347-
--HINT DISTRIBUTE_ON_KEY(person_id)
347+
--HINT DISTRIBUTE_ON_KEY(person_id)
348348
IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_exposure
349349
(drug_exposure_id INTEGER NOT NULL ,
350350
person_id INTEGER NOT NULL ,
@@ -373,7 +373,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_exposure
373373
WITH (DISTRIBUTION = HASH(person_id));
374374

375375

376-
--HINT DISTRIBUTE_ON_KEY(person_id)
376+
--HINT DISTRIBUTE_ON_KEY(person_id)
377377
IF XACT_STATE() = 1 COMMIT; CREATE TABLE device_exposure
378378
(device_exposure_id INTEGER NOT NULL ,
379379
person_id INTEGER NOT NULL ,
@@ -394,7 +394,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE device_exposure
394394
WITH (DISTRIBUTION = HASH(person_id));
395395

396396

397-
--HINT DISTRIBUTE_ON_KEY(person_id)
397+
--HINT DISTRIBUTE_ON_KEY(person_id)
398398
IF XACT_STATE() = 1 COMMIT; CREATE TABLE condition_occurrence
399399
(condition_occurrence_id INTEGER NOT NULL ,
400400
person_id INTEGER NOT NULL ,
@@ -416,14 +416,14 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE condition_occurrence
416416
WITH (DISTRIBUTION = HASH(person_id));
417417

418418

419-
--HINT DISTRIBUTE_ON_KEY(person_id)
419+
--HINT DISTRIBUTE_ON_KEY(person_id)
420420
IF XACT_STATE() = 1 COMMIT; CREATE TABLE measurement
421421
(measurement_id INTEGER NOT NULL ,
422422
person_id INTEGER NOT NULL ,
423423
measurement_concept_id INTEGER NOT NULL ,
424424
measurement_date DATE NOT NULL ,
425+
measurement_datetime DATETIME NULL ,
425426
measurement_time VARCHAR(10) NULL ,
426-
measurement_datetime DATETIME NULL ,
427427
measurement_type_concept_id INTEGER NOT NULL ,
428428
operator_concept_id INTEGER NULL ,
429429
value_as_number FLOAT NULL ,
@@ -442,7 +442,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE measurement
442442
WITH (DISTRIBUTION = HASH(person_id));
443443

444444

445-
--HINT DISTRIBUTE_ON_KEY(person_id)
445+
--HINT DISTRIBUTE_ON_KEY(person_id)
446446
IF XACT_STATE() = 1 COMMIT; CREATE TABLE note
447447
(note_id INTEGER NOT NULL ,
448448
person_id INTEGER NOT NULL ,
@@ -482,7 +482,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE note_nlp
482482
WITH (DISTRIBUTION = REPLICATE);
483483

484484

485-
--HINT DISTRIBUTE_ON_KEY(person_id)
485+
--HINT DISTRIBUTE_ON_KEY(person_id)
486486
IF XACT_STATE() = 1 COMMIT; CREATE TABLE observation
487487
(observation_id INTEGER NOT NULL ,
488488
person_id INTEGER NOT NULL ,
@@ -573,7 +573,7 @@ Standardized health economics
573573
************************/
574574

575575

576-
--HINT DISTRIBUTE_ON_KEY(person_id)
576+
--HINT DISTRIBUTE_ON_KEY(person_id)
577577
IF XACT_STATE() = 1 COMMIT; CREATE TABLE payer_plan_period
578578
(payer_plan_period_id INTEGER NOT NULL ,
579579
person_id INTEGER NOT NULL ,
@@ -590,7 +590,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE payer_plan_period
590590
sponsor_source_concept_id INTEGER NULL ,
591591
family_source_value VARCHAR(50) NULL ,
592592
stop_reason_concept_id INTEGER NULL ,
593-
stop_reason_source_value INTEGER NULL ,
593+
stop_reason_source_value VARCHAR(50) NULL ,
594594
stop_reason_source_concept_id INTEGER NULL
595595
)
596596
WITH (DISTRIBUTION = HASH(person_id));
@@ -616,7 +616,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE cost
616616
payer_plan_period_id INTEGER NULL ,
617617
amount_allowed FLOAT NULL ,
618618
revenue_code_concept_id INTEGER NULL ,
619-
reveue_code_source_value VARCHAR(50) NULL,
619+
revenue_code_source_value VARCHAR(50) NULL,
620620
drg_concept_id INTEGER NULL,
621621
drg_source_value VARCHAR(3) NULL
622622
)
@@ -630,7 +630,7 @@ Standardized derived elements
630630
************************/
631631

632632

633-
--HINT DISTRIBUTE_ON_KEY(subject_id)
633+
--HINT DISTRIBUTE_ON_KEY(subject_id)
634634
IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort
635635
(cohort_definition_id INTEGER NOT NULL ,
636636
subject_id INTEGER NOT NULL ,
@@ -640,7 +640,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort
640640
WITH (DISTRIBUTION = HASH(subject_id));
641641

642642

643-
--HINT DISTRIBUTE_ON_KEY(subject_id)
643+
--HINT DISTRIBUTE_ON_KEY(subject_id)
644644
IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort_attribute
645645
(cohort_definition_id INTEGER NOT NULL ,
646646
subject_id INTEGER NOT NULL ,
@@ -653,7 +653,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort_attribute
653653
WITH (DISTRIBUTION = HASH(subject_id));
654654

655655

656-
--HINT DISTRIBUTE_ON_KEY(person_id)
656+
--HINT DISTRIBUTE_ON_KEY(person_id)
657657
IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_era
658658
(drug_era_id INTEGER NOT NULL ,
659659
person_id INTEGER NOT NULL ,
@@ -666,7 +666,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_era
666666
WITH (DISTRIBUTION = HASH(person_id));
667667

668668

669-
--HINT DISTRIBUTE_ON_KEY(person_id)
669+
--HINT DISTRIBUTE_ON_KEY(person_id)
670670
IF XACT_STATE() = 1 COMMIT; CREATE TABLE dose_era
671671
(dose_era_id INTEGER NOT NULL ,
672672
person_id INTEGER NOT NULL ,
@@ -679,7 +679,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE dose_era
679679
WITH (DISTRIBUTION = HASH(person_id));
680680

681681

682-
--HINT DISTRIBUTE_ON_KEY(person_id)
682+
--HINT DISTRIBUTE_ON_KEY(person_id)
683683
IF XACT_STATE() = 1 COMMIT; CREATE TABLE condition_era
684684
(condition_era_id INTEGER NOT NULL ,
685685
person_id INTEGER NOT NULL ,

0 commit comments

Comments
 (0)