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

@ -44,16 +44,16 @@ Standardized vocabulary
--HINT DISTRIBUTE ON RANDOM --HINT DISTRIBUTE ON RANDOM
CREATE TABLE concept ( CREATE TABLE concept (
concept_id INTEGER NOT NULL , concept_id INTEGER NOT NULL ,
concept_name VARCHAR(255) NOT NULL , concept_name VARCHAR(255) NOT NULL ,
domain_id VARCHAR(20) NOT NULL , domain_id VARCHAR(20) NOT NULL ,
vocabulary_id VARCHAR(20) NOT NULL , vocabulary_id VARCHAR(20) NOT NULL ,
concept_class_id VARCHAR(20) NOT NULL , concept_class_id VARCHAR(20) NOT NULL ,
standard_concept VARCHAR(1) NULL , standard_concept VARCHAR(1) NULL ,
concept_code VARCHAR(50) NOT NULL , concept_code VARCHAR(50) NOT NULL ,
valid_start_date DATE NOT NULL , valid_start_date DATE NOT NULL ,
valid_end_date DATE NOT NULL , valid_end_date DATE NOT NULL ,
invalid_reason VARCHAR(1) NULL invalid_reason VARCHAR(1) NULL
) )
; ;
@ -62,9 +62,9 @@ CREATE TABLE concept (
CREATE TABLE vocabulary ( CREATE TABLE vocabulary (
vocabulary_id VARCHAR(20) NOT NULL, vocabulary_id VARCHAR(20) NOT NULL,
vocabulary_name VARCHAR(255) NOT NULL, vocabulary_name VARCHAR(255) NOT NULL,
vocabulary_reference VARCHAR(255) NOT NULL, vocabulary_reference VARCHAR(255) NOT NULL,
vocabulary_version VARCHAR(255) NOT NULL, vocabulary_version VARCHAR(255) NOT NULL,
vocabulary_concept_id INTEGER NOT NULL vocabulary_concept_id INTEGER NOT NULL
) )
; ;
@ -73,7 +73,7 @@ CREATE TABLE vocabulary (
CREATE TABLE domain ( CREATE TABLE domain (
domain_id VARCHAR(20) NOT NULL, domain_id VARCHAR(20) NOT NULL,
domain_name VARCHAR(255) NOT NULL, domain_name VARCHAR(255) NOT NULL,
domain_concept_id INTEGER NOT NULL domain_concept_id INTEGER NOT NULL
) )
; ;
@ -82,7 +82,7 @@ CREATE TABLE domain (
CREATE TABLE concept_class ( CREATE TABLE concept_class (
concept_class_id VARCHAR(20) NOT NULL, concept_class_id VARCHAR(20) NOT NULL,
concept_class_name VARCHAR(255) NOT NULL, concept_class_name VARCHAR(255) NOT NULL,
concept_class_concept_id INTEGER NOT NULL concept_class_concept_id INTEGER NOT NULL
) )
; ;
@ -91,31 +91,31 @@ CREATE TABLE concept_class (
CREATE TABLE concept_relationship ( CREATE TABLE concept_relationship (
concept_id_1 INTEGER NOT NULL, concept_id_1 INTEGER NOT NULL,
concept_id_2 INTEGER NOT NULL, concept_id_2 INTEGER NOT NULL,
relationship_id VARCHAR(20) NOT NULL, relationship_id VARCHAR(20) NOT NULL,
valid_start_date DATE NOT NULL, valid_start_date DATE NOT NULL,
valid_end_date DATE NOT NULL, valid_end_date DATE NOT NULL,
invalid_reason VARCHAR(1) NULL invalid_reason VARCHAR(1) NULL
) )
; ;
--HINT DISTRIBUTE ON RANDOM --HINT DISTRIBUTE ON RANDOM
CREATE TABLE relationship ( CREATE TABLE relationship (
relationship_id VARCHAR(20) NOT NULL, relationship_id VARCHAR(20) NOT NULL,
relationship_name VARCHAR(255) NOT NULL, relationship_name VARCHAR(255) NOT NULL,
is_hierarchical VARCHAR(1) NOT NULL, is_hierarchical VARCHAR(1) NOT NULL,
defines_ancestry VARCHAR(1) NOT NULL, defines_ancestry VARCHAR(1) NOT NULL,
reverse_relationship_id VARCHAR(20) NOT NULL, reverse_relationship_id VARCHAR(20) NOT NULL,
relationship_concept_id INTEGER NOT NULL relationship_concept_id INTEGER NOT NULL
) )
; ;
--HINT DISTRIBUTE ON RANDOM --HINT DISTRIBUTE ON RANDOM
CREATE TABLE concept_synonym ( CREATE TABLE concept_synonym (
concept_id INTEGER NOT NULL, concept_id INTEGER NOT NULL,
concept_synonym_name VARCHAR(1000) NOT NULL, concept_synonym_name VARCHAR(1000) NOT NULL,
language_concept_id INTEGER NOT NULL language_concept_id INTEGER NOT NULL
) )
; ;
@ -123,23 +123,23 @@ CREATE TABLE concept_synonym (
--HINT DISTRIBUTE ON RANDOM --HINT DISTRIBUTE ON RANDOM
CREATE TABLE concept_ancestor ( CREATE TABLE concept_ancestor (
ancestor_concept_id INTEGER NOT NULL, ancestor_concept_id INTEGER NOT NULL,
descendant_concept_id INTEGER NOT NULL, descendant_concept_id INTEGER NOT NULL,
min_levels_of_separation INTEGER NOT NULL, min_levels_of_separation INTEGER NOT NULL,
max_levels_of_separation INTEGER NOT NULL max_levels_of_separation INTEGER NOT NULL
) )
; ;
--HINT DISTRIBUTE ON RANDOM --HINT DISTRIBUTE ON RANDOM
CREATE TABLE source_to_concept_map ( CREATE TABLE source_to_concept_map (
source_code VARCHAR(50) NOT NULL, source_code VARCHAR(50) NOT NULL,
source_concept_id INTEGER NOT NULL, source_concept_id INTEGER NOT NULL,
source_vocabulary_id VARCHAR(20) NOT NULL, source_vocabulary_id VARCHAR(20) NOT NULL,
source_code_description VARCHAR(255) NULL, source_code_description VARCHAR(255) NULL,
target_concept_id INTEGER NOT NULL, target_concept_id INTEGER NOT NULL,
target_vocabulary_id VARCHAR(20) NOT NULL, target_vocabulary_id VARCHAR(20) NOT NULL,
valid_start_date DATE NOT NULL, valid_start_date DATE NOT NULL,
valid_end_date DATE NOT NULL, valid_end_date DATE NOT NULL,
invalid_reason VARCHAR(1) NULL invalid_reason VARCHAR(1) NULL
) )
; ;
@ -147,42 +147,18 @@ CREATE TABLE source_to_concept_map (
--HINT DISTRIBUTE ON RANDOM --HINT DISTRIBUTE ON RANDOM
CREATE TABLE drug_strength ( CREATE TABLE drug_strength (
drug_concept_id INTEGER NOT NULL, drug_concept_id INTEGER NOT NULL,
ingredient_concept_id INTEGER NOT NULL, ingredient_concept_id INTEGER NOT NULL,
amount_value FLOAT NULL, amount_value FLOAT NULL,
amount_unit_concept_id INTEGER NULL, amount_unit_concept_id INTEGER NULL,
numerator_value FLOAT NULL, numerator_value FLOAT NULL,
numerator_unit_concept_id INTEGER NULL, numerator_unit_concept_id INTEGER NULL,
denominator_value FLOAT NULL, denominator_value FLOAT NULL,
denominator_unit_concept_id INTEGER NULL, denominator_unit_concept_id INTEGER NULL,
box_size INTEGER NULL, box_size INTEGER NULL,
valid_start_date DATE NOT NULL, valid_start_date DATE NOT NULL,
valid_end_date DATE NOT NULL, valid_end_date DATE NOT NULL,
invalid_reason VARCHAR(1) NULL invalid_reason VARCHAR(1) NULL
)
;
--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
) )
; ;
@ -197,16 +173,16 @@ Standardized meta-data
--HINT DISTRIBUTE ON RANDOM --HINT DISTRIBUTE ON RANDOM
CREATE TABLE cdm_source CREATE TABLE cdm_source
( (
cdm_source_name VARCHAR(255) NOT NULL , cdm_source_name VARCHAR(255) NOT NULL ,
cdm_source_abbreviation VARCHAR(25) NULL , cdm_source_abbreviation VARCHAR(25) NULL ,
cdm_holder VARCHAR(255) NULL , cdm_holder VARCHAR(255) NULL ,
source_description VARCHAR(MAX) NULL , source_description VARCHAR(MAX) NULL ,
source_documentation_reference VARCHAR(255) NULL , source_documentation_reference VARCHAR(255) NULL ,
cdm_etl_reference VARCHAR(255) NULL , cdm_etl_reference VARCHAR(255) NULL ,
source_release_date DATE NULL , source_release_date DATE NULL ,
cdm_release_date DATE NULL , cdm_release_date DATE NULL ,
cdm_version VARCHAR(10) NULL , cdm_version VARCHAR(10) NULL ,
vocabulary_version VARCHAR(20) NULL vocabulary_version VARCHAR(20) NULL
) )
; ;
@ -220,12 +196,12 @@ CREATE TABLE metadata
value_as_string VARCHAR(MAX) NULL , value_as_string VARCHAR(MAX) NULL ,
value_as_concept_id INTEGER NULL , value_as_concept_id INTEGER NULL ,
metadata_date DATE NULL , metadata_date DATE NULL ,
metadata_datetime DATETIME2 NULL metadata_datetime DATETIME2 NULL
) )
; ;
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)
; ;
@ -239,24 +215,24 @@ Standardized clinical data
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE person CREATE TABLE person
( (
person_id BIGINT NOT NULL , --BIGINTs added person_id BIGINT NOT NULL , --BIGINTs added
gender_concept_id INTEGER NOT NULL , gender_concept_id INTEGER NOT NULL ,
year_of_birth INTEGER NOT NULL , year_of_birth INTEGER NOT NULL ,
month_of_birth INTEGER NULL, month_of_birth INTEGER NULL,
day_of_birth INTEGER NULL, day_of_birth INTEGER NULL,
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,
race_source_value VARCHAR(50) NULL, race_source_value VARCHAR(50) NULL,
race_source_concept_id INTEGER NULL, race_source_concept_id INTEGER NULL,
ethnicity_source_value VARCHAR(50) NULL, ethnicity_source_value VARCHAR(50) NULL,
ethnicity_source_concept_id INTEGER NULL ethnicity_source_concept_id INTEGER NULL
) )
; ;
@ -264,11 +240,11 @@ CREATE TABLE person
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE observation_period CREATE TABLE observation_period
( (
observation_period_id BIGINT NOT NULL , observation_period_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
observation_period_start_date DATE NOT NULL , observation_period_start_date DATE NOT NULL ,
observation_period_end_date DATE NOT NULL , observation_period_end_date DATE NOT NULL ,
period_type_concept_id INTEGER NOT NULL period_type_concept_id INTEGER NOT NULL
) )
; ;
@ -276,59 +252,59 @@ CREATE TABLE observation_period
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE specimen CREATE TABLE specimen
( (
specimen_id BIGINT NOT NULL , specimen_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
specimen_concept_id INTEGER NOT NULL , specimen_concept_id INTEGER NOT NULL ,
specimen_type_concept_id INTEGER NOT NULL , specimen_type_concept_id INTEGER NOT NULL ,
specimen_date DATE NULL , specimen_date DATE NULL ,
specimen_datetime DATETIME2 NOT NULL , specimen_datetime DATETIME2 NOT NULL ,
quantity FLOAT NULL , quantity FLOAT NULL ,
unit_concept_id INTEGER NULL , unit_concept_id INTEGER NULL ,
anatomic_site_concept_id INTEGER NULL , anatomic_site_concept_id INTEGER NULL ,
disease_status_concept_id INTEGER NULL , disease_status_concept_id INTEGER NULL ,
specimen_source_id VARCHAR(50) NULL , specimen_source_id VARCHAR(50) NULL ,
specimen_source_value VARCHAR(50) NULL , specimen_source_value VARCHAR(50) NULL ,
unit_source_value VARCHAR(50) NULL , unit_source_value VARCHAR(50) NULL ,
anatomic_site_source_value VARCHAR(50) NULL , anatomic_site_source_value VARCHAR(50) NULL ,
disease_status_source_value VARCHAR(50) NULL disease_status_source_value VARCHAR(50) NULL
) )
; ;
--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 ,
death_datetime DATETIME2 NOT NULL , death_datetime DATETIME2 NOT NULL ,
death_type_concept_id INTEGER NOT NULL , death_type_concept_id INTEGER NOT NULL ,
cause_concept_id INTEGER NULL , cause_concept_id INTEGER NULL ,
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)
CREATE TABLE visit_occurrence CREATE TABLE visit_occurrence
( (
visit_occurrence_id BIGINT NOT NULL , visit_occurrence_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
visit_concept_id INTEGER NOT NULL , visit_concept_id INTEGER NOT NULL ,
visit_start_date DATE NULL , visit_start_date DATE NULL ,
visit_start_datetime DATETIME2 NOT NULL , visit_start_datetime DATETIME2 NOT NULL ,
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 ,
@ -362,20 +338,20 @@ CREATE TABLE visit_detail
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE procedure_occurrence CREATE TABLE procedure_occurrence
( (
procedure_occurrence_id BIGINT NOT NULL , procedure_occurrence_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
procedure_concept_id INTEGER NOT NULL , procedure_concept_id INTEGER NOT NULL ,
procedure_date DATE NULL , procedure_date DATE NULL ,
procedure_datetime DATETIME2 NOT NULL , procedure_datetime DATETIME2 NOT NULL ,
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
) )
; ;
@ -383,29 +359,29 @@ CREATE TABLE procedure_occurrence
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE drug_exposure CREATE TABLE drug_exposure
( (
drug_exposure_id BIGINT NOT NULL , drug_exposure_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
drug_concept_id INTEGER NOT NULL , drug_concept_id INTEGER NOT NULL ,
drug_exposure_start_date DATE NULL , drug_exposure_start_date DATE NULL ,
drug_exposure_start_datetime DATETIME2 NOT NULL , drug_exposure_start_datetime DATETIME2 NOT NULL ,
drug_exposure_end_date DATE NULL , drug_exposure_end_date DATE NULL ,
drug_exposure_end_datetime DATETIME2 NOT NULL , drug_exposure_end_datetime DATETIME2 NOT NULL ,
verbatim_end_date DATE NULL , verbatim_end_date DATE NULL ,
drug_type_concept_id INTEGER NOT NULL , drug_type_concept_id INTEGER NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
refills INTEGER NULL , refills INTEGER NULL ,
quantity FLOAT NULL , quantity FLOAT NULL ,
days_supply INTEGER NULL , days_supply INTEGER NULL ,
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 ,
dose_unit_source_value VARCHAR(50) NULL dose_unit_source_value VARCHAR(50) NULL
) )
; ;
@ -413,21 +389,21 @@ CREATE TABLE drug_exposure
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE device_exposure CREATE TABLE device_exposure
( (
device_exposure_id BIGINT NOT NULL , device_exposure_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
device_concept_id INTEGER NOT NULL , device_concept_id INTEGER NOT NULL ,
device_exposure_start_date DATE NULL , device_exposure_start_date DATE NULL ,
device_exposure_start_datetime DATETIME2 NOT NULL , device_exposure_start_datetime DATETIME2 NOT NULL ,
device_exposure_end_date DATE NULL , device_exposure_end_date DATE NULL ,
device_exposure_end_datetime DATETIME2 NULL , device_exposure_end_datetime DATETIME2 NULL ,
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
) )
; ;
@ -435,22 +411,22 @@ CREATE TABLE device_exposure
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE condition_occurrence CREATE TABLE condition_occurrence
( (
condition_occurrence_id BIGINT NOT NULL , condition_occurrence_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
condition_concept_id INTEGER NOT NULL , condition_concept_id INTEGER NOT NULL ,
condition_start_date DATE NULL , condition_start_date DATE NULL ,
condition_start_datetime DATETIME2 NOT NULL , condition_start_datetime DATETIME2 NOT NULL ,
condition_end_date DATE NULL , condition_end_date DATE NULL ,
condition_end_datetime DATETIME2 NULL , condition_end_datetime DATETIME2 NULL ,
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
) )
; ;
@ -458,26 +434,26 @@ CREATE TABLE condition_occurrence
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE measurement CREATE TABLE measurement
( (
measurement_id BIGINT NOT NULL , measurement_id BIGINT NOT NULL ,
person_id BIGINT NOT NULL , person_id BIGINT NOT NULL ,
measurement_concept_id INTEGER NOT NULL , measurement_concept_id INTEGER NOT NULL ,
measurement_date DATE NULL , measurement_date DATE NULL ,
measurement_datetime DATETIME2 NOT NULL , measurement_datetime DATETIME2 NOT NULL ,
measurement_time VARCHAR(10) NULL, measurement_time VARCHAR(10) NULL,
measurement_type_concept_id INTEGER NOT NULL , measurement_type_concept_id INTEGER NOT NULL ,
operator_concept_id INTEGER NULL , operator_concept_id INTEGER NULL ,
value_as_number FLOAT NULL , value_as_number FLOAT NULL ,
value_as_concept_id INTEGER NULL , value_as_concept_id INTEGER NULL ,
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 ,
value_source_value VARCHAR(50) NULL value_source_value VARCHAR(50) NULL
) )
; ;
@ -485,23 +461,23 @@ CREATE TABLE measurement
--HINT DISTRIBUTE_ON_KEY(person_id) --HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE note 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 ,
note_class_concept_id INTEGER NOT NULL , note_class_concept_id INTEGER NOT NULL ,
note_title VARCHAR(250) NULL , note_title VARCHAR(250) NULL ,
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
) )
; ;
@ -509,20 +485,20 @@ CREATE TABLE note
--HINT DISTRIBUTE ON RANDOM --HINT DISTRIBUTE ON RANDOM
CREATE TABLE note_nlp CREATE TABLE note_nlp
( (
note_nlp_id BIGINT NOT NULL , note_nlp_id BIGINT NOT NULL ,
note_id BIGINT NOT NULL , note_id BIGINT NOT NULL ,
section_concept_id INTEGER NULL , section_concept_id INTEGER NULL ,
snippet VARCHAR(250) NULL , snippet VARCHAR(250) NULL ,
"offset" VARCHAR(250) NULL , "offset" VARCHAR(250) NULL ,
lexical_variant VARCHAR(250) NOT NULL , lexical_variant VARCHAR(250) NOT NULL ,
note_nlp_concept_id INTEGER NULL , note_nlp_concept_id INTEGER NULL ,
nlp_system VARCHAR(250) NULL , nlp_system VARCHAR(250) NULL ,
nlp_date DATE NOT NULL , nlp_date DATE NOT NULL ,
nlp_datetime DATETIME2 NULL , nlp_datetime DATETIME2 NULL ,
term_exists VARCHAR(1) NULL , term_exists VARCHAR(1) NULL ,
term_temporal VARCHAR(50) NULL , term_temporal VARCHAR(50) NULL ,
term_modifiers VARCHAR(2000) NULL , term_modifiers VARCHAR(2000) NULL ,
note_nlp_source_concept_id INTEGER NULL note_nlp_source_concept_id INTEGER NULL
) )
; ;