OMOP/Snowflake/OMOP CDM Results snowflake ...

56 lines
2.1 KiB
Plaintext

/*********************************************************************************
# Copyright 2019 Observational Health Data Sciences and Informatics
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
********************************************************************************/
/************************
####### # # ####### ###### ##### ###### # # ##### ###
# # ## ## # # # # # # # # ## ## # # # # # #
# # # # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # #
# # # # # # # # # # # # # # # # ### # #
# # # # # # # # # # # # # # # # # ### # #
####### # # ####### # ##### ###### # # ## ##### ### ###
snowflake script to create OMOP common data model results schema version 6.0
last revised: 05-Aug-2019
Authors: Kathryn Watson
*************************/
CREATE TABLE cohort_definition (
cohort_definition_id INTEGER NOT NULL,
cohort_definition_name VARCHAR NOT NULL,
cohort_definition_description VARCHAR NULL,
definition_type_concept_id INTEGER NOT NULL,
cohort_definition_syntax VARCHAR NULL,
subject_concept_id INTEGER NOT NULL,
cohort_initiation_date DATE NULL
)
;
CREATE TABLE cohort
(
cohort_definition_id INTEGER NOT NULL,
subject_id INTEGER NOT NULL,
cohort_start_date DATE NOT NULL ,
cohort_end_date DATE NOT NULL
)
;