Skip to content

Commit 33294de

Browse files
Merge pull request #157 from OHDSI/cdm_V5.3.-issue-150
Closes #150
2 parents 9c33c54 + 990a1a1 commit 33294de

9 files changed

Lines changed: 58 additions & 49 deletions

File tree

BigQuery/OMOP CDM bigquery ddl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 ,

Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/MEASUREMENT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Field|Required|Type|Description
77
|measurement_concept_id|Yes|integer|A foreign key to the standard measurement concept identifier in the Standardized Vocabularies.|
88
|measurement_date|Yes|date|The date of the Measurement.|
99
|measurement_datetime|No|datetime|The date and time of the Measurement. Some database systems don't have a datatype of time. To accomodate all temporal analyses, datatype datetime can be used (combining measurement_date and measurement_time [forum discussion](http://forums.ohdsi.org/t/date-time-and-datetime-problem-and-the-world-of-hours-and-1day/314))|
10+
|measurement_time |No|varchar(10)|The time of the Measurement. This is present for backwards compatibility and will deprecated in an upcoming version|
1011
|measurement_type_concept_id|Yes|integer|A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the provenance from where the Measurement record was recorded.|
1112
|operator_concept_id|No|integer|A foreign key identifier to the predefined Concept in the Standardized Vocabularies reflecting the mathematical operator that is applied to the value_as_number. Operators are <, <=, =, >=, >.|
1213
|value_as_number|No|float|A Measurement result where the result is expressed as a numeric value.|

Impala/OMOP CDM impala ddl.txt

Lines changed: 2 additions & 0 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,

Netezza/OMOP CDM netezza ddl.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 ,

Oracle/OMOP CDM oracle ddl.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +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 ,
450+
measurement_datetime TIMESTAMP NULL ,
451+
measurement_time VARCHAR(10) NULL ,
451452
measurement_type_concept_id INTEGER NOT NULL ,
452453
operator_concept_id INTEGER NULL ,
453454
value_as_number FLOAT NULL ,
@@ -622,7 +623,7 @@ CREATE TABLE payer_plan_period
622623
sponsor_source_concept_id INTEGER NULL ,
623624
family_source_value VARCHAR(50) NULL ,
624625
stop_reason_concept_id INTEGER NULL ,
625-
stop_reason_source_value VARCHAR(50) NULL ,
626+
stop_reason_source_value VARCHAR(50) NULL ,
626627
stop_reason_source_concept_id INTEGER NULL
627628
)
628629
;

ParallelDataWarehouse/OMOP CDM pdw ddl.txt

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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,13 +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 ,
425+
measurement_datetime DATETIME NULL ,
426+
measurement_time VARCHAR(10) NULL ,
426427
measurement_type_concept_id INTEGER NOT NULL ,
427428
operator_concept_id INTEGER NULL ,
428429
value_as_number FLOAT NULL ,
@@ -441,7 +442,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE measurement
441442
WITH (DISTRIBUTION = HASH(person_id));
442443

443444

444-
--HINT DISTRIBUTE_ON_KEY(person_id)
445+
--HINT DISTRIBUTE_ON_KEY(person_id)
445446
IF XACT_STATE() = 1 COMMIT; CREATE TABLE note
446447
(note_id INTEGER NOT NULL ,
447448
person_id INTEGER NOT NULL ,
@@ -481,7 +482,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE note_nlp
481482
WITH (DISTRIBUTION = REPLICATE);
482483

483484

484-
--HINT DISTRIBUTE_ON_KEY(person_id)
485+
--HINT DISTRIBUTE_ON_KEY(person_id)
485486
IF XACT_STATE() = 1 COMMIT; CREATE TABLE observation
486487
(observation_id INTEGER NOT NULL ,
487488
person_id INTEGER NOT NULL ,
@@ -572,7 +573,7 @@ Standardized health economics
572573
************************/
573574

574575

575-
--HINT DISTRIBUTE_ON_KEY(person_id)
576+
--HINT DISTRIBUTE_ON_KEY(person_id)
576577
IF XACT_STATE() = 1 COMMIT; CREATE TABLE payer_plan_period
577578
(payer_plan_period_id INTEGER NOT NULL ,
578579
person_id INTEGER NOT NULL ,
@@ -629,7 +630,7 @@ Standardized derived elements
629630
************************/
630631

631632

632-
--HINT DISTRIBUTE_ON_KEY(subject_id)
633+
--HINT DISTRIBUTE_ON_KEY(subject_id)
633634
IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort
634635
(cohort_definition_id INTEGER NOT NULL ,
635636
subject_id INTEGER NOT NULL ,
@@ -639,7 +640,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort
639640
WITH (DISTRIBUTION = HASH(subject_id));
640641

641642

642-
--HINT DISTRIBUTE_ON_KEY(subject_id)
643+
--HINT DISTRIBUTE_ON_KEY(subject_id)
643644
IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort_attribute
644645
(cohort_definition_id INTEGER NOT NULL ,
645646
subject_id INTEGER NOT NULL ,
@@ -652,7 +653,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE cohort_attribute
652653
WITH (DISTRIBUTION = HASH(subject_id));
653654

654655

655-
--HINT DISTRIBUTE_ON_KEY(person_id)
656+
--HINT DISTRIBUTE_ON_KEY(person_id)
656657
IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_era
657658
(drug_era_id INTEGER NOT NULL ,
658659
person_id INTEGER NOT NULL ,
@@ -665,7 +666,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE drug_era
665666
WITH (DISTRIBUTION = HASH(person_id));
666667

667668

668-
--HINT DISTRIBUTE_ON_KEY(person_id)
669+
--HINT DISTRIBUTE_ON_KEY(person_id)
669670
IF XACT_STATE() = 1 COMMIT; CREATE TABLE dose_era
670671
(dose_era_id INTEGER NOT NULL ,
671672
person_id INTEGER NOT NULL ,
@@ -678,7 +679,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE dose_era
678679
WITH (DISTRIBUTION = HASH(person_id));
679680

680681

681-
--HINT DISTRIBUTE_ON_KEY(person_id)
682+
--HINT DISTRIBUTE_ON_KEY(person_id)
682683
IF XACT_STATE() = 1 COMMIT; CREATE TABLE condition_era
683684
(condition_era_id INTEGER NOT NULL ,
684685
person_id INTEGER NOT NULL ,

PostgreSQL/OMOP CDM postgresql ddl.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,15 @@ 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 ,
450+
measurement_datetime TIMESTAMP NULL ,
451+
measurement_time VARCHAR(10) NULL ,
451452
measurement_type_concept_id INTEGER NOT NULL ,
452453
operator_concept_id INTEGER NULL ,
453-
value_as_number NUMERIC NULL ,
454+
value_as_number NUMERIC NULL ,
454455
value_as_concept_id INTEGER NULL ,
455456
unit_concept_id INTEGER NULL ,
456-
range_low NUMERIC NULL ,
457-
range_high NUMERIC NULL ,
457+
range_low NUMERIC NULL ,
458+
range_high NUMERIC NULL ,
458459
provider_id INTEGER NULL ,
459460
visit_occurrence_id INTEGER NULL ,
460461
visit_detail_id INTEGER NULL ,

0 commit comments

Comments
 (0)