From 717bb1a4d6ddd6435f18a1cb758940cb9ed69319 Mon Sep 17 00:00:00 2001 From: edwardhusarcik <29045779+edwardhusarcik@users.noreply.github.com> Date: Thu, 5 Jul 2018 11:55:53 -0600 Subject: [PATCH] Reverted DATETIME2 back to TIMESTAMP in Postgresql DATETIME2 is not a valid data type in postgresql. --- PostgreSQL/OMOP CDM postgresql ddl.txt | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/PostgreSQL/OMOP CDM postgresql ddl.txt b/PostgreSQL/OMOP CDM postgresql ddl.txt index 9e611f3..c0a0f69 100644 --- a/PostgreSQL/OMOP CDM postgresql ddl.txt +++ b/PostgreSQL/OMOP CDM postgresql ddl.txt @@ -210,7 +210,7 @@ CREATE TABLE metadata value_as_string TEXT NULL , value_as_concept_id INTEGER NULL , metadata_date DATE NULL , - metadata_datetime DATETIME2 NULL + metadata_datetime TIMESTAMP NULL ) ; @@ -229,7 +229,7 @@ CREATE TABLE person year_of_birth INTEGER NOT NULL , month_of_birth INTEGER NULL, day_of_birth INTEGER NULL, - birth_datetime DATETIME2 NULL, + birth_datetime TIMESTAMP NULL, race_concept_id INTEGER NOT NULL, ethnicity_concept_id INTEGER NOT NULL, location_id INTEGER NULL, @@ -266,7 +266,7 @@ CREATE TABLE specimen specimen_concept_id INTEGER NOT NULL , specimen_type_concept_id INTEGER NOT NULL , specimen_date DATE NOT NULL , - specimen_datetime DATETIME2 NULL , + specimen_datetime TIMESTAMP NULL , quantity NUMERIC NULL , unit_concept_id INTEGER NULL , anatomic_site_concept_id INTEGER NULL , @@ -285,7 +285,7 @@ CREATE TABLE death ( person_id INTEGER NOT NULL , death_date DATE NOT NULL , - death_datetime DATETIME2 NULL , + death_datetime TIMESTAMP NULL , death_type_concept_id INTEGER NOT NULL , cause_concept_id INTEGER NULL , cause_source_value VARCHAR(50) NULL, @@ -301,9 +301,9 @@ CREATE TABLE visit_occurrence person_id INTEGER NOT NULL , visit_concept_id INTEGER NOT NULL , visit_start_date DATE NOT NULL , - visit_start_datetime DATETIME2 NULL , + visit_start_datetime TIMESTAMP NULL , visit_end_date DATE NOT NULL , - visit_end_datetime DATETIME2 NULL , + visit_end_datetime TIMESTAMP NULL , visit_type_concept_id INTEGER NOT NULL , provider_id INTEGER NULL, care_site_id INTEGER NULL, @@ -325,9 +325,9 @@ CREATE TABLE visit_detail person_id INTEGER NOT NULL , visit_detail_concept_id INTEGER NOT NULL , visit_detail_start_date DATE NOT NULL , - visit_detail_start_datetime DATETIME2 NULL , + visit_detail_start_datetime TIMESTAMP NULL , visit_detail_end_date DATE NOT NULL , - visit_detail_end_datetime DATETIME2 NULL , + visit_detail_end_datetime TIMESTAMP NULL , visit_detail_type_concept_id INTEGER NOT NULL , provider_id INTEGER NULL , care_site_id INTEGER NULL , @@ -351,7 +351,7 @@ CREATE TABLE procedure_occurrence person_id INTEGER NOT NULL , procedure_concept_id INTEGER NOT NULL , procedure_date DATE NOT NULL , - procedure_datetime DATETIME2 NULL , + procedure_datetime TIMESTAMP NULL , procedure_type_concept_id INTEGER NOT NULL , modifier_concept_id INTEGER NULL , quantity INTEGER NULL , @@ -372,9 +372,9 @@ CREATE TABLE drug_exposure person_id INTEGER NOT NULL , drug_concept_id INTEGER NOT NULL , drug_exposure_start_date DATE NOT NULL , - drug_exposure_start_datetime DATETIME2 NULL , + drug_exposure_start_datetime TIMESTAMP NULL , drug_exposure_end_date DATE NOT NULL , - drug_exposure_end_datetime DATETIME2 NULL , + drug_exposure_end_datetime TIMESTAMP NULL , verbatim_end_date DATE NULL , drug_type_concept_id INTEGER NOT NULL , stop_reason VARCHAR(20) NULL , @@ -402,9 +402,9 @@ CREATE TABLE device_exposure person_id INTEGER NOT NULL , device_concept_id INTEGER NOT NULL , device_exposure_start_date DATE NOT NULL , - device_exposure_start_datetime DATETIME2 NULL , + device_exposure_start_datetime TIMESTAMP NULL , device_exposure_end_date DATE NULL , - device_exposure_end_datetime DATETIME2 NULL , + device_exposure_end_datetime TIMESTAMP NULL , device_type_concept_id INTEGER NOT NULL , unique_device_id VARCHAR(50) NULL , quantity INTEGER NULL , @@ -424,9 +424,9 @@ CREATE TABLE condition_occurrence person_id INTEGER NOT NULL , condition_concept_id INTEGER NOT NULL , condition_start_date DATE NOT NULL , - condition_start_datetime DATETIME2 NULL , + condition_start_datetime TIMESTAMP NULL , condition_end_date DATE NULL , - condition_end_datetime DATETIME2 NULL , + condition_end_datetime TIMESTAMP NULL , condition_type_concept_id INTEGER NOT NULL , stop_reason VARCHAR(20) NULL , provider_id INTEGER NULL , @@ -447,7 +447,7 @@ CREATE TABLE measurement person_id INTEGER NOT NULL , measurement_concept_id INTEGER NOT NULL , measurement_date DATE NOT NULL , - measurement_datetime DATETIME2 NULL , + measurement_datetime TIMESTAMP NULL , measurement_time VARCHAR(10) NULL, measurement_type_concept_id INTEGER NOT NULL , operator_concept_id INTEGER NULL , @@ -473,7 +473,7 @@ CREATE TABLE note note_id INTEGER NOT NULL , person_id INTEGER NOT NULL , note_date DATE NOT NULL , - note_datetime DATETIME2 NULL , + note_datetime TIMESTAMP NULL , note_type_concept_id INTEGER NOT NULL , note_class_concept_id INTEGER NOT NULL , note_title VARCHAR(250) NULL , @@ -501,7 +501,7 @@ CREATE TABLE note_nlp note_nlp_source_concept_id INTEGER NULL , nlp_system VARCHAR(250) NULL , nlp_date DATE NOT NULL , - nlp_datetime DATETIME2 NULL , + nlp_datetime TIMESTAMP NULL , term_exists VARCHAR(1) NULL , term_temporal VARCHAR(50) NULL , term_modifiers VARCHAR(2000) NULL @@ -516,7 +516,7 @@ CREATE TABLE observation person_id INTEGER NOT NULL , observation_concept_id INTEGER NOT NULL , observation_date DATE NOT NULL , - observation_datetime DATETIME2 NULL , + observation_datetime TIMESTAMP NULL , observation_type_concept_id INTEGER NOT NULL , value_as_number NUMERIC NULL , value_as_string VARCHAR(60) NULL ,