concept_id not null updates

This commit is contained in:
clairblacketer 2018-10-03 10:13:20 -04:00
parent 7b11ba434c
commit 2080e3cfd0
6 changed files with 303 additions and 317 deletions

View File

@ -241,11 +241,11 @@ CREATE TABLE person
care_site_id BIGINT 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 NOT NULL,
race_source_value VARCHAR(50) NULL, race_source_value VARCHAR(50) NULL,
race_source_concept_id INTEGER NULL, race_source_concept_id INTEGER NOT NULL,
ethnicity_source_value VARCHAR(50) NULL, ethnicity_source_value VARCHAR(50) NULL,
ethnicity_source_concept_id INTEGER NULL ethnicity_source_concept_id INTEGER NOT NULL
) )
DISTRIBUTE ON (person_id); DISTRIBUTE ON (person_id);
@ -275,8 +275,8 @@ CREATE TABLE specimen
specimen_datetime DATETIME NOT NULL , specimen_datetime DATETIME NOT NULL ,
quantity REAL NULL , quantity REAL NULL ,
unit_concept_id INTEGER NULL , unit_concept_id INTEGER NULL ,
anatomic_site_concept_id INTEGER NULL , anatomic_site_concept_id INTEGER NOT NULL ,
disease_status_concept_id INTEGER NULL , disease_status_concept_id INTEGER NOT 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 ,
@ -301,11 +301,11 @@ CREATE TABLE visit_occurrence
provider_id BIGINT NULL, provider_id BIGINT NULL,
care_site_id BIGINT 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 NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
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 NOT NULL ,
preceding_visit_occurrence_id INTEGER NULL preceding_visit_occurrence_id INTEGER NULL
) )
@ -325,11 +325,11 @@ CREATE TABLE visit_detail
visit_detail_type_concept_id INTEGER NOT NULL , visit_detail_type_concept_id INTEGER NOT NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
care_site_id BIGINT NULL , care_site_id BIGINT NULL ,
discharge_to_concept_id INTEGER NULL , discharge_to_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
admitted_from_source_value VARCHAR(50) NULL , admitted_from_source_value VARCHAR(50) NULL ,
visit_detail_source_value VARCHAR(50) NULL , visit_detail_source_value VARCHAR(50) NULL ,
visit_detail_source_concept_id INTEGER NULL , visit_detail_source_concept_id INTEGER NOT NULL ,
discharge_to_source_value VARCHAR(50) NULL , discharge_to_source_value VARCHAR(50) NULL ,
preceding_visit_detail_id BIGINT NULL , preceding_visit_detail_id BIGINT NULL ,
visit_detail_parent_id BIGINT NULL , visit_detail_parent_id BIGINT NULL ,
@ -348,13 +348,13 @@ CREATE TABLE procedure_occurrence
procedure_date DATE NULL , procedure_date DATE NULL ,
procedure_datetime DATETIME NOT NULL , procedure_datetime DATETIME 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 NOT NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT NULL ,
modifier_source_value VARCHAR(50) NULL modifier_source_value VARCHAR(50) NULL
) )
@ -378,13 +378,13 @@ CREATE TABLE drug_exposure
quantity REAL NULL , quantity REAL NULL ,
days_supply INTEGER NULL , days_supply INTEGER NULL ,
sig VARCHAR(1000) NULL , sig VARCHAR(1000) NULL ,
route_concept_id INTEGER NULL , route_concept_id INTEGER NOT NULL ,
lot_number VARCHAR(50) NULL , lot_number VARCHAR(50) NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT 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
) )
@ -409,7 +409,7 @@ CREATE TABLE device_exposure
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT NULL
) )
DISTRIBUTE ON (person_id); DISTRIBUTE ON (person_id);
@ -426,13 +426,13 @@ CREATE TABLE condition_occurrence
condition_end_date DATE NULL , condition_end_date DATE NULL ,
condition_end_datetime DATETIME NULL , condition_end_datetime DATETIME 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 NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT NULL ,
condition_status_source_value VARCHAR(50) NULL condition_status_source_value VARCHAR(50) NULL
) )
@ -459,7 +459,7 @@ CREATE TABLE measurement
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT 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
) )
@ -473,7 +473,7 @@ 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 , note_event_id BIGINT NULL ,
note_event_field_concept_id INTEGER NULL , note_event_field_concept_id INTEGER NOT NULL ,
note_date DATE NULL , note_date DATE NULL ,
note_datetime DATETIME NOT NULL , note_datetime DATETIME NOT NULL ,
note_type_concept_id INTEGER NOT NULL , note_type_concept_id INTEGER NOT NULL ,
@ -496,18 +496,18 @@ 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 NOT 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 NOT NULL ,
nlp_system VARCHAR(250) NULL , nlp_system VARCHAR(250) NULL ,
nlp_date DATE NOT NULL , nlp_date DATE NOT NULL ,
nlp_datetime DATETIME NULL , nlp_datetime DATETIME 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 NOT NULL
) )
DISTRIBUTE ON RANDOM DISTRIBUTE ON RANDOM
; ;
@ -531,11 +531,11 @@ CREATE TABLE observation
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT NULL , visit_detail_id BIGINT NULL ,
observation_source_value VARCHAR(50) NULL , observation_source_value VARCHAR(50) NULL ,
observation_source_concept_id INTEGER NULL , observation_source_concept_id INTEGER NOT NULL ,
unit_source_value VARCHAR(50) NULL , unit_source_value VARCHAR(50) NULL ,
qualifier_source_value VARCHAR(50) NULL , qualifier_source_value VARCHAR(50) NULL ,
observation_event_id BIGINT NULL , observation_event_id BIGINT NULL ,
obs_event_field_concept_id INTEGER NULL , obs_event_field_concept_id INTEGER NOT NULL ,
value_as_datetime DATETIME NULL value_as_datetime DATETIME NULL
) )
DISTRIBUTE ON (person_id) DISTRIBUTE ON (person_id)
@ -553,18 +553,18 @@ CREATE TABLE survey_conduct
survey_end_date DATE NULL , survey_end_date DATE NULL ,
survey_end_datetime DATETIME NOT NULL , survey_end_datetime DATETIME NOT NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
assisted_concept_id INTEGER NULL , assisted_concept_id INTEGER NOT NULL ,
respondent_type_concept_id INTEGER NULL , respondent_type_concept_id INTEGER NOT NULL ,
timing_concept_id INTEGER NULL , timing_concept_id INTEGER NOT NULL ,
collection_method_concept_id INTEGER NULL , collection_method_concept_id INTEGER NOT NULL ,
assisted_source_value VARCHAR(50) NULL , assisted_source_value VARCHAR(50) NULL ,
respondent_type_source_value VARCHAR(100) NULL , respondent_type_source_value VARCHAR(100) NULL ,
timing_source_value VARCHAR(100) NULL , timing_source_value VARCHAR(100) NULL ,
collection_method_source_value VARCHAR(100) NULL , collection_method_source_value VARCHAR(100) NULL ,
survey_source_value VARCHAR(100) NULL , survey_source_value VARCHAR(100) NULL ,
survey_source_concept_id INTEGER NULL , survey_source_concept_id INTEGER NOT NULL ,
survey_source_identifier VARCHAR(100) NULL , survey_source_identifier VARCHAR(100) NULL ,
validated_survey_concept_id INTEGER NULL , validated_survey_concept_id INTEGER NOT NULL ,
validated_survey_source_value VARCHAR(100) NULL , validated_survey_source_value VARCHAR(100) NULL ,
survey_version_number VARCHAR(20) NULL , survey_version_number VARCHAR(20) NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
@ -619,7 +619,7 @@ CREATE TABLE location_history
( (
location_history_id BIGINT NOT NULL , location_history_id BIGINT NOT NULL ,
location_id BIGINT NOT NULL , location_id BIGINT NOT NULL ,
relationship_type_concept_id INTEGER NULL , relationship_type_concept_id INTEGER NOT NULL ,
domain_id VARCHAR(50) NOT NULL , domain_id VARCHAR(50) NOT NULL ,
entity_id BIGINT NOT NULL , entity_id BIGINT NOT NULL ,
start_date DATE NOT NULL , start_date DATE NOT NULL ,
@ -634,7 +634,7 @@ CREATE TABLE care_site
( (
care_site_id BIGINT NOT NULL , care_site_id BIGINT NOT NULL ,
care_site_name VARCHAR(255) NULL , care_site_name VARCHAR(255) NULL ,
place_of_service_concept_id INTEGER NULL , place_of_service_concept_id INTEGER NOT NULL ,
location_id BIGINT NULL , location_id BIGINT NULL ,
care_site_source_value VARCHAR(50) NULL , care_site_source_value VARCHAR(50) NULL ,
place_of_service_source_value VARCHAR(50) NULL place_of_service_source_value VARCHAR(50) NULL
@ -650,15 +650,15 @@ CREATE TABLE provider
provider_name VARCHAR(255) NULL , provider_name VARCHAR(255) NULL ,
NPI VARCHAR(20) NULL , NPI VARCHAR(20) NULL ,
DEA VARCHAR(20) NULL , DEA VARCHAR(20) NULL ,
specialty_concept_id INTEGER NULL , specialty_concept_id INTEGER NOT NULL ,
care_site_id BIGINT NULL , care_site_id BIGINT NULL ,
year_of_birth INTEGER NULL , year_of_birth INTEGER NULL ,
gender_concept_id INTEGER NULL , gender_concept_id INTEGER NOT NULL ,
provider_source_value VARCHAR(50) NULL , provider_source_value VARCHAR(50) NULL ,
specialty_source_value VARCHAR(50) NULL , specialty_source_value VARCHAR(50) NULL ,
specialty_source_concept_id INTEGER NULL , specialty_source_concept_id INTEGER NOT NULL ,
gender_source_value VARCHAR(50) NULL , gender_source_value VARCHAR(50) NULL ,
gender_source_concept_id INTEGER NULL gender_source_concept_id INTEGER NOT NULL
) )
DISTRIBUTE ON RANDOM DISTRIBUTE ON RANDOM
; ;
@ -679,22 +679,22 @@ CREATE TABLE payer_plan_period
contract_person_id BIGINT NULL , contract_person_id BIGINT NULL ,
payer_plan_period_start_date DATE NOT NULL , payer_plan_period_start_date DATE NOT NULL ,
payer_plan_period_end_date DATE NOT NULL , payer_plan_period_end_date DATE NOT NULL ,
payer_concept_id INTEGER NULL , payer_concept_id INTEGER NOT NULL ,
plan_concept_id INTEGER NULL , plan_concept_id INTEGER NOT NULL ,
contract_concept_id INTEGER NULL , contract_concept_id INTEGER NOT NULL ,
sponsor_concept_id INTEGER NULL , sponsor_concept_id INTEGER NOT NULL ,
stop_reason_concept_id INTEGER NULL , stop_reason_concept_id INTEGER NOT NULL ,
payer_source_value VARCHAR(50) NULL , payer_source_value VARCHAR(50) NULL ,
payer_source_concept_id INTEGER NULL , payer_source_concept_id INTEGER NOT NULL ,
plan_source_value VARCHAR(50) NULL , plan_source_value VARCHAR(50) NULL ,
plan_source_concept_id INTEGER NULL , plan_source_concept_id INTEGER NOT NULL ,
contract_source_value VARCHAR(50) NULL , contract_source_value VARCHAR(50) NULL ,
contract_source_concept_id INTEGER NULL , contract_source_concept_id INTEGER NOT NULL ,
sponsor_source_value VARCHAR(50) NULL , sponsor_source_value VARCHAR(50) NULL ,
sponsor_source_concept_id INTEGER NULL , sponsor_source_concept_id INTEGER NOT NULL ,
family_source_value VARCHAR(50) NULL , family_source_value VARCHAR(50) NULL ,
stop_reason_source_value VARCHAR(50) NULL , stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL stop_reason_source_concept_id INTEGER NOT NULL
) )
DISTRIBUTE ON (person_id) DISTRIBUTE ON (person_id)
; ;
@ -709,15 +709,15 @@ CREATE TABLE cost
cost_event_field_concept_id INTEGER NOT NULL , cost_event_field_concept_id INTEGER NOT NULL ,
cost_concept_id INTEGER NOT NULL , cost_concept_id INTEGER NOT NULL ,
cost_type_concept_id INTEGER NOT NULL , cost_type_concept_id INTEGER NOT NULL ,
currency_concept_id INTEGER NULL , currency_concept_id INTEGER NOT NULL ,
cost REAL NULL , cost REAL NULL ,
incurred_date DATE NOT NULL , incurred_date DATE NOT NULL ,
billed_date DATE NULL , billed_date DATE NULL ,
paid_date DATE NULL , paid_date DATE NULL ,
revenue_code_concept_id INTEGER NULL , revenue_code_concept_id INTEGER NOT NULL ,
drg_concept_id INTEGER NULL , drg_concept_id INTEGER NOT NULL ,
cost_source_value VARCHAR(50) NULL , cost_source_value VARCHAR(50) NULL ,
cost_source_concept_id INTEGER NULL , cost_source_concept_id INTEGER NOT NULL ,
revenue_code_source_value VARCHAR(50) NULL , revenue_code_source_value VARCHAR(50) NULL ,
drg_source_value VARCHAR(3) NULL , drg_source_value VARCHAR(3) NULL ,
payer_plan_period_id BIGINT NULL payer_plan_period_id BIGINT NULL

