This commit is contained in:
clairblacketer 2017-07-19 11:38:57 -04:00
commit 049f25f9f0
15 changed files with 109 additions and 102 deletions

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # #######
# # ## ## # # # # # # # # ## ## # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ######
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # #
####### # # ####### # ##### ###### # # ## #####
####### # # ####### ###### ##### ###### # # ####### # ###
# # ## ## # # # # # # # # ## ## # # # ## # #
# # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # #
# # # # # # # # # # # # # # # ### # ### # #
# # # # # # # # # # # # # # # # # ### # ### # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ###
script to create OMOP common data model, version 5.0 for Hadoop (Hive/Impala) database
script to create OMOP common data model, version 5.1.0 for Hadoop (Hive/Impala) database
Based on the PostgreSQL version, with the following changes:
* NULL/NOT NULL is not used.

View File

@ -15,7 +15,7 @@ SELECT
concept_code,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_start_date AS STRING), 1, 4), SUBSTR(CAST(valid_start_date AS STRING), 5, 2), SUBSTR(CAST(valid_start_date AS STRING), 7, 2)), 'UTC') AS valid_start_date,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_end_date AS STRING), 1, 4), SUBSTR(CAST(valid_end_date AS STRING), 5, 2), SUBSTR(CAST(valid_end_date AS STRING), 7, 2)), 'UTC') AS valid_end_date,
invalid_reason
nullif(invalid_reason, '') AS invalid_reason
FROM omop_cdm.concept;
CREATE TABLE omop_cdm_parquet.vocabulary
@ -42,7 +42,7 @@ SELECT
relationship_id,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_start_date AS STRING), 1, 4), SUBSTR(CAST(valid_start_date AS STRING), 5, 2), SUBSTR(CAST(valid_start_date AS STRING), 7, 2)), 'UTC') AS valid_start_date,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_end_date AS STRING), 1, 4), SUBSTR(CAST(valid_end_date AS STRING), 5, 2), SUBSTR(CAST(valid_end_date AS STRING), 7, 2)), 'UTC') AS valid_end_date,
invalid_reason
nullif(invalid_reason, '') AS invalid_reason
FROM omop_cdm.concept_relationship;
CREATE TABLE omop_cdm_parquet.relationship
@ -72,7 +72,7 @@ SELECT
target_vocabulary_id,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_start_date AS STRING), 1, 4), SUBSTR(CAST(valid_start_date AS STRING), 5, 2), SUBSTR(CAST(valid_start_date AS STRING), 7, 2)), 'UTC') AS valid_start_date,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_end_date AS STRING), 1, 4), SUBSTR(CAST(valid_end_date AS STRING), 5, 2), SUBSTR(CAST(valid_end_date AS STRING), 7, 2)), 'UTC') AS valid_end_date,
invalid_reason
nullif(invalid_reason, '') AS invalid_reason
FROM omop_cdm.source_to_concept_map;
CREATE TABLE omop_cdm_parquet.drug_strength
@ -90,7 +90,7 @@ SELECT
box_size,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_start_date AS STRING), 1, 4), SUBSTR(CAST(valid_start_date AS STRING), 5, 2), SUBSTR(CAST(valid_start_date AS STRING), 7, 2)), 'UTC') AS valid_start_date,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_end_date AS STRING), 1, 4), SUBSTR(CAST(valid_end_date AS STRING), 5, 2), SUBSTR(CAST(valid_end_date AS STRING), 7, 2)), 'UTC') AS valid_end_date,
invalid_reason
nullif(invalid_reason, '') AS invalid_reason
FROM omop_cdm.drug_strength;
CREATE TABLE omop_cdm_parquet.cohort_definition

View File

