Corrections after results from testers

This commit is contained in:
Clair Blacketer 2018-09-20 14:31:06 -04:00
parent 4d53d7d75b
commit 9e4ae062d9
1 changed files with 235 additions and 259 deletions

View File

@ -163,30 +163,6 @@ CREATE TABLE drug_strength (
; ;
--HINT DISTRIBUTE ON RANDOM
CREATE TABLE cohort_definition (
cohort_definition_id INTEGER NOT NULL,
cohort_definition_name VARCHAR(255) NOT NULL,
cohort_definition_description VARCHAR(MAX) NULL,
definition_type_concept_id INTEGER NOT NULL,
cohort_definition_syntax VARCHAR(MAX) NULL,
subject_concept_id INTEGER NOT NULL,
cohort_initiation_date DATE NULL
)
;
--HINT DISTRIBUTE ON RANDOM
CREATE TABLE attribute_definition (
attribute_definition_id INTEGER NOT NULL,
attribute_name VARCHAR(255) NOT NULL,
attribute_description VARCHAR(MAX) NULL,
attribute_type_concept_id INTEGER NOT NULL,
attribute_syntax VARCHAR(MAX) NULL
)
;
/************************** /**************************
Standardized meta-data Standardized meta-data
@ -224,8 +200,8 @@ CREATE TABLE metadata
) )
; ;
INSERT INTO metadata (name, value_as_string) --Added cdm version record INSERT INTO metadata (metadata_concept_id, metadata_type_concept_id, name, value_as_string, value_as_concept_id, metadata_date, metadata_datetime) --Added cdm version record
VALUES ('CDM Version', '6.0') VALUES (0,0,'CDM Version', '6.0',0,NULL,NULL)
; ;
@ -247,9 +223,9 @@ CREATE TABLE person
birth_datetime DATETIME2 NULL, birth_datetime DATETIME2 NULL,
race_concept_id INTEGER NOT NULL, race_concept_id INTEGER NOT NULL,
ethnicity_concept_id INTEGER NOT NULL, ethnicity_concept_id INTEGER NOT NULL,
location_id INTEGER NULL, location_id BIGINT NULL,
provider_id INTEGER NULL, provider_id BIGINT NULL,
care_site_id INTEGER NULL, care_site_id BIGINT NULL,
person_source_value VARCHAR(50) NULL, person_source_value VARCHAR(50) NULL,
gender_source_value VARCHAR(50) NULL, gender_source_value VARCHAR(50) NULL,
gender_source_concept_id INTEGER NULL, gender_source_concept_id INTEGER NULL,
@ -296,7 +272,7 @@ CREATE TABLE specimen
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE death /*CREATE TABLE death
( (
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
death_date DATE NULL , death_date DATE NULL ,
@ -306,7 +282,7 @@ CREATE TABLE death
cause_source_value VARCHAR(50) NULL, cause_source_value VARCHAR(50) NULL,
cause_source_concept_id INTEGER NULL cause_source_concept_id INTEGER NULL
) )
; ;*/
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
@ -320,15 +296,15 @@ CREATE TABLE visit_occurrence
visit_end_date DATE NULL , visit_end_date DATE NULL ,
visit_end_datetime DATETIME2 NOT NULL , visit_end_datetime DATETIME2 NOT NULL ,
visit_type_concept_id INTEGER NOT NULL , visit_type_concept_id INTEGER NOT NULL ,
provider_id INTEGER NULL, provider_id BIGINT NULL,
care_site_id INTEGER NULL, care_site_id BIGINT NULL,
visit_source_value VARCHAR(50) NULL, visit_source_value VARCHAR(50) NULL,
visit_source_concept_id INTEGER NULL , visit_source_concept_id INTEGER NULL ,
admitted_from_concept_id INTEGER NULL , /*Changed from admitting_source_* */ admitted_from_concept_id INTEGER NULL , /*Changed from admitting_source_* */
admitted_from_source_value VARCHAR(50) NULL , admitted_from_source_value VARCHAR(50) NULL ,
discharge_to_source_value VARCHAR(50) NULL , discharge_to_source_value VARCHAR(50) NULL ,
discharge_to_concept_id INTEGER NULL , discharge_to_concept_id INTEGER NULL ,
preceding_visit_occurrence_id INTEGER NULL preceding_visit_occurrence_id BIGINT NULL
) )
; ;
@ -344,8 +320,8 @@ CREATE TABLE visit_detail
visit_detail_end_date DATE NULL , visit_detail_end_date DATE NULL ,
visit_detail_end_datetime DATETIME2 NOT NULL , visit_detail_end_datetime DATETIME2 NOT NULL ,
visit_detail_type_concept_id INTEGER NOT NULL , visit_detail_type_concept_id INTEGER NOT NULL ,
provider_id INTEGER NULL , provider_id BIGINT NULL ,
care_site_id INTEGER NULL , care_site_id BIGINT NULL ,
discharge_to_concept_id INTEGER NULL , discharge_to_concept_id INTEGER NULL ,
admitted_from_concept_id INTEGER NULL , /*Changed from admitting_source_* */ admitted_from_concept_id INTEGER NULL , /*Changed from admitting_source_* */
admitted_from_source_value VARCHAR(50) NULL , admitted_from_source_value VARCHAR(50) NULL ,
@ -370,12 +346,12 @@ CREATE TABLE procedure_occurrence
procedure_type_concept_id INTEGER NOT NULL , procedure_type_concept_id INTEGER NOT NULL ,
modifier_concept_id INTEGER NULL , modifier_concept_id INTEGER NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
provider_id INTEGER NULL , provider_id BIGINT NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id INTEGER NULL , visit_detail_id BIGINT NULL ,
procedure_source_value VARCHAR(50) NULL , procedure_source_value VARCHAR(50) NULL ,
procedure_source_concept_id INTEGER NULL , procedure_source_concept_id INTEGER NULL ,
modifier_source_value VARCHAR(50) NULL , modifier_source_value VARCHAR(50) NULL
) )
; ;
@ -399,9 +375,9 @@ CREATE TABLE drug_exposure
sig VARCHAR(MAX) NULL , sig VARCHAR(MAX) NULL ,
route_concept_id INTEGER NULL , route_concept_id INTEGER NULL ,
lot_number VARCHAR(50) NULL , lot_number VARCHAR(50) NULL ,
provider_id INTEGER NULL , provider_id BIGINT NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id INTEGER NULL , visit_detail_id BIGINT NULL ,
drug_source_value VARCHAR(50) NULL , drug_source_value VARCHAR(50) NULL ,
drug_source_concept_id INTEGER NULL , drug_source_concept_id INTEGER NULL ,
route_source_value VARCHAR(50) NULL , route_source_value VARCHAR(50) NULL ,
@ -423,9 +399,9 @@ CREATE TABLE device_exposure
device_type_concept_id INTEGER NOT NULL , device_type_concept_id INTEGER NOT NULL ,
unique_device_id VARCHAR(50) NULL , unique_device_id VARCHAR(50) NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
provider_id INTEGER NULL , provider_id BIGINT NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id INTEGER NULL , visit_detail_id BIGINT NULL ,
device_source_value VARCHAR(100) NULL , device_source_value VARCHAR(100) NULL ,
device_source_concept_id INTEGER NULL device_source_concept_id INTEGER NULL
) )
@ -445,9 +421,9 @@ CREATE TABLE condition_occurrence
condition_type_concept_id INTEGER NOT NULL , condition_type_concept_id INTEGER NOT NULL ,
condition_status_concept_id INTEGER NULL , condition_status_concept_id INTEGER NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
provider_id INTEGER NULL , provider_id BIGINT NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id INTEGER NULL , visit_detail_id BIGINT NULL ,
condition_source_value VARCHAR(50) NULL , condition_source_value VARCHAR(50) NULL ,
condition_source_concept_id INTEGER NULL , condition_source_concept_id INTEGER NULL ,
condition_status_source_value VARCHAR(50) NULL condition_status_source_value VARCHAR(50) NULL
@ -471,9 +447,9 @@ CREATE TABLE measurement
unit_concept_id INTEGER NULL , unit_concept_id INTEGER NULL ,
range_low FLOAT NULL , range_low FLOAT NULL ,
range_high FLOAT NULL , range_high FLOAT NULL ,
provider_id INTEGER NULL , provider_id BIGINT NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id INTEGER NULL , visit_detail_id BIGINT NULL ,
measurement_source_value VARCHAR(50) NULL , measurement_source_value VARCHAR(50) NULL ,
measurement_source_concept_id INTEGER NULL , measurement_source_concept_id INTEGER NULL ,
unit_source_value VARCHAR(50) NULL , unit_source_value VARCHAR(50) NULL ,
@ -487,9 +463,9 @@ CREATE TABLE note
( (
note_id BIGINT NOT NULL , note_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
note_event_id BIGINT NULL , --This and the field below added note_event_id BIGINT NULL ,
note_domain_id VARCHAR(20) NULL , --This field may be removed in favor of the one below note_event_domain_id VARCHAR(20) NULL ,
--note_event_table_concept_id INTEGER NULL , --This may be added based on 9/4 meeting note_event_field_concept_id INTEGER NULL ,
note_date DATE NULL , note_date DATE NULL ,
note_datetime DATETIME2 NOT NULL , note_datetime DATETIME2 NOT NULL ,
note_type_concept_id INTEGER NOT NULL , note_type_concept_id INTEGER NOT NULL ,
@ -498,9 +474,9 @@ CREATE TABLE note
note_text VARCHAR(MAX) NULL , note_text VARCHAR(MAX) NULL ,
encoding_concept_id INTEGER NOT NULL , encoding_concept_id INTEGER NOT NULL ,
language_concept_id INTEGER NOT NULL , language_concept_id INTEGER NOT NULL ,
provider_id INTEGER NULL , provider_id BIGINT NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id INTEGER NULL , visit_detail_id BIGINT NULL ,
note_source_value VARCHAR(50) NULL note_source_value VARCHAR(50) NULL
) )
; ;