View File

@ -229,11 +229,11 @@ CREATE TABLE person
care_site_id NUMBER(19) NULL, care_site_id NUMBER(19) 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 NOT NULL,
race_source_value VARCHAR(50) NULL, race_source_value VARCHAR(50) NULL,
race_source_concept_id INTEGER NULL, race_source_concept_id INTEGER NOT NULL,
ethnicity_source_value VARCHAR(50) NULL, ethnicity_source_value VARCHAR(50) NULL,
ethnicity_source_concept_id INTEGER NULL ethnicity_source_concept_id INTEGER NOT NULL
) )
; ;
@ -261,8 +261,8 @@ CREATE TABLE specimen
specimen_datetime TIMESTAMP NOT NULL , specimen_datetime TIMESTAMP 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 NOT NULL ,
disease_status_concept_id INTEGER NULL , disease_status_concept_id INTEGER NOT 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 ,
@ -286,11 +286,11 @@ CREATE TABLE visit_occurrence
provider_id NUMBER(19) NULL, provider_id NUMBER(19) NULL,
care_site_id NUMBER(19) NULL, care_site_id NUMBER(19) NULL,
visit_source_value VARCHAR(50) NULL, visit_source_value VARCHAR(50) NULL,
visit_source_concept_id INTEGER NULL , visit_source_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
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 NOT NULL ,
preceding_visit_occurrence_id INTEGER NULL preceding_visit_occurrence_id INTEGER NULL
) )
; ;
@ -309,11 +309,11 @@ CREATE TABLE visit_detail
visit_detail_type_concept_id INTEGER NOT NULL , visit_detail_type_concept_id INTEGER NOT NULL ,
provider_id NUMBER(19) NULL , provider_id NUMBER(19) NULL ,
care_site_id NUMBER(19) NULL , care_site_id NUMBER(19) NULL ,
discharge_to_concept_id INTEGER NULL , discharge_to_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
admitted_from_source_value VARCHAR(50) NULL , admitted_from_source_value VARCHAR(50) NULL ,
visit_detail_source_value VARCHAR(50) NULL , visit_detail_source_value VARCHAR(50) NULL ,
visit_detail_source_concept_id INTEGER NULL , visit_detail_source_concept_id INTEGER NOT NULL ,
discharge_to_source_value VARCHAR(50) NULL , discharge_to_source_value VARCHAR(50) NULL ,
preceding_visit_detail_id NUMBER(19) NULL , preceding_visit_detail_id NUMBER(19) NULL ,
visit_detail_parent_id NUMBER(19) NULL , visit_detail_parent_id NUMBER(19) NULL ,
@ -331,13 +331,13 @@ CREATE TABLE procedure_occurrence
procedure_date DATE NULL , procedure_date DATE NULL ,
procedure_datetime TIMESTAMP NOT NULL , procedure_datetime TIMESTAMP 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 NOT NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
provider_id NUMBER(19) NULL , provider_id NUMBER(19) NULL ,
visit_occurrence_id NUMBER(19) NULL , visit_occurrence_id NUMBER(19) NULL ,
visit_detail_id NUMBER(19) NULL , visit_detail_id NUMBER(19) NULL ,
procedure_source_value VARCHAR(50) NULL , procedure_source_value VARCHAR(50) NULL ,
procedure_source_concept_id INTEGER NULL , procedure_source_concept_id INTEGER NOT NULL ,
modifier_source_value VARCHAR(50) NULL modifier_source_value VARCHAR(50) NULL
) )
; ;
@ -360,13 +360,13 @@ CREATE TABLE drug_exposure
quantity FLOAT NULL , quantity FLOAT NULL ,
days_supply INTEGER NULL , days_supply INTEGER NULL ,
sig CLOB NULL , sig CLOB NULL ,
route_concept_id INTEGER NULL , route_concept_id INTEGER NOT NULL ,
lot_number VARCHAR(50) NULL , lot_number VARCHAR(50) NULL ,
provider_id NUMBER(19) NULL , provider_id NUMBER(19) NULL ,
visit_occurrence_id NUMBER(19) NULL , visit_occurrence_id NUMBER(19) NULL ,
visit_detail_id NUMBER(19) NULL , visit_detail_id NUMBER(19) NULL ,
drug_source_value VARCHAR(50) NULL , drug_source_value VARCHAR(50) NULL ,
drug_source_concept_id INTEGER NULL , drug_source_concept_id INTEGER NOT 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
) )
@ -390,7 +390,7 @@ CREATE TABLE device_exposure
visit_occurrence_id NUMBER(19) NULL , visit_occurrence_id NUMBER(19) NULL ,
visit_detail_id NUMBER(19) NULL , visit_detail_id NUMBER(19) NULL ,
device_source_value VARCHAR(100) NULL , device_source_value VARCHAR(100) NULL ,
device_source_concept_id INTEGER NULL device_source_concept_id INTEGER NOT NULL
) )
; ;
@ -406,13 +406,13 @@ CREATE TABLE condition_occurrence
condition_end_date DATE NULL , condition_end_date DATE NULL ,
condition_end_datetime TIMESTAMP NULL , condition_end_datetime TIMESTAMP 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 NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
provider_id NUMBER(19) NULL , provider_id NUMBER(19) NULL ,
visit_occurrence_id NUMBER(19) NULL , visit_occurrence_id NUMBER(19) NULL ,
visit_detail_id NUMBER(19) NULL , visit_detail_id NUMBER(19) NULL ,
condition_source_value VARCHAR(50) NULL , condition_source_value VARCHAR(50) NULL ,
condition_source_concept_id INTEGER NULL , condition_source_concept_id INTEGER NOT NULL ,
condition_status_source_value VARCHAR(50) NULL condition_status_source_value VARCHAR(50) NULL
) )
; ;
@ -438,7 +438,7 @@ CREATE TABLE measurement
visit_occurrence_id NUMBER(19) NULL , visit_occurrence_id NUMBER(19) NULL ,
visit_detail_id NUMBER(19) NULL , visit_detail_id NUMBER(19) NULL ,
measurement_source_value VARCHAR(50) NULL , measurement_source_value VARCHAR(50) NULL ,
measurement_source_concept_id INTEGER NULL , measurement_source_concept_id INTEGER NOT 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
) )
@ -451,7 +451,7 @@ CREATE TABLE note
note_id NUMBER(19) NOT NULL , note_id NUMBER(19) NOT NULL ,
person_id NUMBER(19) NOT NULL , person_id NUMBER(19) NOT NULL ,
note_event_id NUMBER(19) NULL , note_event_id NUMBER(19) NULL ,
note_event_field_concept_id INTEGER NULL , note_event_field_concept_id INTEGER NOT NULL ,
note_date DATE NULL , note_date DATE NULL ,
note_datetime TIMESTAMP NOT NULL , note_datetime TIMESTAMP NOT NULL ,
note_type_concept_id INTEGER NOT NULL , note_type_concept_id INTEGER NOT NULL ,
@ -473,18 +473,18 @@ CREATE TABLE note_nlp
( (
note_nlp_id NUMBER(19) NOT NULL , note_nlp_id NUMBER(19) NOT NULL ,
note_id NUMBER(19) NOT NULL , note_id NUMBER(19) NOT NULL ,
section_concept_id INTEGER NULL , section_concept_id INTEGER NOT 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 NOT NULL ,
nlp_system VARCHAR(250) NULL , nlp_system VARCHAR(250) NULL ,
nlp_date DATE NOT NULL , nlp_date DATE NOT NULL ,
nlp_datetime TIMESTAMP NULL , nlp_datetime TIMESTAMP 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 NOT NULL
) )
; ;
@ -507,11 +507,11 @@ CREATE TABLE observation
visit_occurrence_id NUMBER(19) NULL , visit_occurrence_id NUMBER(19) NULL ,
visit_detail_id NUMBER(19) NULL , visit_detail_id NUMBER(19) NULL ,
observation_source_value VARCHAR(50) NULL , observation_source_value VARCHAR(50) NULL ,
observation_source_concept_id INTEGER NULL , observation_source_concept_id INTEGER NOT NULL ,
unit_source_value VARCHAR(50) NULL , unit_source_value VARCHAR(50) NULL ,
qualifier_source_value VARCHAR(50) NULL , qualifier_source_value VARCHAR(50) NULL ,
observation_event_id NUMBER(19) NULL , observation_event_id NUMBER(19) NULL ,
obs_event_field_concept_id INTEGER NULL , obs_event_field_concept_id INTEGER NOT NULL ,
value_as_datetime TIMESTAMP NULL value_as_datetime TIMESTAMP NULL
) )
; ;
@ -528,18 +528,18 @@ CREATE TABLE survey_conduct --Table added
survey_end_date DATE NULL , survey_end_date DATE NULL ,
survey_end_datetime TIMESTAMP NOT NULL , survey_end_datetime TIMESTAMP NOT NULL ,
provider_id NUMBER(19) NULL , provider_id NUMBER(19) NULL ,
assisted_concept_id INTEGER NULL , assisted_concept_id INTEGER NOT NULL ,
respondent_type_concept_id INTEGER NULL , respondent_type_concept_id INTEGER NOT NULL ,
timing_concept_id INTEGER NULL , timing_concept_id INTEGER NOT NULL ,
collection_method_concept_id INTEGER NULL , collection_method_concept_id INTEGER NOT NULL ,
assisted_source_value VARCHAR(50) NULL , assisted_source_value VARCHAR(50) NULL ,
respondent_type_source_value VARCHAR(100) NULL , respondent_type_source_value VARCHAR(100) NULL ,
timing_source_value VARCHAR(100) NULL , timing_source_value VARCHAR(100) NULL ,
collection_method_source_value VARCHAR(100) NULL , collection_method_source_value VARCHAR(100) NULL ,
survey_source_value VARCHAR(100) NULL , survey_source_value VARCHAR(100) NULL ,
survey_source_concept_id INTEGER NULL , survey_source_concept_id INTEGER NOT NULL ,
survey_source_identifier VARCHAR(100) NULL , survey_source_identifier VARCHAR(100) NULL ,
validated_survey_concept_id INTEGER NULL , validated_survey_concept_id INTEGER NOT NULL ,
validated_survey_source_value VARCHAR(100) NULL , validated_survey_source_value VARCHAR(100) NULL ,
survey_version_number VARCHAR(20) NULL , survey_version_number VARCHAR(20) NULL ,
visit_occurrence_id NUMBER(19) NULL , visit_occurrence_id NUMBER(19) NULL ,
@ -592,7 +592,7 @@ CREATE TABLE location_history --Table added
( (
location_history_id NUMBER(19) NOT NULL , location_history_id NUMBER(19) NOT NULL ,
location_id NUMBER(19) NOT NULL , location_id NUMBER(19) NOT NULL ,
relationship_type_concept_id INTEGER NULL , relationship_type_concept_id INTEGER NOT NULL ,
domain_id VARCHAR(50) NOT NULL , domain_id VARCHAR(50) NOT NULL ,
entity_id NUMBER(19) NOT NULL , entity_id NUMBER(19) NOT NULL ,
start_date DATE NOT NULL , start_date DATE NOT NULL ,
@ -606,7 +606,7 @@ CREATE TABLE care_site
( (
care_site_id NUMBER(19) NOT NULL , care_site_id NUMBER(19) NOT NULL ,
care_site_name VARCHAR(255) NULL , care_site_name VARCHAR(255) NULL ,
place_of_service_concept_id INTEGER NULL , place_of_service_concept_id INTEGER NOT NULL ,
location_id NUMBER(19) NULL , location_id NUMBER(19) NULL ,
care_site_source_value VARCHAR(50) NULL , care_site_source_value VARCHAR(50) NULL ,
place_of_service_source_value VARCHAR(50) NULL place_of_service_source_value VARCHAR(50) NULL
@ -621,15 +621,15 @@ CREATE TABLE provider
provider_name VARCHAR(255) NULL , provider_name VARCHAR(255) NULL ,
NPI VARCHAR(20) NULL , NPI VARCHAR(20) NULL ,
DEA VARCHAR(20) NULL , DEA VARCHAR(20) NULL ,
specialty_concept_id INTEGER NULL , specialty_concept_id INTEGER NOT NULL ,
care_site_id NUMBER(19) NULL , care_site_id NUMBER(19) NULL ,
year_of_birth INTEGER NULL , year_of_birth INTEGER NULL ,
gender_concept_id INTEGER NULL , gender_concept_id INTEGER NULL ,
provider_source_value VARCHAR(50) NULL , provider_source_value VARCHAR(50) NULL ,
specialty_source_value VARCHAR(50) NULL , specialty_source_value VARCHAR(50) NULL ,
specialty_source_concept_id INTEGER NULL , specialty_source_concept_id INTEGER NOT NULL ,
gender_source_value VARCHAR(50) NULL , gender_source_value VARCHAR(50) NULL ,
gender_source_concept_id INTEGER NULL gender_source_concept_id INTEGER NOT NULL
) )
; ;
@ -649,22 +649,22 @@ CREATE TABLE payer_plan_period
contract_person_id NUMBER(19) NULL , contract_person_id NUMBER(19) NULL ,
payer_plan_period_start_date DATE NOT NULL , payer_plan_period_start_date DATE NOT NULL ,
payer_plan_period_end_date DATE NOT NULL , payer_plan_period_end_date DATE NOT NULL ,
payer_concept_id INTEGER NULL , payer_concept_id INTEGER NOT NULL ,
plan_concept_id INTEGER NULL , plan_concept_id INTEGER NOT NULL ,
contract_concept_id INTEGER NULL , contract_concept_id INTEGER NOT NULL ,
sponsor_concept_id INTEGER NULL , sponsor_concept_id INTEGER NOT NULL ,
stop_reason_concept_id INTEGER NULL , stop_reason_concept_id INTEGER NOT NULL ,
payer_source_value VARCHAR(50) NULL , payer_source_value VARCHAR(50) NULL ,
payer_source_concept_id INTEGER NULL , payer_source_concept_id INTEGER NOT NULL ,
plan_source_value VARCHAR(50) NULL , plan_source_value VARCHAR(50) NULL ,
plan_source_concept_id INTEGER NULL , plan_source_concept_id INTEGER NOT NULL ,
contract_source_value VARCHAR(50) NULL , contract_source_value VARCHAR(50) NULL ,
contract_source_concept_id INTEGER NULL , contract_source_concept_id INTEGER NOT NULL ,
sponsor_source_value VARCHAR(50) NULL , sponsor_source_value VARCHAR(50) NULL ,
sponsor_source_concept_id INTEGER NULL , sponsor_source_concept_id INTEGER NOT NULL ,
family_source_value VARCHAR(50) NULL , family_source_value VARCHAR(50) NULL ,
stop_reason_source_value VARCHAR(50) NULL , stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL stop_reason_source_concept_id INTEGER NOT NULL
) )
; ;
@ -678,15 +678,15 @@ CREATE TABLE cost
cost_event_field_concept_id INTEGER NOT NULL , cost_event_field_concept_id INTEGER NOT NULL ,
cost_concept_id INTEGER NOT NULL , cost_concept_id INTEGER NOT NULL ,
cost_type_concept_id INTEGER NOT NULL , cost_type_concept_id INTEGER NOT NULL ,
currency_concept_id INTEGER NULL , currency_concept_id INTEGER NOT NULL ,
cost FLOAT NULL , cost FLOAT NULL ,
incurred_date DATE NOT NULL , incurred_date DATE NOT NULL ,
billed_date DATE NULL , billed_date DATE NULL ,
paid_date DATE NULL , paid_date DATE NULL ,
revenue_code_concept_id INTEGER NULL , revenue_code_concept_id INTEGER NOT NULL ,
drg_concept_id INTEGER NULL , drg_concept_id INTEGER NOT NULL ,
cost_source_value VARCHAR(50) NULL , cost_source_value VARCHAR(50) NULL ,
cost_source_concept_id INTEGER NULL , cost_source_concept_id INTEGER NOT NULL ,
revenue_code_source_value VARCHAR(50) NULL , revenue_code_source_value VARCHAR(50) NULL ,
drg_source_value VARCHAR(3) NULL , drg_source_value VARCHAR(3) NULL ,
payer_plan_period_id NUMBER(19) NULL payer_plan_period_id NUMBER(19) NULL