@ -15,7 +15,7 @@ SELECT
concept_code,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_start_date AS STRING), 1, 4), SUBSTR(CAST(valid_start_date AS STRING), 5, 2), SUBSTR(CAST(valid_start_date AS STRING), 7, 2)), 'UTC') AS valid_start_date,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_end_date AS STRING), 1, 4), SUBSTR(CAST(valid_end_date AS STRING), 5, 2), SUBSTR(CAST(valid_end_date AS STRING), 7, 2)), 'UTC') AS valid_end_date,
invalid_reason
nullif(invalid_reason, '') AS invalid_reason
FROM omop_cdm.concept;
CREATE TABLE omop_cdm_parquet.vocabulary
@ -42,7 +42,7 @@ SELECT
relationship_id,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_start_date AS STRING), 1, 4), SUBSTR(CAST(valid_start_date AS STRING), 5, 2), SUBSTR(CAST(valid_start_date AS STRING), 7, 2)), 'UTC') AS valid_start_date,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_end_date AS STRING), 1, 4), SUBSTR(CAST(valid_end_date AS STRING), 5, 2), SUBSTR(CAST(valid_end_date AS STRING), 7, 2)), 'UTC') AS valid_end_date,
invalid_reason
nullif(invalid_reason, '') AS invalid_reason
FROM omop_cdm.concept_relationship;
CREATE TABLE omop_cdm_parquet.relationship
@ -72,7 +72,7 @@ SELECT
target_vocabulary_id,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_start_date AS STRING), 1, 4), SUBSTR(CAST(valid_start_date AS STRING), 5, 2), SUBSTR(CAST(valid_start_date AS STRING), 7, 2)), 'UTC') AS valid_start_date,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_end_date AS STRING), 1, 4), SUBSTR(CAST(valid_end_date AS STRING), 5, 2), SUBSTR(CAST(valid_end_date AS STRING), 7, 2)), 'UTC') AS valid_end_date,
invalid_reason
nullif(invalid_reason, '') AS invalid_reason
FROM omop_cdm.source_to_concept_map;
CREATE TABLE omop_cdm_parquet.drug_strength
@ -90,7 +90,7 @@ SELECT
box_size,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_start_date AS STRING), 1, 4), SUBSTR(CAST(valid_start_date AS STRING), 5, 2), SUBSTR(CAST(valid_start_date AS STRING), 7, 2)), 'UTC') AS valid_start_date,
TO_UTC_TIMESTAMP(CONCAT_WS('-', SUBSTR(CAST(valid_end_date AS STRING), 1, 4), SUBSTR(CAST(valid_end_date AS STRING), 5, 2), SUBSTR(CAST(valid_end_date AS STRING), 7, 2)), 'UTC') AS valid_end_date,
invalid_reason
nullif(invalid_reason, '') AS invalid_reason
FROM omop_cdm.drug_strength;
CREATE TABLE omop_cdm_parquet.cohort_definition

View File

@ -17,16 +17,17 @@
/************************
####### # # ####### ###### ##### ###### # # ####### #####
# # ## ## # # # # # # # # ## ## # # # # # #### # # #### ##### ##### ## # # # ##### ####
# # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ## # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # #### # # # # # # # # # # ####
# # # # # # # # # # # # # # # # # # # # # # # ##### ###### # # # # # #
# # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # # ## # # #
####### # # ####### # ##### ###### # # ## ##### ##### #### # # #### # # # # # # # # # ####
####### # # ####### ###### ##### ###### # # ####### # ### #####
# # ## ## # # # # # # # # ## ## # # # ## # # # # #### # # #### ##### ##### ## # # # ##### ####
# # # # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ## # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # # # # #### # # # # # # # # # # ####
# # # # # # # # # # # # # # # ### # ### # # # # # # # # # # ##### ###### # # # # # #
# # # # # # # # # # # # # # # # # ### # ### # # # # # # # ## # # # # # # # # # ## # # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ### ##### #### # # #### # # # # # # # # # ####
script to create constraints within OMOP common data model, version 5.0 for Oracle database
script to create constraints within OMOP common data model, version 5.1.0 for Oracle database
last revised: 12 Oct 2014

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # #######
# # ## ## # # # # # # # # ## ## # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ######
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # #
####### # # ####### # ##### ###### # # ## #####
####### # # ####### ###### ##### ###### # # ####### # ###
# # ## ## # # # # # # # # ## ## # # # ## # #
# # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # #
# # # # # # # # # # # # # # # ### # ### # #
# # # # # # # # # # # # # # # # # ### # ### # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ###
script to create OMOP common data model, version 5.0 for Oracle database
script to create OMOP common data model, version 5.1.0 for Oracle database
last revised: 1-May-2016

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # ####### ###
# # ## ## # # # # # # # # ## ## # # # # # # ##### ###### # # ###### ####
# # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # ##### ## ##### ####
# # # # # # # # # # # # # # # # # # # # # # ## # #
# # # # # # # # # # # # # # # # # # # ## # # # # # # # #
####### # # ####### # ##### ###### # # ## ##### ### # # ##### ###### # # ###### ####
####### # # ####### ###### ##### ###### # # ####### # ### ###
# # ## ## # # # # # # # # ## ## # # # ## # # # # # ##### ###### # # ###### ####
# # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # # # # ##### ## ##### ####
# # # # # # # # # # # # # # # ### # ### # # # # # # # # # ## # #
# # # # # # # # # # # # # # # # # ### # ### # # # # ## # # # # # # # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ### ### # # ##### ###### # # ###### ####
script to create the required indexes within OMOP common data model, version 5.0 for Oracle database
script to create the required indexes within OMOP common data model, version 5.1.0 for Oracle database
last revised: 12 Oct 2014

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # ####### ###
# # ## ## # # # # # # # # ## ## # # # # # # ##### ###### # # ###### ####
# # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # ##### ## ##### ####
# # # # # # # # # # # # # # # # # # # # # # ## # #
# # # # # # # # # # # # # # # # # # # ## # # # # # # # #
####### # # ####### # ##### ###### # # ## ##### ### # # ##### ###### # # ###### ####
####### # # ####### ###### ##### ###### # # ####### # ### ###
# # ## ## # # # # # # # # ## ## # # # ## # # # # # ##### ###### # # ###### ####
# # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # # # # ##### ## ##### ####
# # # # # # # # # # # # # # # ### # ### # # # # # # # # # ## # #
# # # # # # # # # # # # # # # # # ### # ### # # # # ## # # # # # # # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ### ### # # ##### ###### # # ###### ####
script to create the required indexes within OMOP common data model, version 5.0 for Oracle database
script to create the required indexes within OMOP common data model, version 5.1.0 for Oracle database
last revised: 12 Oct 2014

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # ####### #####
# # ## ## # # # # # # # # ## ## # # # # # #### # # #### ##### ##### ## # # # ##### ####
# # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ## # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # #### # # # # # # # # # # ####
# # # # # # # # # # # # # # # # # # # # # # # ##### ###### # # # # # #
# # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # # ## # # #
####### # # ####### # ##### ###### # # ## ##### ##### #### # # #### # # # # # # # # # ####
####### # # ####### ###### ##### ###### # # ####### # ### #####
# # ## ## # # # # # # # # ## ## # # # ## # # # # #### # # #### ##### ##### ## # # # ##### ####
# # # # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ## # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # # # # #### # # # # # # # # # # ####
# # # # # # # # # # # # # # # ### # ### # # # # # # # # # # ##### ###### # # # # # #
# # # # # # # # # # # # # # # # # ### # ### # # # # # # # ## # # # # # # # # # ## # # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ### ##### #### # # #### # # # # # # # # # ####
script to create constraints within OMOP common data model, version 5.0 for PostgreSQL database
script to create constraints within OMOP common data model, version 5.1.0 for PostgreSQL database
last revised: 12 Oct 2014

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # #######
# # ## ## # # # # # # # # ## ## # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ######
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # #
####### # # ####### # ##### ###### # # ## #####
####### # # ####### ###### ##### ###### # # ####### # ###
# # ## ## # # # # # # # # ## ## # # # ## # #
# # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # #
# # # # # # # # # # # # # # # ### # ### # #
# # # # # # # # # # # # # # # # # ### # ### # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ###
script to create OMOP common data model, version 5.0 for PostgreSQL database
script to create OMOP common data model, version 5.1.0 for PostgreSQL database
last revised: 1-May-2016

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # ####### ###
# # ## ## # # # # # # # # ## ## # # # # # # ##### ###### # # ###### ####
# # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # ##### ## ##### ####
# # # # # # # # # # # # # # # # # # # # # # ## # #
# # # # # # # # # # # # # # # # # # # ## # # # # # # # #
####### # # ####### # ##### ###### # # ## ##### ### # # ##### ###### # # ###### ####
####### # # ####### ###### ##### ###### # # ####### # ### ###
# # ## ## # # # # # # # # ## ## # # # ## # # # # # ##### ###### # # ###### ####
# # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # # # # ##### ## ##### ####
# # # # # # # # # # # # # # # ### # ### # # # # # # # # # ## # #
# # # # # # # # # # # # # # # # # ### # ### # # # # ## # # # # # # # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ### ### # # ##### ###### # # ###### ####
script to create the required indexes within OMOP common data model, version 5.0 for PostgreSQL database
script to create the required indexes within OMOP common data model, version 5.1.0 for PostgreSQL database
last revised: 12 Oct 2014

View File

@ -1,11 +1,15 @@
Common Data Model v5.1.0
Common Data Model v5.1.1
=================
See full CDM specification file on our github [wiki](https://github.com/OHDSI/CommonDataModel/wiki) or in the [CDM V5.1.0 PDF](https://github.com/OHDSI/CommonDataModel/blob/master/OMOP_CDM_v5_1_0.pdf)
See full CDM specification file on our github [wiki](https://github.com/OHDSI/CommonDataModel/wiki) or in the [CDM V5.1.1 PDF](https://github.com/OHDSI/CommonDataModel/blob/master/OMOP_CDM_v5_1_1.pdf)
Release Notes
Release Notes for v5.1.1
=============
This version is based on this CDM working group proposal [#60](https://github.com/OHDSI/CommonDataModel/issues/60) and [#59](https://github.com/OHDSI/CommonDataModel/issues/59). The proposed and accepted changes include adding a datetime field to every table that had a date column and adding field DENOMINATOR_VALUE to the DRUG_STRENGTH table. These were the new columns added:
This version has a small bug-fix for impala to make it compatible with ATLAS cohort generation.
Release Notes for v5.1.0
=============
This version is based on the CDM working group proposal [#60](https://github.com/OHDSI/CommonDataModel/issues/60) and [#59](https://github.com/OHDSI/CommonDataModel/issues/59) and is **backwards compatibile with v5.0.1**. The proposed and accepted changes include adding a datetime field to every table that had a date column and adding field DENOMINATOR_VALUE to the DRUG_STRENGTH table. These were the new columns added:
**PERSON**
* birth_datetime, not required
@ -47,6 +51,8 @@ This version is based on this CDM working group proposal [#60](https://github.co
**NOTE**
* note_datetime, not required
There are additional changes listed on the [OHDSI wiki](http://www.ohdsi.org/web/wiki/doku.php?id=documentation:next_cdm) that have been accepted but are not listed in this version because after being accepted they were never added to the DDL. Version 5.1.0 as it is now is being used by members of the community and any changes would cause problems so the additional accepted proposals will be added in subsequent versions.
---------
This repo contains the definition of the OMOP Common Data Model. It supports the 4 SQL technologies: Impala, Oracle, Postgres and SQL Server. For each, the DDL, constraints and indexes (if appropriate) are defined.

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # ####### #####
# # ## ## # # # # # # # # ## ## # # # # # #### # # #### ##### ##### ## # # # ##### ####
# # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ## # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # #### # # # # # # # # # # ####
# # # # # # # # # # # # # # # # # # # # # # # ##### ###### # # # # # #
# # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # # ## # # #
####### # # ####### # ##### ###### # # ## ##### ##### #### # # #### # # # # # # # # # ####
####### # # ####### ###### ##### ###### # # ####### # ### #####
# # ## ## # # # # # # # # ## ## # # # ## # # # # #### # # #### ##### ##### ## # # # ##### ####
# # # # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ## # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # # # # #### # # # # # # # # # # ####
# # # # # # # # # # # # # # # ### # ### # # # # # # # # # # ##### ###### # # # # # #
# # # # # # # # # # # # # # # # # ### # ### # # # # # # # ## # # # # # # # # # ## # # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ### ##### #### # # #### # # # # # # # # # ####
script to create constraints within OMOP common data model, version 5.0 for SQL Server database
script to create constraints within OMOP common data model, version 5.1.0 for SQL Server database
last revised: 12 Oct 2014

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # #######
# # ## ## # # # # # # # # ## ## # # #
# # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ######
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # #
####### # # ####### # ##### ###### # # ## #####
####### # # ####### ###### ##### ###### # # ####### # ###
# # ## ## # # # # # # # # ## ## # # # ## # #
# # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # #
# # # # # # # # # # # # # # # ### # ### # #
# # # # # # # # # # # # # # # # # ### # ### # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ###
script to create OMOP common data model, version 5.0 for SQL Server database
script to create OMOP common data model, version 5.1.0 for SQL Server database
last revised: 1-May-2016

View File

@ -17,16 +17,16 @@
/************************
####### # # ####### ###### ##### ###### # # ####### ###
# # ## ## # # # # # # # # ## ## # # # # # # ##### ###### # # ###### ####
# # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # ##### ## ##### ####
# # # # # # # # # # # # # # # # # # # # # # ## # #
# # # # # # # # # # # # # # # # # # # ## # # # # # # # #
####### # # ####### # ##### ###### # # ## ##### ### # # ##### ###### # # ###### ####
####### # # ####### ###### ##### ###### # # ####### # ### ###
# # ## ## # # # # # # # # ## ## # # # ## # # # # # ##### ###### # # ###### ####
# # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #
# # # # # # # ###### # # # # # # # # ###### # # # # # # # # # ##### ## ##### ####
# # # # # # # # # # # # # # # ### # ### # # # # # # # # # ## # #
# # # # # # # # # # # # # # # # # ### # ### # # # # ## # # # # # # # #
####### # # ####### # ##### ###### # # ## ##### ### ##### ### ### ### # # ##### ###### # # ###### ####
script to create the required indexes within OMOP common data model, version 5.0 for SQL Server database
script to create the required indexes within OMOP common data model, version 5.1.0 for SQL Server database
last revised: 12 Oct 2014