View File

@ -239,11 +239,11 @@ person (
care_site_id INTEGER NULL, care_site_id INTEGER 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 NOT NULL,
race_source_value VARCHAR(50) NULL, race_source_value VARCHAR(50) NULL,
race_source_concept_id INTEGER NULL, race_source_concept_id INTEGER NOT NULL,
ethnicity_source_value VARCHAR(50) NULL, ethnicity_source_value VARCHAR(50) NULL,
ethnicity_source_concept_id INTEGER NULL ethnicity_source_concept_id INTEGER NOT NULL
) )
WITH (DISTRIBUTION = HASH(person_id)); WITH (DISTRIBUTION = HASH(person_id));
@ -271,8 +271,8 @@ specimen (
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 NOT NULL ,
disease_status_concept_id INTEGER NULL , disease_status_concept_id INTEGER NOT 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 ,
@ -296,11 +296,11 @@ visit_occurrence (
provider_id INTEGER NULL, provider_id INTEGER NULL,
care_site_id INTEGER NULL, care_site_id INTEGER NULL,
visit_source_value VARCHAR(50) NULL, visit_source_value VARCHAR(50) NULL,
visit_source_concept_id INTEGER NULL , visit_source_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT ULL ,
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 NOT NULL ,
preceding_visit_occurrence_id INTEGER NULL preceding_visit_occurrence_id INTEGER NULL
) )
WITH (DISTRIBUTION = HASH(person_id)); WITH (DISTRIBUTION = HASH(person_id));
@ -319,11 +319,11 @@ visit_detail (
visit_detail_type_concept_id INTEGER NOT NULL , visit_detail_type_concept_id INTEGER NOT NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
care_site_id INTEGER NULL , care_site_id INTEGER NULL ,
discharge_to_concept_id INTEGER NULL , discharge_to_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
admitted_from_source_value VARCHAR(50) NULL , admitted_from_source_value VARCHAR(50) NULL ,
visit_detail_source_value VARCHAR(50) NULL , visit_detail_source_value VARCHAR(50) NULL ,
visit_detail_source_concept_id INTEGER NULL , visit_detail_source_concept_id INTEGER NOT NULL ,
discharge_to_source_value VARCHAR(50) NULL , discharge_to_source_value VARCHAR(50) NULL ,
preceding_visit_detail_id BIGINT NULL , preceding_visit_detail_id BIGINT NULL ,
visit_detail_parent_id BIGINT NULL , visit_detail_parent_id BIGINT NULL ,
@ -341,13 +341,13 @@ procedure_occurrence (
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 NOT NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
procedure_source_value VARCHAR(50) NULL , procedure_source_value VARCHAR(50) NULL ,
procedure_source_concept_id INTEGER NULL , procedure_source_concept_id INTEGER NOT NULL ,
modifier_source_value VARCHAR(50) NULL modifier_source_value VARCHAR(50) NULL
) )
WITH (DISTRIBUTION = HASH(person_id)); WITH (DISTRIBUTION = HASH(person_id));
@ -370,13 +370,13 @@ drug_exposure (
quantity FLOAT NULL , quantity FLOAT NULL ,
days_supply INTEGER NULL , days_supply INTEGER NULL ,
sig VARCHAR(1000) NULL , sig VARCHAR(1000) NULL ,
route_concept_id INTEGER NULL , route_concept_id INTEGER NOT NULL ,
lot_number VARCHAR(50) NULL , lot_number VARCHAR(50) NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
drug_source_value VARCHAR(50) NULL , drug_source_value VARCHAR(50) NULL ,
drug_source_concept_id INTEGER NULL , drug_source_concept_id INTEGER NOT 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
) )
@ -400,7 +400,7 @@ device_exposure (
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
device_source_value VARCHAR(100) NULL , device_source_value VARCHAR(100) NULL ,
device_source_concept_id INTEGER NULL device_source_concept_id INTEGER NOT NULL
) )
WITH (DISTRIBUTION = HASH(person_id)); WITH (DISTRIBUTION = HASH(person_id));
@ -416,13 +416,13 @@ condition_occurrence (
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 NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
condition_source_value VARCHAR(50) NULL , condition_source_value VARCHAR(50) NULL ,
condition_source_concept_id INTEGER NULL , condition_source_concept_id INTEGER NOT NULL ,
condition_status_source_value VARCHAR(50) NULL condition_status_source_value VARCHAR(50) NULL
) )
WITH (DISTRIBUTION = HASH(person_id)); WITH (DISTRIBUTION = HASH(person_id));
@ -448,7 +448,7 @@ measurement (
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
measurement_source_value VARCHAR(50) NULL , measurement_source_value VARCHAR(50) NULL ,
measurement_source_concept_id INTEGER NULL , measurement_source_concept_id INTEGER NOT 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
) )
@ -461,7 +461,7 @@ 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 , note_event_id BIGINT NULL ,
note_event_field_concept_id INTEGER NULL , note_event_field_concept_id INTEGER NOT 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 ,
@ -483,18 +483,18 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE
note_nlp ( 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 NOT 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 NOT 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 NOT NULL
) )
WITH (DISTRIBUTION = REPLICATE); WITH (DISTRIBUTION = REPLICATE);
@ -517,11 +517,11 @@ observation (
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT NULL , visit_detail_id BIGINT NULL ,
observation_source_value VARCHAR(50) NULL , observation_source_value VARCHAR(50) NULL ,
observation_source_concept_id INTEGER NULL , observation_source_concept_id INTEGER NOT NULL ,
unit_source_value VARCHAR(50) NULL , unit_source_value VARCHAR(50) NULL ,
qualifier_source_value VARCHAR(50) NULL , qualifier_source_value VARCHAR(50) NULL ,
observation_event_id BIGINT NULL , observation_event_id BIGINT NULL ,
obs_event_field_concept_id INTEGER NULL , obs_event_field_concept_id INTEGER NOT NULL ,
value_as_datetime DATETIME2 NULL value_as_datetime DATETIME2 NULL
) )
WITH (DISTRIBUTION = HASH(person_id)); WITH (DISTRIBUTION = HASH(person_id));
@ -538,18 +538,18 @@ survey_conduct (
survey_end_date DATE NULL , survey_end_date DATE NULL ,
survey_end_datetime DATETIME2 NOT NULL , survey_end_datetime DATETIME2 NOT NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
assisted_concept_id INTEGER NULL , assisted_concept_id INTEGER NOT NULL ,
respondent_type_concept_id INTEGER NULL , respondent_type_concept_id INTEGER NOT NULL ,
timing_concept_id INTEGER NULL , timing_concept_id INTEGER NOT NULL ,
collection_method_concept_id INTEGER NULL , collection_method_concept_id INTEGER NOT NULL ,
assisted_source_value VARCHAR(50) NULL , assisted_source_value VARCHAR(50) NULL ,
respondent_type_source_value VARCHAR(100) NULL , respondent_type_source_value VARCHAR(100) NULL ,
timing_source_value VARCHAR(100) NULL , timing_source_value VARCHAR(100) NULL ,
collection_method_source_value VARCHAR(100) NULL , collection_method_source_value VARCHAR(100) NULL ,
survey_source_value VARCHAR(100) NULL , survey_source_value VARCHAR(100) NULL ,
survey_source_concept_id INTEGER NULL , survey_source_concept_id INTEGER NOT NULL ,
survey_source_identifier VARCHAR(100) NULL , survey_source_identifier VARCHAR(100) NULL ,
validated_survey_concept_id INTEGER NULL , validated_survey_concept_id INTEGER NOT NULL ,
validated_survey_source_value VARCHAR(100) NULL , validated_survey_source_value VARCHAR(100) NULL ,
survey_version_number VARCHAR(20) NULL , survey_version_number VARCHAR(20) NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
@ -602,7 +602,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE
location_history ( location_history (
location_history_id BIGINT NOT NULL , location_history_id BIGINT NOT NULL ,
location_id BIGINT NOT NULL , location_id BIGINT NOT NULL ,
relationship_type_concept_id INTEGER NULL , relationship_type_concept_id INTEGER NOT NULL ,
domain_id VARCHAR(50) NOT NULL , domain_id VARCHAR(50) NOT NULL ,
entity_id BIGINT NOT NULL , entity_id BIGINT NOT NULL ,
start_date DATE NOT NULL , start_date DATE NOT NULL ,
@ -616,7 +616,7 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE
care_site ( care_site (
care_site_id BIGINT NOT NULL , care_site_id BIGINT NOT NULL ,
care_site_name VARCHAR(255) NULL , care_site_name VARCHAR(255) NULL ,
place_of_service_concept_id INTEGER NULL , place_of_service_concept_id INTEGER NOT NULL ,
location_id BIGINT NULL , location_id BIGINT NULL ,
care_site_source_value VARCHAR(50) NULL , care_site_source_value VARCHAR(50) NULL ,
place_of_service_source_value VARCHAR(50) NULL place_of_service_source_value VARCHAR(50) NULL
@ -631,15 +631,15 @@ provider (
provider_name VARCHAR(255) NULL , provider_name VARCHAR(255) NULL ,
NPI VARCHAR(20) NULL , NPI VARCHAR(20) NULL ,
DEA VARCHAR(20) NULL , DEA VARCHAR(20) NULL ,
specialty_concept_id INTEGER NULL , specialty_concept_id INTEGER NOT NULL ,
care_site_id BIGINT NULL , care_site_id BIGINT NULL ,
year_of_birth INTEGER NULL , year_of_birth INTEGER NULL ,
gender_concept_id INTEGER NULL , gender_concept_id INTEGER NOT NULL ,
provider_source_value VARCHAR(50) NULL , provider_source_value VARCHAR(50) NULL ,
specialty_source_value VARCHAR(50) NULL , specialty_source_value VARCHAR(50) NULL ,
specialty_source_concept_id INTEGER NULL , specialty_source_concept_id INTEGER NOT NULL ,
gender_source_value VARCHAR(50) NULL , gender_source_value VARCHAR(50) NULL ,
gender_source_concept_id INTEGER NULL gender_source_concept_id INTEGER NOT NULL
) )
WITH (DISTRIBUTION = REPLICATE); WITH (DISTRIBUTION = REPLICATE);
@ -659,22 +659,22 @@ payer_plan_period (
contract_person_id BIGINT NULL , contract_person_id BIGINT NULL ,
payer_plan_period_start_date DATE NOT NULL , payer_plan_period_start_date DATE NOT NULL ,
payer_plan_period_end_date DATE NOT NULL , payer_plan_period_end_date DATE NOT NULL ,
payer_concept_id INTEGER NULL , payer_concept_id INTEGER NOT NULL ,
plan_concept_id INTEGER NULL , plan_concept_id INTEGER NOT NULL ,
contract_concept_id INTEGER NULL , contract_concept_id INTEGER NOT NULL ,
sponsor_concept_id INTEGER NULL , sponsor_concept_id INTEGER NOT NULL ,
stop_reason_concept_id INTEGER NULL , stop_reason_concept_id INTEGER NOT NULL ,
payer_source_value VARCHAR(50) NULL , payer_source_value VARCHAR(50) NULL ,
payer_source_concept_id INTEGER NULL , payer_source_concept_id INTEGER NOT NULL ,
plan_source_value VARCHAR(50) NULL , plan_source_value VARCHAR(50) NULL ,
plan_source_concept_id INTEGER NULL , plan_source_concept_id INTEGER NOT NULL ,
contract_source_value VARCHAR(50) NULL , contract_source_value VARCHAR(50) NULL ,
contract_source_concept_id INTEGER NULL , contract_source_concept_id INTEGER NOT NULL ,
sponsor_source_value VARCHAR(50) NULL , sponsor_source_value VARCHAR(50) NULL ,
sponsor_source_concept_id INTEGER NULL , sponsor_source_concept_id INTEGER NOT NULL ,
family_source_value VARCHAR(50) NULL , family_source_value VARCHAR(50) NULL ,
stop_reason_source_value VARCHAR(50) NULL , stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL stop_reason_source_concept_id INTEGER NOT NULL
) )
WITH (DISTRIBUTION = HASH(person_id)); WITH (DISTRIBUTION = HASH(person_id));
@ -688,15 +688,15 @@ cost (
cost_event_field_concept_id INTEGER NOT NULL , cost_event_field_concept_id INTEGER NOT NULL ,
cost_concept_id INTEGER NOT NULL , cost_concept_id INTEGER NOT NULL ,
cost_type_concept_id INTEGER NOT NULL , cost_type_concept_id INTEGER NOT NULL ,
currency_concept_id INTEGER NULL , currency_concept_id INTEGER NOT NULL ,
cost FLOAT NULL , cost FLOAT NULL ,
incurred_date DATE NOT NULL , incurred_date DATE NOT NULL ,
billed_date DATE NULL , billed_date DATE NULL ,
paid_date DATE NULL , paid_date DATE NULL ,
revenue_code_concept_id INTEGER NULL , revenue_code_concept_id INTEGER NOT NULL ,
drg_concept_id INTEGER NULL , drg_concept_id INTEGER NOT NULL ,
cost_source_value VARCHAR(50) NULL , cost_source_value VARCHAR(50) NULL ,
cost_source_concept_id INTEGER NULL , cost_source_concept_id INTEGER NOT NULL ,
revenue_code_source_value VARCHAR(50) NULL , revenue_code_source_value VARCHAR(50) NULL ,
drg_source_value VARCHAR(3) NULL , drg_source_value VARCHAR(3) NULL ,
payer_plan_period_id BIGINT NULL payer_plan_period_id BIGINT NULL

View File

@ -240,11 +240,11 @@ CREATE TABLE person
care_site_id INTEGER NULL, care_site_id INTEGER 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 NOT NULL,
race_source_value VARCHAR(50) NULL, race_source_value VARCHAR(50) NULL,
race_source_concept_id INTEGER NULL, race_source_concept_id INTEGER NOT NULL,
ethnicity_source_value VARCHAR(50) NULL, ethnicity_source_value VARCHAR(50) NULL,
ethnicity_source_concept_id INTEGER NULL ethnicity_source_concept_id INTEGER NOT NULL
) )
; ;
@ -272,8 +272,8 @@ CREATE TABLE specimen
specimen_datetime TIMESTAMP NOT NULL , specimen_datetime TIMESTAMP NOT NULL ,
quantity NUMERIC NULL , quantity NUMERIC NULL ,
unit_concept_id INTEGER NULL , unit_concept_id INTEGER NULL ,
anatomic_site_concept_id INTEGER NULL , anatomic_site_concept_id INTEGER NOT NULL ,
disease_status_concept_id INTEGER NULL , disease_status_concept_id INTEGER NOT 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 ,
@ -283,20 +283,6 @@ CREATE TABLE specimen
; ;
--HINT DISTRIBUTE_ON_KEY(person_id)
CREATE TABLE death
(
person_id BIGINT NOT NULL ,
death_date DATE NULL ,
death_datetime TIMESTAMP NOT NULL ,
death_type_concept_id INTEGER NOT NULL ,
cause_concept_id INTEGER NULL ,
cause_source_value VARCHAR(50) 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
( (
@ -311,11 +297,11 @@ CREATE TABLE visit_occurrence
provider_id INTEGER NULL, provider_id INTEGER NULL,
care_site_id INTEGER NULL, care_site_id INTEGER NULL,
visit_source_value VARCHAR(50) NULL, visit_source_value VARCHAR(50) NULL,
visit_source_concept_id INTEGER NULL , visit_source_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
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 NOT NULL ,
preceding_visit_occurrence_id INTEGER NULL preceding_visit_occurrence_id INTEGER NULL
) )
; ;
@ -334,11 +320,11 @@ CREATE TABLE visit_detail
visit_detail_type_concept_id INTEGER NOT NULL , visit_detail_type_concept_id INTEGER NOT NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
care_site_id INTEGER NULL , care_site_id INTEGER NULL ,
discharge_to_concept_id INTEGER NULL , discharge_to_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
admitted_from_source_value VARCHAR(50) NULL , admitted_from_source_value VARCHAR(50) NULL ,
visit_detail_source_value VARCHAR(50) NULL , visit_detail_source_value VARCHAR(50) NULL ,
visit_detail_source_concept_id INTEGER NULL , visit_detail_source_concept_id INTEGER NOT NULL ,
discharge_to_source_value VARCHAR(50) NULL , discharge_to_source_value VARCHAR(50) NULL ,
preceding_visit_detail_id BIGINT NULL , preceding_visit_detail_id BIGINT NULL ,
visit_detail_parent_id BIGINT NULL , visit_detail_parent_id BIGINT NULL ,
@ -356,13 +342,13 @@ CREATE TABLE procedure_occurrence
procedure_date DATE NULL , procedure_date DATE NULL ,
procedure_datetime TIMESTAMP NOT NULL , procedure_datetime TIMESTAMP 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 NOT NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
procedure_source_value VARCHAR(50) NULL , procedure_source_value VARCHAR(50) NULL ,
procedure_source_concept_id INTEGER NULL , procedure_source_concept_id INTEGER NOT NULL ,
modifier_source_value VARCHAR(50) NULL modifier_source_value VARCHAR(50) NULL
) )
; ;
@ -385,13 +371,13 @@ CREATE TABLE drug_exposure
quantity NUMERIC NULL , quantity NUMERIC NULL ,
days_supply INTEGER NULL , days_supply INTEGER NULL ,
sig TEXT NULL , sig TEXT NULL ,
route_concept_id INTEGER NULL , route_concept_id INTEGER NOT NULL ,
lot_number VARCHAR(50) NULL , lot_number VARCHAR(50) NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
drug_source_value VARCHAR(50) NULL , drug_source_value VARCHAR(50) NULL ,
drug_source_concept_id INTEGER NULL , drug_source_concept_id INTEGER NOT 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
) )
@ -415,7 +401,7 @@ CREATE TABLE device_exposure
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
device_source_value VARCHAR(100) NULL , device_source_value VARCHAR(100) NULL ,
device_source_concept_id INTEGER NULL device_source_concept_id INTEGER NOT NULL
) )
; ;
@ -431,13 +417,13 @@ CREATE TABLE condition_occurrence
condition_end_date DATE NULL , condition_end_date DATE NULL ,
condition_end_datetime TIMESTAMP NULL , condition_end_datetime TIMESTAMP 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 NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
condition_source_value VARCHAR(50) NULL , condition_source_value VARCHAR(50) NULL ,
condition_source_concept_id INTEGER NULL , condition_source_concept_id INTEGER NOT NULL ,
condition_status_source_value VARCHAR(50) NULL condition_status_source_value VARCHAR(50) NULL
) )
; ;
@ -463,7 +449,7 @@ CREATE TABLE measurement
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
measurement_source_value VARCHAR(50) NULL , measurement_source_value VARCHAR(50) NULL ,
measurement_source_concept_id INTEGER NULL , measurement_source_concept_id INTEGER NOT 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
) )
@ -476,7 +462,7 @@ 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 , note_event_id BIGINT NULL ,
note_event_field_concept_id INTEGER NULL , note_event_field_concept_id INTEGER NOT NULL ,
note_date DATE NULL , note_date DATE NULL ,
note_datetime TIMESTAMP NOT NULL , note_datetime TIMESTAMP NOT NULL ,
note_type_concept_id INTEGER NOT NULL , note_type_concept_id INTEGER NOT NULL ,
@ -498,18 +484,18 @@ 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 NOT 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 NOT NULL ,
nlp_system VARCHAR(250) NULL , nlp_system VARCHAR(250) NULL ,
nlp_date DATE NOT NULL , nlp_date DATE NOT NULL ,
nlp_datetime TIMESTAMP NULL , nlp_datetime TIMESTAMP 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 NOT NULL
) )
; ;
@ -532,11 +518,11 @@ CREATE TABLE observation
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT NULL , visit_detail_id BIGINT NULL ,
observation_source_value VARCHAR(50) NULL , observation_source_value VARCHAR(50) NULL ,
observation_source_concept_id INTEGER NULL , observation_source_concept_id INTEGER NOT NULL ,
unit_source_value VARCHAR(50) NULL , unit_source_value VARCHAR(50) NULL ,
qualifier_source_value VARCHAR(50) NULL , qualifier_source_value VARCHAR(50) NULL ,
observation_event_id BIGINT NULL , observation_event_id BIGINT NULL ,
obs_event_field_concept_id INTEGER NULL , obs_event_field_concept_id INTEGER NOT NULL ,
value_as_datetime TIMESTAMP NULL value_as_datetime TIMESTAMP NULL
) )
; ;
@ -553,18 +539,18 @@ CREATE TABLE survey_conduct
survey_end_date DATE NULL , survey_end_date DATE NULL ,
survey_end_datetime TIMESTAMP NOT NULL , survey_end_datetime TIMESTAMP NOT NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
assisted_concept_id INTEGER NULL , assisted_concept_id INTEGER NOT NULL ,
respondent_type_concept_id INTEGER NULL , respondent_type_concept_id INTEGER NOT NULL ,
timing_concept_id INTEGER NULL , timing_concept_id INTEGER NOT NULL ,
collection_method_concept_id INTEGER NULL , collection_method_concept_id INTEGER NOT NULL ,
assisted_source_value VARCHAR(50) NULL , assisted_source_value VARCHAR(50) NULL ,
respondent_type_source_value VARCHAR(100) NULL , respondent_type_source_value VARCHAR(100) NULL ,
timing_source_value VARCHAR(100) NULL , timing_source_value VARCHAR(100) NULL ,
collection_method_source_value VARCHAR(100) NULL , collection_method_source_value VARCHAR(100) NULL ,
survey_source_value VARCHAR(100) NULL , survey_source_value VARCHAR(100) NULL ,
survey_source_concept_id INTEGER NULL , survey_source_concept_id INTEGER NOT NULL ,
survey_source_identifier VARCHAR(100) NULL , survey_source_identifier VARCHAR(100) NULL ,
validated_survey_concept_id INTEGER NULL , validated_survey_concept_id INTEGER NOT NULL ,
validated_survey_source_value VARCHAR(100) NULL , validated_survey_source_value VARCHAR(100) NULL ,
survey_version_number VARCHAR(20) NULL , survey_version_number VARCHAR(20) NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
@ -617,7 +603,7 @@ CREATE TABLE location_history --Table added
( (
location_history_id BIGINT NOT NULL , location_history_id BIGINT NOT NULL ,
location_id BIGINT NOT NULL , location_id BIGINT NOT NULL ,
relationship_type_concept_id INTEGER NULL , relationship_type_concept_id INTEGER NOT NULL ,
domain_id VARCHAR(50) NOT NULL , domain_id VARCHAR(50) NOT NULL ,
entity_id BIGINT NOT NULL , entity_id BIGINT NOT NULL ,
start_date DATE NOT NULL , start_date DATE NOT NULL ,
@ -631,7 +617,7 @@ CREATE TABLE care_site
( (
care_site_id BIGINT NOT NULL , care_site_id BIGINT NOT NULL ,
care_site_name VARCHAR(255) NULL , care_site_name VARCHAR(255) NULL ,
place_of_service_concept_id INTEGER NULL , place_of_service_concept_id INTEGER NOT NULL ,
location_id BIGINT NULL , location_id BIGINT NULL ,
care_site_source_value VARCHAR(50) NULL , care_site_source_value VARCHAR(50) NULL ,
place_of_service_source_value VARCHAR(50) NULL place_of_service_source_value VARCHAR(50) NULL
@ -646,15 +632,15 @@ CREATE TABLE provider
provider_name VARCHAR(255) NULL , provider_name VARCHAR(255) NULL ,
NPI VARCHAR(20) NULL , NPI VARCHAR(20) NULL ,
DEA VARCHAR(20) NULL , DEA VARCHAR(20) NULL ,
specialty_concept_id INTEGER NULL , specialty_concept_id INTEGER NOT NULL ,
care_site_id BIGINT NULL , care_site_id BIGINT NULL ,
year_of_birth INTEGER NULL , year_of_birth INTEGER NULL ,
gender_concept_id INTEGER NULL , gender_concept_id INTEGER NOT NULL ,
provider_source_value VARCHAR(50) NULL , provider_source_value VARCHAR(50) NULL ,
specialty_source_value VARCHAR(50) NULL , specialty_source_value VARCHAR(50) NULL ,
specialty_source_concept_id INTEGER NULL , specialty_source_concept_id INTEGER NULL ,
gender_source_value VARCHAR(50) NULL , gender_source_value VARCHAR(50) NULL ,
gender_source_concept_id INTEGER NULL gender_source_concept_id INTEGER NOT NULL
) )
; ;
@ -674,22 +660,22 @@ CREATE TABLE payer_plan_period
contract_person_id BIGINT NULL , contract_person_id BIGINT NULL ,
payer_plan_period_start_date DATE NOT NULL , payer_plan_period_start_date DATE NOT NULL ,
payer_plan_period_end_date DATE NOT NULL , payer_plan_period_end_date DATE NOT NULL ,
payer_concept_id INTEGER NULL , payer_concept_id INTEGER NOT NULL ,
plan_concept_id INTEGER NULL , plan_concept_id INTEGER NOT NULL ,
contract_concept_id INTEGER NULL , contract_concept_id INTEGER NOT NULL ,
sponsor_concept_id INTEGER NULL , sponsor_concept_id INTEGER NOT NULL ,
stop_reason_concept_id INTEGER NULL , stop_reason_concept_id INTEGER NOT NULL ,
payer_source_value VARCHAR(50) NULL , payer_source_value VARCHAR(50) NULL ,
payer_source_concept_id INTEGER NULL , payer_source_concept_id INTEGER NOT NULL ,
plan_source_value VARCHAR(50) NULL , plan_source_value VARCHAR(50) NULL ,
plan_source_concept_id INTEGER NULL , plan_source_concept_id INTEGER NOT NULL ,
contract_source_value VARCHAR(50) NULL , contract_source_value VARCHAR(50) NULL ,
contract_source_concept_id INTEGER NULL , contract_source_concept_id INTEGER NOT NULL ,
sponsor_source_value VARCHAR(50) NULL , sponsor_source_value VARCHAR(50) NULL ,
sponsor_source_concept_id INTEGER NULL , sponsor_source_concept_id INTEGER NOT NULL ,
family_source_value VARCHAR(50) NULL , family_source_value VARCHAR(50) NULL ,
stop_reason_source_value VARCHAR(50) NULL , stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL stop_reason_source_concept_id INTEGER NOT NULL
) )
; ;
@ -703,15 +689,15 @@ CREATE TABLE cost
cost_event_field_concept_id INTEGER NOT NULL , cost_event_field_concept_id INTEGER NOT NULL ,
cost_concept_id INTEGER NOT NULL , cost_concept_id INTEGER NOT NULL ,
cost_type_concept_id INTEGER NOT NULL , cost_type_concept_id INTEGER NOT NULL ,
currency_concept_id INTEGER NULL , currency_concept_id INTEGER NOT NULL ,
cost NUMERIC NULL , cost NUMERIC NULL ,
incurred_date DATE NOT NULL , incurred_date DATE NOT NULL ,
billed_date DATE NULL , billed_date DATE NULL ,
paid_date DATE NULL , paid_date DATE NULL ,
revenue_code_concept_id INTEGER NULL , revenue_code_concept_id INTEGER NOT NULL ,
drg_concept_id INTEGER NULL , drg_concept_id INTEGER NOT NULL ,
cost_source_value VARCHAR(50) NULL , cost_source_value VARCHAR(50) NULL ,
cost_source_concept_id INTEGER NULL , cost_source_concept_id INTEGER NOT NULL ,
revenue_code_source_value VARCHAR(50) NULL , revenue_code_source_value VARCHAR(50) NULL ,
drg_source_value VARCHAR(3) NULL , drg_source_value VARCHAR(3) NULL ,
payer_plan_period_id BIGINT NULL payer_plan_period_id BIGINT NULL

View File

@ -226,11 +226,11 @@ CREATE TABLE person (
care_site_id INTEGER NULL, care_site_id INTEGER 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 NOT NULL,
race_source_value VARCHAR(50) NULL, race_source_value VARCHAR(50) NULL,
race_source_concept_id INTEGER NULL, race_source_concept_id INTEGER NOT NULL,
ethnicity_source_value VARCHAR(50) NULL, ethnicity_source_value VARCHAR(50) NULL,
ethnicity_source_concept_id INTEGER NULL ethnicity_source_concept_id INTEGER NOT NULL
) )
DISTKEY(person_id); DISTKEY(person_id);
@ -256,8 +256,8 @@ CREATE TABLE specimen (
specimen_datetime TIMESTAMP NOT NULL , specimen_datetime TIMESTAMP 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 NOT NULL ,
disease_status_concept_id INTEGER NULL , disease_status_concept_id INTEGER NOT 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 ,
@ -280,11 +280,11 @@ CREATE TABLE visit_occurrence (
provider_id INTEGER NULL, provider_id INTEGER NULL,
care_site_id INTEGER NULL, care_site_id INTEGER NULL,
visit_source_value VARCHAR(50) NULL, visit_source_value VARCHAR(50) NULL,
visit_source_concept_id INTEGER NULL , visit_source_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
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 NOT NULL ,
preceding_visit_occurrence_id INTEGER NULL preceding_visit_occurrence_id INTEGER NULL
) )
DISTKEY(person_id); DISTKEY(person_id);
@ -302,11 +302,11 @@ CREATE TABLE visit_detail (
visit_detail_type_concept_id INTEGER NOT NULL , visit_detail_type_concept_id INTEGER NOT NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
care_site_id INTEGER NULL , care_site_id INTEGER NULL ,
discharge_to_concept_id INTEGER NULL , discharge_to_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
admitted_from_source_value VARCHAR(50) NULL , admitted_from_source_value VARCHAR(50) NULL ,
visit_detail_source_value VARCHAR(50) NULL , visit_detail_source_value VARCHAR(50) NULL ,
visit_detail_source_concept_id INTEGER NULL , visit_detail_source_concept_id INTEGER NOT NULL ,
discharge_to_source_value VARCHAR(50) NULL , discharge_to_source_value VARCHAR(50) NULL ,
preceding_visit_detail_id BIGINT NULL , preceding_visit_detail_id BIGINT NULL ,
visit_detail_parent_id BIGINT NULL , visit_detail_parent_id BIGINT NULL ,
@ -323,13 +323,13 @@ CREATE TABLE procedure_occurrence (
procedure_date DATE NULL , procedure_date DATE NULL ,
procedure_datetime TIMESTAMP NOT NULL , procedure_datetime TIMESTAMP 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 NOT NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
procedure_source_value VARCHAR(50) NULL , procedure_source_value VARCHAR(50) NULL ,
procedure_source_concept_id INTEGER NULL , procedure_source_concept_id INTEGER NOT NULL ,
modifier_source_value VARCHAR(50) NULL modifier_source_value VARCHAR(50) NULL
) )
DISTKEY(person_id); DISTKEY(person_id);
@ -351,13 +351,13 @@ CREATE TABLE drug_exposure (
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 NOT NULL ,
lot_number VARCHAR(50) NULL , lot_number VARCHAR(50) NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
drug_source_value VARCHAR(50) NULL , drug_source_value VARCHAR(50) NULL ,
drug_source_concept_id INTEGER NULL , drug_source_concept_id INTEGER NOT 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
) )
@ -380,7 +380,7 @@ CREATE TABLE device_exposure (
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
device_source_value VARCHAR(100) NULL , device_source_value VARCHAR(100) NULL ,
device_source_concept_id INTEGER NULL device_source_concept_id INTEGER NOT NULL
) )
DISTKEY(person_id); DISTKEY(person_id);
@ -395,13 +395,13 @@ CREATE TABLE condition_occurrence (
condition_end_date DATE NULL , condition_end_date DATE NULL ,
condition_end_datetime TIMESTAMP NULL , condition_end_datetime TIMESTAMP 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 NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
condition_source_value VARCHAR(50) NULL , condition_source_value VARCHAR(50) NULL ,
condition_source_concept_id INTEGER NULL , condition_source_concept_id INTEGER NOT NULL ,
condition_status_source_value VARCHAR(50) NULL condition_status_source_value VARCHAR(50) NULL
) )
DISTKEY(person_id); DISTKEY(person_id);
@ -426,7 +426,7 @@ CREATE TABLE measurement (
visit_occurrence_id INTEGER NULL , visit_occurrence_id INTEGER NULL ,
visit_detail_id INTEGER NULL , visit_detail_id INTEGER NULL ,
measurement_source_value VARCHAR(50) NULL , measurement_source_value VARCHAR(50) NULL ,
measurement_source_concept_id INTEGER NULL , measurement_source_concept_id INTEGER NOT 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
) )
@ -438,7 +438,7 @@ 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 , note_event_id BIGINT NULL ,
note_event_field_concept_id INTEGER NULL , note_event_field_concept_id INTEGER NOT NULL ,
note_date DATE NULL , note_date DATE NULL ,
note_datetime TIMESTAMP NOT NULL , note_datetime TIMESTAMP NOT NULL ,
note_type_concept_id INTEGER NOT NULL , note_type_concept_id INTEGER NOT NULL ,
@ -459,18 +459,18 @@ DISTKEY(person_id);
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 NOT 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 NOT NULL ,
nlp_system VARCHAR(250) NULL , nlp_system VARCHAR(250) NULL ,
nlp_date DATE NOT NULL , nlp_date DATE NOT NULL ,
nlp_datetime TIMESTAMP NULL , nlp_datetime TIMESTAMP 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 NOT NULL
) )
DISTSTYLE ALL; DISTSTYLE ALL;
@ -492,11 +492,11 @@ CREATE TABLE observation
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT NULL , visit_detail_id BIGINT NULL ,
observation_source_value VARCHAR(50) NULL , observation_source_value VARCHAR(50) NULL ,
observation_source_concept_id INTEGER NULL , observation_source_concept_id INTEGER NOT NULL ,
unit_source_value VARCHAR(50) NULL , unit_source_value VARCHAR(50) NULL ,
qualifier_source_value VARCHAR(50) NULL , qualifier_source_value VARCHAR(50) NULL ,
observation_event_id BIGINT NULL , observation_event_id BIGINT NULL ,
obs_event_field_concept_id INTEGER NULL , obs_event_field_concept_id INTEGER NOT NULL ,
value_as_datetime TIMESTAMP NULL value_as_datetime TIMESTAMP NULL
) )
DISTKEY(person_id); DISTKEY(person_id);
@ -512,18 +512,18 @@ CREATE TABLE survey_conduct (
survey_end_date DATE NULL , survey_end_date DATE NULL ,
survey_end_datetime TIMESTAMP NOT NULL , survey_end_datetime TIMESTAMP NOT NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
assisted_concept_id INTEGER NULL , assisted_concept_id INTEGER NOT NULL ,
respondent_type_concept_id INTEGER NULL , respondent_type_concept_id INTEGER NOT NULL ,
timing_concept_id INTEGER NULL , timing_concept_id INTEGER NOT NULL ,
collection_method_concept_id INTEGER NULL , collection_method_concept_id INTEGER NOT NULL ,
assisted_source_value VARCHAR(50) NULL , assisted_source_value VARCHAR(50) NULL ,
respondent_type_source_value VARCHAR(100) NULL , respondent_type_source_value VARCHAR(100) NULL ,
timing_source_value VARCHAR(100) NULL , timing_source_value VARCHAR(100) NULL ,
collection_method_source_value VARCHAR(100) NULL , collection_method_source_value VARCHAR(100) NULL ,
survey_source_value VARCHAR(100) NULL , survey_source_value VARCHAR(100) NULL ,
survey_source_concept_id INTEGER NULL , survey_source_concept_id INTEGER NOT NULL ,
survey_source_identifier VARCHAR(100) NULL , survey_source_identifier VARCHAR(100) NULL ,
validated_survey_concept_id INTEGER NULL , validated_survey_concept_id INTEGER NOT NULL ,
validated_survey_source_value VARCHAR(100) NULL , validated_survey_source_value VARCHAR(100) NULL ,
survey_version_number VARCHAR(20) NULL , survey_version_number VARCHAR(20) NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
@ -573,7 +573,7 @@ DISTSTYLE ALL;
CREATE TABLE location_history ( CREATE TABLE location_history (
location_history_id BIGINT NOT NULL , location_history_id BIGINT NOT NULL ,
location_id BIGINT NOT NULL , location_id BIGINT NOT NULL ,
relationship_type_concept_id INTEGER NULL , relationship_type_concept_id INTEGER NOT NULL ,
domain_id VARCHAR(50) NOT NULL , domain_id VARCHAR(50) NOT NULL ,
entity_id BIGINT NOT NULL , entity_id BIGINT NOT NULL ,
start_date DATE NOT NULL , start_date DATE NOT NULL ,
@ -586,7 +586,7 @@ DISTSTYLE ALL;
CREATE TABLE care_site ( CREATE TABLE care_site (
care_site_id BIGINT NOT NULL , care_site_id BIGINT NOT NULL ,
care_site_name VARCHAR(255) NULL , care_site_name VARCHAR(255) NULL ,
place_of_service_concept_id INTEGER NULL , place_of_service_concept_id INTEGER NOT NULL ,
location_id BIGINT NULL , location_id BIGINT NULL ,
care_site_source_value VARCHAR(50) NULL , care_site_source_value VARCHAR(50) NULL ,
place_of_service_source_value VARCHAR(50) NULL place_of_service_source_value VARCHAR(50) NULL
@ -600,15 +600,15 @@ CREATE TABLE provider (
provider_name VARCHAR(255) NULL , provider_name VARCHAR(255) NULL ,
NPI VARCHAR(20) NULL , NPI VARCHAR(20) NULL ,
DEA VARCHAR(20) NULL , DEA VARCHAR(20) NULL ,
specialty_concept_id INTEGER NULL , specialty_concept_id INTEGER NOT NULL ,
care_site_id BIGINT NULL , care_site_id BIGINT NULL ,
year_of_birth INTEGER NULL , year_of_birth INTEGER NULL ,
gender_concept_id INTEGER NULL , gender_concept_id INTEGER NOT NULL ,
provider_source_value VARCHAR(50) NULL , provider_source_value VARCHAR(50) NULL ,
specialty_source_value VARCHAR(50) NULL , specialty_source_value VARCHAR(50) NULL ,
specialty_source_concept_id INTEGER NULL , specialty_source_concept_id INTEGER NULL ,
gender_source_value VARCHAR(50) NULL , gender_source_value VARCHAR(50) NULL ,
gender_source_concept_id INTEGER NULL gender_source_concept_id INTEGER NOT NULL
) )
DISTSTYLE ALL; DISTSTYLE ALL;
@ -627,22 +627,22 @@ CREATE TABLE payer_plan_period
contract_person_id BIGINT NULL , contract_person_id BIGINT NULL ,
payer_plan_period_start_date DATE NOT NULL , payer_plan_period_start_date DATE NOT NULL ,
payer_plan_period_end_date DATE NOT NULL , payer_plan_period_end_date DATE NOT NULL ,
payer_concept_id INTEGER NULL , payer_concept_id INTEGER NOT NULL ,
plan_concept_id INTEGER NULL , plan_concept_id INTEGER NOT NULL ,
contract_concept_id INTEGER NULL , contract_concept_id INTEGER NOT NULL ,
sponsor_concept_id INTEGER NULL , sponsor_concept_id INTEGER NOT NULL ,
stop_reason_concept_id INTEGER NULL , stop_reason_concept_id INTEGER NOT NULL ,
payer_source_value VARCHAR(50) NULL , payer_source_value VARCHAR(50) NULL ,
payer_source_concept_id INTEGER NULL , payer_source_concept_id INTEGER NOT NULL ,
plan_source_value VARCHAR(50) NULL , plan_source_value VARCHAR(50) NULL ,
plan_source_concept_id INTEGER NULL , plan_source_concept_id INTEGER NOT NULL ,
contract_source_value VARCHAR(50) NULL , contract_source_value VARCHAR(50) NULL ,
contract_source_concept_id INTEGER NULL , contract_source_concept_id INTEGER NOT NULL ,
sponsor_source_value VARCHAR(50) NULL , sponsor_source_value VARCHAR(50) NULL ,
sponsor_source_concept_id INTEGER NULL , sponsor_source_concept_id INTEGER NOT NULL ,
family_source_value VARCHAR(50) NULL , family_source_value VARCHAR(50) NULL ,
stop_reason_source_value VARCHAR(50) NULL , stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL stop_reason_source_concept_id INTEGER NOT NULL
) )
DISTKEY(person_id); DISTKEY(person_id);
@ -655,15 +655,15 @@ CREATE TABLE cost (
cost_event_field_concept_id INTEGER NOT NULL , cost_event_field_concept_id INTEGER NOT NULL ,
cost_concept_id INTEGER NOT NULL , cost_concept_id INTEGER NOT NULL ,
cost_type_concept_id INTEGER NOT NULL , cost_type_concept_id INTEGER NOT NULL ,
currency_concept_id INTEGER NULL , currency_concept_id INTEGER NOT NULL ,
cost FLOAT NULL , cost FLOAT NULL ,
incurred_date DATE NOT NULL , incurred_date DATE NOT NULL ,
billed_date DATE NULL , billed_date DATE NULL ,
paid_date DATE NULL , paid_date DATE NULL ,
revenue_code_concept_id INTEGER NULL , revenue_code_concept_id INTEGER NOT NULL ,
drg_concept_id INTEGER NULL , drg_concept_id INTEGER NOT NULL ,
cost_source_value VARCHAR(50) NULL , cost_source_value VARCHAR(50) NULL ,
cost_source_concept_id INTEGER NULL , cost_source_concept_id INTEGER NOT NULL ,
revenue_code_source_value VARCHAR(50) NULL , revenue_code_source_value VARCHAR(50) NULL ,
drg_source_value VARCHAR(3) NULL , drg_source_value VARCHAR(3) NULL ,
payer_plan_period_id BIGINT NULL payer_plan_period_id BIGINT NULL

View File

@ -229,11 +229,11 @@ CREATE TABLE person
care_site_id BIGINT 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 NOT NULL,
race_source_value VARCHAR(50) NULL, race_source_value VARCHAR(50) NULL,
race_source_concept_id INTEGER NULL, race_source_concept_id INTEGER NOT NULL,
ethnicity_source_value VARCHAR(50) NULL, ethnicity_source_value VARCHAR(50) NULL,
ethnicity_source_concept_id INTEGER NULL ethnicity_source_concept_id INTEGER NOT NULL
) )
; ;
@ -261,8 +261,8 @@ CREATE TABLE specimen
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 NOT NULL ,
disease_status_concept_id INTEGER NULL , disease_status_concept_id INTEGER NOT 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 ,
@ -286,11 +286,11 @@ CREATE TABLE visit_occurrence
provider_id BIGINT NULL, provider_id BIGINT NULL,
care_site_id BIGINT 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 NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
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 NOT NULL ,
preceding_visit_occurrence_id BIGINT NULL preceding_visit_occurrence_id BIGINT NULL
) )
; ;
@ -309,11 +309,11 @@ CREATE TABLE visit_detail
visit_detail_type_concept_id INTEGER NOT NULL , visit_detail_type_concept_id INTEGER NOT NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
care_site_id BIGINT NULL , care_site_id BIGINT NULL ,
discharge_to_concept_id INTEGER NULL , discharge_to_concept_id INTEGER NOT NULL ,
admitted_from_concept_id INTEGER NULL , admitted_from_concept_id INTEGER NOT NULL ,
admitted_from_source_value VARCHAR(50) NULL , admitted_from_source_value VARCHAR(50) NULL ,
visit_detail_source_value VARCHAR(50) NULL , visit_detail_source_value VARCHAR(50) NULL ,
visit_detail_source_concept_id INTEGER NULL , visit_detail_source_concept_id INTEGER NOT NULL ,
discharge_to_source_value VARCHAR(50) NULL , discharge_to_source_value VARCHAR(50) NULL ,
preceding_visit_detail_id BIGINT NULL , preceding_visit_detail_id BIGINT NULL ,
visit_detail_parent_id BIGINT NULL , visit_detail_parent_id BIGINT NULL ,
@ -331,13 +331,13 @@ CREATE TABLE procedure_occurrence
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 NOT NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT NULL ,
modifier_source_value VARCHAR(50) NULL modifier_source_value VARCHAR(50) NULL
) )
; ;
@ -360,13 +360,13 @@ CREATE TABLE drug_exposure
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 NOT NULL ,
lot_number VARCHAR(50) NULL , lot_number VARCHAR(50) NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT 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
) )
@ -390,7 +390,7 @@ CREATE TABLE device_exposure
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT NULL
) )
; ;
@ -406,13 +406,13 @@ CREATE TABLE condition_occurrence
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 NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT NULL ,
condition_status_source_value VARCHAR(50) NULL condition_status_source_value VARCHAR(50) NULL
) )
; ;
@ -438,7 +438,7 @@ CREATE TABLE measurement
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT 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 NOT 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
) )
@ -451,7 +451,7 @@ 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 , note_event_id BIGINT NULL ,
note_event_field_concept_id INTEGER NULL , note_event_field_concept_id INTEGER NOT 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 ,
@ -473,18 +473,18 @@ 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 NOT 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 NOT 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 NOT NULL
) )
; ;
@ -507,11 +507,11 @@ CREATE TABLE observation
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
visit_detail_id BIGINT NULL , visit_detail_id BIGINT NULL ,
observation_source_value VARCHAR(50) NULL , observation_source_value VARCHAR(50) NULL ,
observation_source_concept_id INTEGER NULL , observation_source_concept_id INTEGER NOT NULL ,
unit_source_value VARCHAR(50) NULL , unit_source_value VARCHAR(50) NULL ,
qualifier_source_value VARCHAR(50) NULL , qualifier_source_value VARCHAR(50) NULL ,
observation_event_id BIGINT NULL , observation_event_id BIGINT NULL ,
obs_event_field_concept_id INTEGER NULL , obs_event_field_concept_id INTEGER NOT NULL ,
value_as_datetime DATETIME2 NULL value_as_datetime DATETIME2 NULL
) )
; ;
@ -528,18 +528,18 @@ CREATE TABLE survey_conduct
survey_end_date DATE NULL , survey_end_date DATE NULL ,
survey_end_datetime DATETIME2 NOT NULL , survey_end_datetime DATETIME2 NOT NULL ,
provider_id BIGINT NULL , provider_id BIGINT NULL ,
assisted_concept_id INTEGER NULL , assisted_concept_id INTEGER NOT NULL ,
respondent_type_concept_id INTEGER NULL , respondent_type_concept_id INTEGER NOT NULL ,
timing_concept_id INTEGER NULL , timing_concept_id INTEGER NOT NULL ,
collection_method_concept_id INTEGER NULL , collection_method_concept_id INTEGER NOT NULL ,
assisted_source_value VARCHAR(50) NULL , assisted_source_value VARCHAR(50) NULL ,
respondent_type_source_value VARCHAR(100) NULL , respondent_type_source_value VARCHAR(100) NULL ,
timing_source_value VARCHAR(100) NULL , timing_source_value VARCHAR(100) NULL ,
collection_method_source_value VARCHAR(100) NULL , collection_method_source_value VARCHAR(100) NULL ,
survey_source_value VARCHAR(100) NULL , survey_source_value VARCHAR(100) NULL ,
survey_source_concept_id INTEGER NULL , survey_source_concept_id INTEGER NOT NULL ,
survey_source_identifier VARCHAR(100) NULL , survey_source_identifier VARCHAR(100) NULL ,
validated_survey_concept_id INTEGER NULL , validated_survey_concept_id INTEGER NOT NULL ,
validated_survey_source_value VARCHAR(100) NULL , validated_survey_source_value VARCHAR(100) NULL ,
survey_version_number VARCHAR(20) NULL , survey_version_number VARCHAR(20) NULL ,
visit_occurrence_id BIGINT NULL , visit_occurrence_id BIGINT NULL ,
@ -592,7 +592,7 @@ CREATE TABLE location_history
( (
location_history_id BIGINT NOT NULL , location_history_id BIGINT NOT NULL ,
location_id BIGINT NOT NULL , location_id BIGINT NOT NULL ,
relationship_type_concept_id INTEGER NULL , relationship_type_concept_id INTEGER NOT NULL ,
domain_id VARCHAR(50) NOT NULL , domain_id VARCHAR(50) NOT NULL ,
entity_id BIGINT NOT NULL , entity_id BIGINT NOT NULL ,
start_date DATE NOT NULL , start_date DATE NOT NULL ,
@ -606,7 +606,7 @@ CREATE TABLE care_site
( (
care_site_id BIGINT NOT NULL , care_site_id BIGINT NOT NULL ,
care_site_name VARCHAR(255) NULL , care_site_name VARCHAR(255) NULL ,
place_of_service_concept_id INTEGER NULL , place_of_service_concept_id INTEGER NOT NULL ,
location_id BIGINT NULL , location_id BIGINT NULL ,
care_site_source_value VARCHAR(50) NULL , care_site_source_value VARCHAR(50) NULL ,
place_of_service_source_value VARCHAR(50) NULL place_of_service_source_value VARCHAR(50) NULL
@ -621,15 +621,15 @@ CREATE TABLE provider
provider_name VARCHAR(255) NULL , provider_name VARCHAR(255) NULL ,
NPI VARCHAR(20) NULL , NPI VARCHAR(20) NULL ,
DEA VARCHAR(20) NULL , DEA VARCHAR(20) NULL ,
specialty_concept_id INTEGER NULL , specialty_concept_id INTEGER NOT NULL ,
care_site_id BIGINT NULL , care_site_id BIGINT NULL ,
year_of_birth INTEGER NULL , year_of_birth INTEGER NULL ,
gender_concept_id INTEGER NULL , gender_concept_id INTEGER NOT NULL ,
provider_source_value VARCHAR(50) NULL , provider_source_value VARCHAR(50) NULL ,
specialty_source_value VARCHAR(50) NULL , specialty_source_value VARCHAR(50) NULL ,
specialty_source_concept_id INTEGER NULL , specialty_source_concept_id INTEGER NOT NULL ,
gender_source_value VARCHAR(50) NULL , gender_source_value VARCHAR(50) NULL ,
gender_source_concept_id INTEGER NULL gender_source_concept_id INTEGER NOT NULL
) )
; ;
@ -649,22 +649,22 @@ CREATE TABLE payer_plan_period
contract_person_id BIGINT NULL , contract_person_id BIGINT NULL ,
payer_plan_period_start_date DATE NOT NULL , payer_plan_period_start_date DATE NOT NULL ,
payer_plan_period_end_date DATE NOT NULL , payer_plan_period_end_date DATE NOT NULL ,
payer_concept_id INTEGER NULL , payer_concept_id INTEGER NOT NULL ,
plan_concept_id INTEGER NULL , plan_concept_id INTEGER NOT NULL ,
contract_concept_id INTEGER NULL , contract_concept_id INTEGER NOT NULL ,
sponsor_concept_id INTEGER NULL , sponsor_concept_id INTEGER NOT NULL ,
stop_reason_concept_id INTEGER NULL , stop_reason_concept_id INTEGER NOT NULL ,
payer_source_value VARCHAR(50) NULL , payer_source_value VARCHAR(50) NULL ,
payer_source_concept_id INTEGER NULL , payer_source_concept_id INTEGER NOT NULL ,
plan_source_value VARCHAR(50) NULL , plan_source_value VARCHAR(50) NULL ,
plan_source_concept_id INTEGER NULL , plan_source_concept_id INTEGER NOT NULL ,
contract_source_value VARCHAR(50) NULL , contract_source_value VARCHAR(50) NULL ,
contract_source_concept_id INTEGER NULL , contract_source_concept_id INTEGER NOT NULL ,
sponsor_source_value VARCHAR(50) NULL , sponsor_source_value VARCHAR(50) NULL ,
sponsor_source_concept_id INTEGER NULL , sponsor_source_concept_id INTEGER NOT NULL ,
family_source_value VARCHAR(50) NULL , family_source_value VARCHAR(50) NULL ,
stop_reason_source_value VARCHAR(50) NULL , stop_reason_source_value VARCHAR(50) NULL ,
stop_reason_source_concept_id INTEGER NULL stop_reason_source_concept_id INTEGER NOT NULL
) )
; ;
@ -678,15 +678,15 @@ CREATE TABLE cost
cost_event_field_concept_id INTEGER NOT NULL , cost_event_field_concept_id INTEGER NOT NULL ,
cost_concept_id INTEGER NOT NULL , cost_concept_id INTEGER NOT NULL ,
cost_type_concept_id INTEGER NOT NULL , cost_type_concept_id INTEGER NOT NULL ,
currency_concept_id INTEGER NULL , currency_concept_id INTEGER NOT NULL ,
cost FLOAT NULL , cost FLOAT NULL ,
incurred_date DATE NOT NULL , incurred_date DATE NOT NULL ,
billed_date DATE NULL , billed_date DATE NULL ,
paid_date DATE NULL , paid_date DATE NULL ,
revenue_code_concept_id INTEGER NULL , revenue_code_concept_id INTEGER NOT NULL ,
drg_concept_id INTEGER NULL , drg_concept_id INTEGER NOT NULL ,
cost_source_value VARCHAR(50) NULL , cost_source_value VARCHAR(50) NULL ,
cost_source_concept_id INTEGER NULL , cost_source_concept_id INTEGER NOT NULL ,
revenue_code_source_value VARCHAR(50) NULL , revenue_code_source_value VARCHAR(50) NULL ,
drg_source_value VARCHAR(3) NULL , drg_source_value VARCHAR(3) NULL ,
payer_plan_period_id BIGINT NULL payer_plan_period_id BIGINT NULL