Merge Claire's DDL updates
This commit is contained in:
commit
7e08fa1737
|
@ -2,3 +2,4 @@
|
|||
.Rhistory
|
||||
.RData
|
||||
.Ruserdata
|
||||
extras/CodeToRun.R
|
||||
|
|
|
@ -36,7 +36,7 @@ alter table @cdmDatabaseSchema.visit_occurrence add constraint fpk_visit_occurre
|
|||
|
||||
alter table @cdmDatabaseSchema.visit_occurrence add constraint fpk_visit_occurrence_admitted_from_concept_id foreign key (admitted_from_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.visit_occurrence add constraint fpk_visit_occurrence_discharge_to_concept_id foreign key (discharge_to_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
alter table @cdmDatabaseSchema.visit_occurrence add constraint fpk_visit_occurrence_discharged_to_concept_id foreign key (discharged_to_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.visit_occurrence add constraint fpk_visit_occurrence_preceding_visit_occurrence_id foreign key (preceding_visit_occurrence_id) references @cdmDatabaseSchema.visit_occurrence (visit_occurrence_id);
|
||||
|
||||
|
@ -54,11 +54,11 @@ alter table @cdmDatabaseSchema.visit_detail add constraint fpk_visit_detail_visi
|
|||
|
||||
alter table @cdmDatabaseSchema.visit_detail add constraint fpk_visit_detail_admitted_from_concept_id foreign key (admitted_from_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.visit_detail add constraint fpk_visit_detail_discharge_to_concept_id foreign key (discharge_to_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
alter table @cdmDatabaseSchema.visit_detail add constraint fpk_visit_detail_discharged_to_concept_id foreign key (discharged_to_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.visit_detail add constraint fpk_visit_detail_preceding_visit_detail_id foreign key (preceding_visit_detail_id) references @cdmDatabaseSchema.visit_detail (visit_detail_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.visit_detail add constraint fpk_visit_detail_visit_detail_parent_id foreign key (visit_detail_parent_id) references @cdmDatabaseSchema.visit_detail (visit_detail_id);
|
||||
alter table @cdmDatabaseSchema.visit_detail add constraint fpk_visit_detail_parent_visit_detail_id foreign key (parent_visit_detail_id) references @cdmDatabaseSchema.visit_detail (visit_detail_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.visit_detail add constraint fpk_visit_detail_visit_occurrence_id foreign key (visit_occurrence_id) references @cdmDatabaseSchema.visit_occurrence (visit_occurrence_id);
|
||||
|
||||
|
@ -136,6 +136,10 @@ alter table @cdmDatabaseSchema.measurement add constraint fpk_measurement_visit_
|
|||
|
||||
alter table @cdmDatabaseSchema.measurement add constraint fpk_measurement_measurement_source_concept_id foreign key (measurement_source_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.measurement add constraint fpk_measurement_unit_source_concept_id foreign key (unit_source_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.measurement add constraint fpk_measurement_meas_event_field_concept_id foreign key (meas_event_field_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.observation add constraint fpk_observation_person_id foreign key (person_id) references @cdmDatabaseSchema.person (person_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.observation add constraint fpk_observation_observation_concept_id foreign key (observation_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
@ -156,6 +160,8 @@ alter table @cdmDatabaseSchema.observation add constraint fpk_observation_visit_
|
|||
|
||||
alter table @cdmDatabaseSchema.observation add constraint fpk_observation_observation_source_concept_id foreign key (observation_source_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.observation add constraint fpk_observation_obs_event_field_concept_id foreign key (obs_event_field_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.death add constraint fpk_death_person_id foreign key (person_id) references @cdmDatabaseSchema.person (person_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.death add constraint fpk_death_death_type_concept_id foreign key (death_type_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
@ -166,6 +172,8 @@ alter table @cdmDatabaseSchema.death add constraint fpk_death_cause_source_conce
|
|||
|
||||
alter table @cdmDatabaseSchema.note add constraint fpk_note_person_id foreign key (person_id) references @cdmDatabaseSchema.person (person_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.note add constraint fpk_note_note_event_field_concept_id foreign key (note_event_field_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.note add constraint fpk_note_note_type_concept_id foreign key (note_type_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.note add constraint fpk_note_note_class_concept_id foreign key (note_class_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
@ -260,6 +268,20 @@ alter table @cdmDatabaseSchema.dose_era add constraint fpk_dose_era_unit_concept
|
|||
|
||||
alter table @cdmDatabaseSchema.condition_era add constraint fpk_condition_era_condition_concept_id foreign key (condition_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.episode add constraint fpk_episode_person_id foreign key (person_id) references @cdmDatabaseSchema.person (person_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.episode add constraint fpk_episode_episode_concept_id foreign key (episode_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.episode add constraint fpk_episode_episode_object_concept_id foreign key (episode_object_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.episode add constraint fpk_episode_episode_type_concept_id foreign key (episode_type_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.episode add constraint fpk_episode_episode_source_concept_id foreign key (episode_source_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.episode_event add constraint fpk_episode_event_episode_id foreign key (episode_id) references @cdmDatabaseSchema.episode (episode_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.episode_event add constraint fpk_episode_event_episode_event_field_concept_id foreign key (episode_event_field_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.metadata add constraint fpk_metadata_metadata_concept_id foreign key (metadata_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.metadata add constraint fpk_metadata_metadata_type_concept_id foreign key (metadata_type_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
@ -313,5 +335,3 @@ alter table @cdmDatabaseSchema.drug_strength add constraint fpk_drug_strength_de
|
|||
alter table @cdmDatabaseSchema.cohort_definition add constraint fpk_cohort_definition_definition_type_concept_id foreign key (definition_type_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.cohort_definition add constraint fpk_cohort_definition_subject_concept_id foreign key (subject_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.attribute_definition add constraint fpk_attribute_definition_attribute_type_concept_id foreign key (attribute_type_concept_id) references @cdmDatabaseSchema.concept (concept_id);
|
||||
|
|
|
@ -45,8 +45,8 @@ create table @cdmDatabaseSchema.visit_occurrence (
|
|||
visit_source_concept_id INT64,
|
||||
admitted_from_concept_id INT64,
|
||||
admitted_from_source_value STRING,
|
||||
discharge_to_concept_id INT64,
|
||||
discharge_to_source_value STRING,
|
||||
discharged_to_concept_id INT64,
|
||||
discharged_to_source_value STRING,
|
||||
preceding_visit_occurrence_id INT64 );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -63,12 +63,12 @@ create table @cdmDatabaseSchema.visit_detail (
|
|||
care_site_id INT64,
|
||||
visit_detail_source_value STRING,
|
||||
visit_detail_source_concept_id INT64,
|
||||
admitted_from_source_value STRING,
|
||||
admitted_from_concept_id INT64,
|
||||
discharge_to_source_value STRING,
|
||||
discharge_to_concept_id INT64,
|
||||
admitted_from_source_value STRING,
|
||||
discharged_to_source_value STRING,
|
||||
discharged_to_concept_id INT64,
|
||||
preceding_visit_detail_id INT64,
|
||||
visit_detail_parent_id INT64,
|
||||
parent_visit_detail_id INT64,
|
||||
visit_occurrence_id INT64 not null );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -178,7 +178,10 @@ create table @cdmDatabaseSchema.measurement (
|
|||
measurement_source_value STRING,
|
||||
measurement_source_concept_id INT64,
|
||||
unit_source_value STRING,
|
||||
value_source_value STRING );
|
||||
unit_source_concept_id INT64,
|
||||
value_source_value STRING,
|
||||
measurement_event_id INT64,
|
||||
meas_event_field_concept_id INT64 );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
create table @cdmDatabaseSchema.observation (
|
||||
|
@ -200,7 +203,9 @@ create table @cdmDatabaseSchema.observation (
|
|||
observation_source_concept_id INT64,
|
||||
unit_source_value STRING,
|
||||
qualifier_source_value STRING,
|
||||
value_source_value STRING );
|
||||
value_source_value STRING,
|
||||
observation_event_id INT64,
|
||||
obs_event_field_concept_id INT64 );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
create table @cdmDatabaseSchema.death (
|
||||
|
@ -216,6 +221,8 @@ create table @cdmDatabaseSchema.death (
|
|||
create table @cdmDatabaseSchema.note (
|
||||
note_id INT64 not null,
|
||||
person_id INT64 not null,
|
||||
note_event_id INT64,
|
||||
note_event_field_concept_id INT64,
|
||||
note_date date not null,
|
||||
note_datetime datetime null,
|
||||
note_type_concept_id INT64 not null,
|
||||
|
@ -386,13 +393,37 @@ create table @cdmDatabaseSchema.condition_era (
|
|||
condition_era_end_date datetime not null,
|
||||
condition_occurrence_count INT64 );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
create table @cdmDatabaseSchema.episode (
|
||||
episode_id INT64 not null,
|
||||
person_id INT64 not null,
|
||||
episode_concept_id INT64 not null,
|
||||
episode_start_date date not null,
|
||||
episode_start_datetime datetime null,
|
||||
episode_end_date date null,
|
||||
episode_end_datetime datetime null,
|
||||
episode_parent_id INT64,
|
||||
episode_number INT64,
|
||||
episode_object_concept_id INT64 not null,
|
||||
episode_type_concept_id INT64 not null,
|
||||
episode_source_value STRING,
|
||||
episode_source_concept_id INT64 );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
create table @cdmDatabaseSchema.episode_event (
|
||||
episode_id INT64 not null,
|
||||
event_id INT64 not null,
|
||||
episode_event_field_concept_id INT64 not null );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
create table @cdmDatabaseSchema.metadata (
|
||||
metadata_id INT64 not null,
|
||||
metadata_concept_id INT64 not null,
|
||||
metadata_type_concept_id INT64 not null,
|
||||
name STRING not null,
|
||||
value_as_string STRING,
|
||||
value_as_concept_id INT64,
|
||||
value_as_number FLOAT64 null,
|
||||
metadata_date date null,
|
||||
metadata_datetime datetime null );
|
||||
|
||||
|
@ -501,6 +532,13 @@ create table @cdmDatabaseSchema.drug_strength (
|
|||
valid_end_date date not null,
|
||||
invalid_reason STRING );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
create table @cdmDatabaseSchema.cohort (
|
||||
cohort_definition_id INT64 not null,
|
||||
subject_id INT64 not null,
|
||||
cohort_start_date date not null,
|
||||
cohort_end_date date not null );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
create table @cdmDatabaseSchema.cohort_definition (
|
||||
cohort_definition_id INT64 not null,
|
||||
|
@ -510,11 +548,3 @@ create table @cdmDatabaseSchema.cohort_definition (
|
|||
cohort_definition_syntax STRING,
|
||||
subject_concept_id INT64 not null,
|
||||
cohort_initiation_date date null );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
create table @cdmDatabaseSchema.attribute_definition (
|
||||
attribute_definition_id INT64 not null,
|
||||
attribute_name STRING not null,
|
||||
attribute_description STRING,
|
||||
attribute_type_concept_id INT64 not null,
|
||||
attribute_syntax STRING );
|
|
@ -42,6 +42,10 @@ alter table @cdmDatabaseSchema.dose_era add constraint xpk_dose_era primary key
|
|||
|
||||
alter table @cdmDatabaseSchema.condition_era add constraint xpk_condition_era primary key nonclustered (condition_era_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.episode add constraint xpk_episode primary key nonclustered (episode_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.metadata add constraint xpk_metadata primary key nonclustered (metadata_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.concept add constraint xpk_concept primary key nonclustered (concept_id);
|
||||
|
||||
alter table @cdmDatabaseSchema.vocabulary add constraint xpk_vocabulary primary key nonclustered (vocabulary_id);
|
||||
|
|
|
@ -36,7 +36,7 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRE
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_preceding_visit_occurrence_id FOREIGN KEY (preceding_visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -54,11 +54,11 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visi
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_preceding_visit_detail_id FOREIGN KEY (preceding_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_detail_parent_id FOREIGN KEY (visit_detail_parent_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_parent_visit_detail_id FOREIGN KEY (parent_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_occurrence_id FOREIGN KEY (visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -136,6 +136,10 @@ ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_measurement_source_concept_id FOREIGN KEY (measurement_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_unit_source_concept_id FOREIGN KEY (unit_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_meas_event_field_concept_id FOREIGN KEY (meas_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_concept_id FOREIGN KEY (observation_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -156,6 +160,8 @@ ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_source_concept_id FOREIGN KEY (observation_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_obs_event_field_concept_id FOREIGN KEY (obs_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_death_type_concept_id FOREIGN KEY (death_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -166,6 +172,8 @@ ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_cause_source_conce
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_event_field_concept_id FOREIGN KEY (note_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_type_concept_id FOREIGN KEY (note_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_class_concept_id FOREIGN KEY (note_class_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -260,6 +268,20 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT fpk_DOSE_ERA_unit_concept
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT fpk_CONDITION_ERA_condition_concept_id FOREIGN KEY (condition_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_concept_id FOREIGN KEY (episode_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_object_concept_id FOREIGN KEY (episode_object_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_type_concept_id FOREIGN KEY (episode_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_source_concept_id FOREIGN KEY (episode_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_id FOREIGN KEY (episode_id) REFERENCES @cdmDatabaseSchema.EPISODE (EPISODE_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_event_field_concept_id FOREIGN KEY (episode_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_concept_id FOREIGN KEY (metadata_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_type_concept_id FOREIGN KEY (metadata_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -313,5 +335,3 @@ ALTER TABLE @cdmDatabaseSchema.DRUG_STRENGTH ADD CONSTRAINT fpk_DRUG_STRENGTH_de
|
|||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_definition_type_concept_id FOREIGN KEY (definition_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_subject_concept_id FOREIGN KEY (subject_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION ADD CONSTRAINT fpk_ATTRIBUTE_DEFINITION_attribute_type_concept_id FOREIGN KEY (attribute_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
|
|
@ -45,8 +45,8 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE (
|
|||
visit_source_concept_id integer NULL,
|
||||
admitted_from_concept_id integer NULL,
|
||||
admitted_from_source_value VARCHAR(50),
|
||||
discharge_to_concept_id integer NULL,
|
||||
discharge_to_source_value VARCHAR(50),
|
||||
discharged_to_concept_id integer NULL,
|
||||
discharged_to_source_value VARCHAR(50),
|
||||
preceding_visit_occurrence_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -63,12 +63,12 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_DETAIL (
|
|||
care_site_id integer NULL,
|
||||
visit_detail_source_value VARCHAR(50),
|
||||
visit_detail_source_concept_id Integer NULL,
|
||||
admitted_from_source_value VARCHAR(50),
|
||||
admitted_from_concept_id Integer NULL,
|
||||
discharge_to_source_value VARCHAR(50),
|
||||
discharge_to_concept_id integer NULL,
|
||||
admitted_from_source_value VARCHAR(50),
|
||||
discharged_to_source_value VARCHAR(50),
|
||||
discharged_to_concept_id integer NULL,
|
||||
preceding_visit_detail_id integer NULL,
|
||||
visit_detail_parent_id integer NULL,
|
||||
parent_visit_detail_id integer NULL,
|
||||
visit_occurrence_id INT );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -178,7 +178,10 @@ CREATE TABLE @cdmDatabaseSchema.MEASUREMENT (
|
|||
measurement_source_value VARCHAR(50),
|
||||
measurement_source_concept_id integer NULL,
|
||||
unit_source_value VARCHAR(50),
|
||||
value_source_value VARCHAR(50) );
|
||||
unit_source_concept_id integer NULL,
|
||||
value_source_value VARCHAR(50),
|
||||
measurement_event_id BIGINT,
|
||||
meas_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
||||
|
@ -200,7 +203,9 @@ CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
|||
observation_source_concept_id integer NULL,
|
||||
unit_source_value VARCHAR(50),
|
||||
qualifier_source_value VARCHAR(50),
|
||||
value_source_value VARCHAR(50) );
|
||||
value_source_value VARCHAR(50),
|
||||
observation_event_id BIGINT,
|
||||
obs_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.DEATH (
|
||||
|
@ -216,6 +221,8 @@ CREATE TABLE @cdmDatabaseSchema.DEATH (
|
|||
CREATE TABLE @cdmDatabaseSchema.NOTE (
|
||||
note_id INT,
|
||||
person_id INT,
|
||||
note_event_id BIGINT,
|
||||
note_event_field_concept_id integer NULL,
|
||||
note_date TIMESTAMP,
|
||||
note_datetime TIMESTAMP,
|
||||
note_type_concept_id INT,
|
||||
|
@ -386,13 +393,37 @@ CREATE TABLE @cdmDatabaseSchema.CONDITION_ERA (
|
|||
condition_era_end_date TIMESTAMP,
|
||||
condition_occurrence_count integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE (
|
||||
episode_id INT,
|
||||
person_id INT,
|
||||
episode_concept_id INT,
|
||||
episode_start_date TIMESTAMP,
|
||||
episode_start_datetime TIMESTAMP,
|
||||
episode_end_date TIMESTAMP,
|
||||
episode_end_datetime TIMESTAMP,
|
||||
episode_parent_id integer NULL,
|
||||
episode_number integer NULL,
|
||||
episode_object_concept_id INT,
|
||||
episode_type_concept_id INT,
|
||||
episode_source_value VARCHAR(50),
|
||||
episode_source_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE_EVENT (
|
||||
episode_id INT,
|
||||
event_id INT,
|
||||
episode_event_field_concept_id INT );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.METADATA (
|
||||
metadata_id INT,
|
||||
metadata_concept_id INT,
|
||||
metadata_type_concept_id INT,
|
||||
name VARCHAR(250),
|
||||
value_as_string VARCHAR(250),
|
||||
value_as_concept_id integer NULL,
|
||||
value_as_number FLOAT,
|
||||
metadata_date TIMESTAMP,
|
||||
metadata_datetime TIMESTAMP );
|
||||
|
||||
|
@ -501,6 +532,13 @@ CREATE TABLE @cdmDatabaseSchema.DRUG_STRENGTH (
|
|||
valid_end_date TIMESTAMP,
|
||||
invalid_reason VARCHAR(1) );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT (
|
||||
cohort_definition_id INT,
|
||||
subject_id INT,
|
||||
cohort_start_date TIMESTAMP,
|
||||
cohort_end_date TIMESTAMP );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
||||
cohort_definition_id INT,
|
||||
|
@ -510,11 +548,3 @@ CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
|||
cohort_definition_syntax VARCHAR(MAX),
|
||||
subject_concept_id INT,
|
||||
cohort_initiation_date TIMESTAMP );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION (
|
||||
attribute_definition_id INT,
|
||||
attribute_name VARCHAR(255),
|
||||
attribute_description VARCHAR(MAX),
|
||||
attribute_type_concept_id INT,
|
||||
attribute_syntax VARCHAR(MAX) );
|
|
@ -42,6 +42,10 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT xpk_DOSE_ERA PRIMARY KEY
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT xpk_CONDITION_ERA PRIMARY KEY NONCLUSTERED (condition_era_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT xpk_EPISODE PRIMARY KEY NONCLUSTERED (episode_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT xpk_METADATA PRIMARY KEY NONCLUSTERED (metadata_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONCEPT ADD CONSTRAINT xpk_CONCEPT PRIMARY KEY NONCLUSTERED (concept_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VOCABULARY ADD CONSTRAINT xpk_VOCABULARY PRIMARY KEY NONCLUSTERED (vocabulary_id);
|
||||
|
|
|
@ -36,7 +36,7 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRE
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_preceding_visit_occurrence_id FOREIGN KEY (preceding_visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -54,11 +54,11 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visi
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_preceding_visit_detail_id FOREIGN KEY (preceding_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_detail_parent_id FOREIGN KEY (visit_detail_parent_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_parent_visit_detail_id FOREIGN KEY (parent_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_occurrence_id FOREIGN KEY (visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -136,6 +136,10 @@ ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_measurement_source_concept_id FOREIGN KEY (measurement_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_unit_source_concept_id FOREIGN KEY (unit_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_meas_event_field_concept_id FOREIGN KEY (meas_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_concept_id FOREIGN KEY (observation_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -156,6 +160,8 @@ ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_source_concept_id FOREIGN KEY (observation_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_obs_event_field_concept_id FOREIGN KEY (obs_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_death_type_concept_id FOREIGN KEY (death_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -166,6 +172,8 @@ ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_cause_source_conce
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_event_field_concept_id FOREIGN KEY (note_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_type_concept_id FOREIGN KEY (note_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_class_concept_id FOREIGN KEY (note_class_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -260,6 +268,20 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT fpk_DOSE_ERA_unit_concept
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT fpk_CONDITION_ERA_condition_concept_id FOREIGN KEY (condition_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_concept_id FOREIGN KEY (episode_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_object_concept_id FOREIGN KEY (episode_object_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_type_concept_id FOREIGN KEY (episode_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_source_concept_id FOREIGN KEY (episode_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_id FOREIGN KEY (episode_id) REFERENCES @cdmDatabaseSchema.EPISODE (EPISODE_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_event_field_concept_id FOREIGN KEY (episode_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_concept_id FOREIGN KEY (metadata_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_type_concept_id FOREIGN KEY (metadata_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -313,5 +335,3 @@ ALTER TABLE @cdmDatabaseSchema.DRUG_STRENGTH ADD CONSTRAINT fpk_DRUG_STRENGTH_de
|
|||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_definition_type_concept_id FOREIGN KEY (definition_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_subject_concept_id FOREIGN KEY (subject_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION ADD CONSTRAINT fpk_ATTRIBUTE_DEFINITION_attribute_type_concept_id FOREIGN KEY (attribute_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
|
|
@ -45,8 +45,8 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE (
|
|||
visit_source_concept_id integer NULL,
|
||||
admitted_from_concept_id integer NULL,
|
||||
admitted_from_source_value varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
discharge_to_source_value varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
discharged_to_source_value varchar(50) NULL,
|
||||
preceding_visit_occurrence_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -63,12 +63,12 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_DETAIL (
|
|||
care_site_id integer NULL,
|
||||
visit_detail_source_value varchar(50) NULL,
|
||||
visit_detail_source_concept_id Integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
admitted_from_concept_id Integer NULL,
|
||||
discharge_to_source_value Varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
discharged_to_source_value Varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
preceding_visit_detail_id integer NULL,
|
||||
visit_detail_parent_id integer NULL,
|
||||
parent_visit_detail_id integer NULL,
|
||||
visit_occurrence_id integer NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -178,7 +178,10 @@ CREATE TABLE @cdmDatabaseSchema.MEASUREMENT (
|
|||
measurement_source_value varchar(50) NULL,
|
||||
measurement_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL );
|
||||
unit_source_concept_id integer NULL,
|
||||
value_source_value varchar(50) NULL,
|
||||
measurement_event_id bigint NULL,
|
||||
meas_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
||||
|
@ -200,7 +203,9 @@ CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
|||
observation_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
qualifier_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL );
|
||||
value_source_value varchar(50) NULL,
|
||||
observation_event_id bigint NULL,
|
||||
obs_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.DEATH (
|
||||
|
@ -216,6 +221,8 @@ CREATE TABLE @cdmDatabaseSchema.DEATH (
|
|||
CREATE TABLE @cdmDatabaseSchema.NOTE (
|
||||
note_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
note_event_id bigint NULL,
|
||||
note_event_field_concept_id integer NULL,
|
||||
note_date date NOT NULL,
|
||||
note_datetime TIMESTAMP NULL,
|
||||
note_type_concept_id integer NOT NULL,
|
||||
|
@ -386,13 +393,37 @@ CREATE TABLE @cdmDatabaseSchema.CONDITION_ERA (
|
|||
condition_era_end_date TIMESTAMP NOT NULL,
|
||||
condition_occurrence_count integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE (
|
||||
episode_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
episode_concept_id integer NOT NULL,
|
||||
episode_start_date date NOT NULL,
|
||||
episode_start_datetime TIMESTAMP NULL,
|
||||
episode_end_date date NULL,
|
||||
episode_end_datetime TIMESTAMP NULL,
|
||||
episode_parent_id integer NULL,
|
||||
episode_number integer NULL,
|
||||
episode_object_concept_id integer NOT NULL,
|
||||
episode_type_concept_id integer NOT NULL,
|
||||
episode_source_value varchar(50) NULL,
|
||||
episode_source_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE_EVENT (
|
||||
episode_id integer NOT NULL,
|
||||
event_id integer NOT NULL,
|
||||
episode_event_field_concept_id integer NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.METADATA (
|
||||
metadata_id integer NOT NULL,
|
||||
metadata_concept_id integer NOT NULL,
|
||||
metadata_type_concept_id integer NOT NULL,
|
||||
name varchar(250) NOT NULL,
|
||||
value_as_string varchar(250) NULL,
|
||||
value_as_concept_id integer NULL,
|
||||
value_as_number FLOAT(6) NULL,
|
||||
metadata_date date NULL,
|
||||
metadata_datetime TIMESTAMP NULL );
|
||||
|
||||
|
@ -501,6 +532,13 @@ CREATE TABLE @cdmDatabaseSchema.DRUG_STRENGTH (
|
|||
valid_end_date date NOT NULL,
|
||||
invalid_reason varchar(1) NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT (
|
||||
cohort_definition_id integer NOT NULL,
|
||||
subject_id integer NOT NULL,
|
||||
cohort_start_date date NOT NULL,
|
||||
cohort_end_date date NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
||||
cohort_definition_id integer NOT NULL,
|
||||
|
@ -510,11 +548,3 @@ CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
|||
cohort_definition_syntax VARCHAR(1000) NULL,
|
||||
subject_concept_id integer NOT NULL,
|
||||
cohort_initiation_date date NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION (
|
||||
attribute_definition_id integer NOT NULL,
|
||||
attribute_name varchar(255) NOT NULL,
|
||||
attribute_description VARCHAR(1000) NULL,
|
||||
attribute_type_concept_id integer NOT NULL,
|
||||
attribute_syntax VARCHAR(1000) NULL );
|
|
@ -42,6 +42,10 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT xpk_DOSE_ERA PRIMARY KEY
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT xpk_CONDITION_ERA PRIMARY KEY (condition_era_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT xpk_EPISODE PRIMARY KEY (episode_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT xpk_METADATA PRIMARY KEY (metadata_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONCEPT ADD CONSTRAINT xpk_CONCEPT PRIMARY KEY (concept_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VOCABULARY ADD CONSTRAINT xpk_VOCABULARY PRIMARY KEY (vocabulary_id);
|
||||
|
|
|
@ -36,7 +36,7 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRE
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_preceding_visit_occurrence_id FOREIGN KEY (preceding_visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -54,11 +54,11 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visi
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_preceding_visit_detail_id FOREIGN KEY (preceding_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_detail_parent_id FOREIGN KEY (visit_detail_parent_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_parent_visit_detail_id FOREIGN KEY (parent_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_occurrence_id FOREIGN KEY (visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -136,6 +136,10 @@ ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_measurement_source_concept_id FOREIGN KEY (measurement_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_unit_source_concept_id FOREIGN KEY (unit_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_meas_event_field_concept_id FOREIGN KEY (meas_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_concept_id FOREIGN KEY (observation_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -156,6 +160,8 @@ ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_source_concept_id FOREIGN KEY (observation_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_obs_event_field_concept_id FOREIGN KEY (obs_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_death_type_concept_id FOREIGN KEY (death_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -166,6 +172,8 @@ ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_cause_source_conce
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_event_field_concept_id FOREIGN KEY (note_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_type_concept_id FOREIGN KEY (note_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_class_concept_id FOREIGN KEY (note_class_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -260,6 +268,20 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT fpk_DOSE_ERA_unit_concept
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT fpk_CONDITION_ERA_condition_concept_id FOREIGN KEY (condition_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_concept_id FOREIGN KEY (episode_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_object_concept_id FOREIGN KEY (episode_object_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_type_concept_id FOREIGN KEY (episode_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_source_concept_id FOREIGN KEY (episode_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_id FOREIGN KEY (episode_id) REFERENCES @cdmDatabaseSchema.EPISODE (EPISODE_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_event_field_concept_id FOREIGN KEY (episode_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_concept_id FOREIGN KEY (metadata_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_type_concept_id FOREIGN KEY (metadata_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -313,5 +335,3 @@ ALTER TABLE @cdmDatabaseSchema.DRUG_STRENGTH ADD CONSTRAINT fpk_DRUG_STRENGTH_de
|
|||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_definition_type_concept_id FOREIGN KEY (definition_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_subject_concept_id FOREIGN KEY (subject_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION ADD CONSTRAINT fpk_ATTRIBUTE_DEFINITION_attribute_type_concept_id FOREIGN KEY (attribute_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
|
|
@ -45,8 +45,8 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE (
|
|||
visit_source_concept_id integer NULL,
|
||||
admitted_from_concept_id integer NULL,
|
||||
admitted_from_source_value varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
discharge_to_source_value varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
discharged_to_source_value varchar(50) NULL,
|
||||
preceding_visit_occurrence_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -63,12 +63,12 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_DETAIL (
|
|||
care_site_id integer NULL,
|
||||
visit_detail_source_value varchar(50) NULL,
|
||||
visit_detail_source_concept_id Integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
admitted_from_concept_id Integer NULL,
|
||||
discharge_to_source_value Varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
discharged_to_source_value Varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
preceding_visit_detail_id integer NULL,
|
||||
visit_detail_parent_id integer NULL,
|
||||
parent_visit_detail_id integer NULL,
|
||||
visit_occurrence_id integer NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -178,7 +178,10 @@ CREATE TABLE @cdmDatabaseSchema.MEASUREMENT (
|
|||
measurement_source_value varchar(50) NULL,
|
||||
measurement_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL );
|
||||
unit_source_concept_id integer NULL,
|
||||
value_source_value varchar(50) NULL,
|
||||
measurement_event_id NUMBER(19) NULL,
|
||||
meas_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
||||
|
@ -200,7 +203,9 @@ CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
|||
observation_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
qualifier_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL );
|
||||
value_source_value varchar(50) NULL,
|
||||
observation_event_id NUMBER(19) NULL,
|
||||
obs_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.DEATH (
|
||||
|
@ -216,6 +221,8 @@ CREATE TABLE @cdmDatabaseSchema.DEATH (
|
|||
CREATE TABLE @cdmDatabaseSchema.NOTE (
|
||||
note_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
note_event_id NUMBER(19) NULL,
|
||||
note_event_field_concept_id integer NULL,
|
||||
note_date date NOT NULL,
|
||||
note_datetime TIMESTAMP NULL,
|
||||
note_type_concept_id integer NOT NULL,
|
||||
|
@ -386,13 +393,37 @@ CREATE TABLE @cdmDatabaseSchema.CONDITION_ERA (
|
|||
condition_era_end_date TIMESTAMP NOT NULL,
|
||||
condition_occurrence_count integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE (
|
||||
episode_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
episode_concept_id integer NOT NULL,
|
||||
episode_start_date date NOT NULL,
|
||||
episode_start_datetime TIMESTAMP NULL,
|
||||
episode_end_date date NULL,
|
||||
episode_end_datetime TIMESTAMP NULL,
|
||||
episode_parent_id integer NULL,
|
||||
episode_number integer NULL,
|
||||
episode_object_concept_id integer NOT NULL,
|
||||
episode_type_concept_id integer NOT NULL,
|
||||
episode_source_value varchar(50) NULL,
|
||||
episode_source_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE_EVENT (
|
||||
episode_id integer NOT NULL,
|
||||
event_id integer NOT NULL,
|
||||
episode_event_field_concept_id integer NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.METADATA (
|
||||
metadata_id integer NOT NULL,
|
||||
metadata_concept_id integer NOT NULL,
|
||||
metadata_type_concept_id integer NOT NULL,
|
||||
name varchar(250) NOT NULL,
|
||||
value_as_string varchar(250) NULL,
|
||||
value_as_concept_id integer NULL,
|
||||
value_as_number float NULL,
|
||||
metadata_date date NULL,
|
||||
metadata_datetime TIMESTAMP NULL );
|
||||
|
||||
|
@ -501,6 +532,13 @@ CREATE TABLE @cdmDatabaseSchema.DRUG_STRENGTH (
|
|||
valid_end_date date NOT NULL,
|
||||
invalid_reason varchar(1) NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT (
|
||||
cohort_definition_id integer NOT NULL,
|
||||
subject_id integer NOT NULL,
|
||||
cohort_start_date date NOT NULL,
|
||||
cohort_end_date date NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
||||
cohort_definition_id integer NOT NULL,
|
||||
|
@ -510,11 +548,3 @@ CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
|||
cohort_definition_syntax CLOB NULL,
|
||||
subject_concept_id integer NOT NULL,
|
||||
cohort_initiation_date date NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION (
|
||||
attribute_definition_id integer NOT NULL,
|
||||
attribute_name varchar(255) NOT NULL,
|
||||
attribute_description CLOB NULL,
|
||||
attribute_type_concept_id integer NOT NULL,
|
||||
attribute_syntax CLOB NULL );
|
|
@ -42,6 +42,10 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT xpk_DOSE_ERA PRIMARY KEY
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT xpk_CONDITION_ERA PRIMARY KEY (condition_era_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT xpk_EPISODE PRIMARY KEY (episode_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT xpk_METADATA PRIMARY KEY (metadata_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONCEPT ADD CONSTRAINT xpk_CONCEPT PRIMARY KEY (concept_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VOCABULARY ADD CONSTRAINT xpk_VOCABULARY PRIMARY KEY (vocabulary_id);
|
||||
|
|
|
@ -36,7 +36,7 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRE
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_preceding_visit_occurrence_id FOREIGN KEY (preceding_visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -54,11 +54,11 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visi
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_preceding_visit_detail_id FOREIGN KEY (preceding_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_detail_parent_id FOREIGN KEY (visit_detail_parent_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_parent_visit_detail_id FOREIGN KEY (parent_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_occurrence_id FOREIGN KEY (visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -136,6 +136,10 @@ ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_measurement_source_concept_id FOREIGN KEY (measurement_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_unit_source_concept_id FOREIGN KEY (unit_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_meas_event_field_concept_id FOREIGN KEY (meas_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_concept_id FOREIGN KEY (observation_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -156,6 +160,8 @@ ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_source_concept_id FOREIGN KEY (observation_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_obs_event_field_concept_id FOREIGN KEY (obs_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_death_type_concept_id FOREIGN KEY (death_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -166,6 +172,8 @@ ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_cause_source_conce
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_event_field_concept_id FOREIGN KEY (note_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_type_concept_id FOREIGN KEY (note_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_class_concept_id FOREIGN KEY (note_class_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -260,6 +268,20 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT fpk_DOSE_ERA_unit_concept
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT fpk_CONDITION_ERA_condition_concept_id FOREIGN KEY (condition_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_concept_id FOREIGN KEY (episode_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_object_concept_id FOREIGN KEY (episode_object_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_type_concept_id FOREIGN KEY (episode_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_source_concept_id FOREIGN KEY (episode_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_id FOREIGN KEY (episode_id) REFERENCES @cdmDatabaseSchema.EPISODE (EPISODE_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_event_field_concept_id FOREIGN KEY (episode_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_concept_id FOREIGN KEY (metadata_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_type_concept_id FOREIGN KEY (metadata_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -313,5 +335,3 @@ ALTER TABLE @cdmDatabaseSchema.DRUG_STRENGTH ADD CONSTRAINT fpk_DRUG_STRENGTH_de
|
|||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_definition_type_concept_id FOREIGN KEY (definition_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_subject_concept_id FOREIGN KEY (subject_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION ADD CONSTRAINT fpk_ATTRIBUTE_DEFINITION_attribute_type_concept_id FOREIGN KEY (attribute_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
|
|
@ -44,8 +44,8 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE (
|
|||
visit_source_concept_id integer NULL,
|
||||
admitted_from_concept_id integer NULL,
|
||||
admitted_from_source_value varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
discharge_to_source_value varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
discharged_to_source_value varchar(50) NULL,
|
||||
preceding_visit_occurrence_id integer NULL )
|
||||
WITH (DISTRIBUTION = HASH(person_id));
|
||||
|
||||
|
@ -62,12 +62,12 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.VISIT_DETAIL (visi
|
|||
care_site_id integer NULL,
|
||||
visit_detail_source_value varchar(50) NULL,
|
||||
visit_detail_source_concept_id Integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
admitted_from_concept_id Integer NULL,
|
||||
discharge_to_source_value Varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
discharged_to_source_value Varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
preceding_visit_detail_id integer NULL,
|
||||
visit_detail_parent_id integer NULL,
|
||||
parent_visit_detail_id integer NULL,
|
||||
visit_occurrence_id integer NOT NULL )
|
||||
WITH (DISTRIBUTION = HASH(person_id));
|
||||
|
||||
|
@ -177,7 +177,10 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.MEASUREMENT (measu
|
|||
measurement_source_value varchar(50) NULL,
|
||||
measurement_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL )
|
||||
unit_source_concept_id integer NULL,
|
||||
value_source_value varchar(50) NULL,
|
||||
measurement_event_id bigint NULL,
|
||||
meas_event_field_concept_id integer NULL )
|
||||
WITH (DISTRIBUTION = HASH(person_id));
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -199,7 +202,9 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.OBSERVATION (obser
|
|||
observation_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
qualifier_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL )
|
||||
value_source_value varchar(50) NULL,
|
||||
observation_event_id bigint NULL,
|
||||
obs_event_field_concept_id integer NULL )
|
||||
WITH (DISTRIBUTION = HASH(person_id));
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -215,6 +220,8 @@ WITH (DISTRIBUTION = HASH(person_id));
|
|||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.NOTE (note_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
note_event_id bigint NULL,
|
||||
note_event_field_concept_id integer NULL,
|
||||
note_date date NOT NULL,
|
||||
note_datetime datetime NULL,
|
||||
note_type_concept_id integer NOT NULL,
|
||||
|
@ -386,12 +393,36 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.CONDITION_ERA (con
|
|||
condition_occurrence_count integer NULL )
|
||||
WITH (DISTRIBUTION = HASH(person_id));
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.EPISODE (episode_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
episode_concept_id integer NOT NULL,
|
||||
episode_start_date date NOT NULL,
|
||||
episode_start_datetime datetime NULL,
|
||||
episode_end_date date NULL,
|
||||
episode_end_datetime datetime NULL,
|
||||
episode_parent_id integer NULL,
|
||||
episode_number integer NULL,
|
||||
episode_object_concept_id integer NOT NULL,
|
||||
episode_type_concept_id integer NOT NULL,
|
||||
episode_source_value varchar(50) NULL,
|
||||
episode_source_concept_id integer NULL )
|
||||
WITH (DISTRIBUTION = HASH(person_id));
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.METADATA (metadata_concept_id integer NOT NULL,
|
||||
IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.EPISODE_EVENT (episode_id integer NOT NULL,
|
||||
event_id integer NOT NULL,
|
||||
episode_event_field_concept_id integer NOT NULL )
|
||||
WITH (DISTRIBUTION = REPLICATE);
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.METADATA (metadata_id integer NOT NULL,
|
||||
metadata_concept_id integer NOT NULL,
|
||||
metadata_type_concept_id integer NOT NULL,
|
||||
name varchar(250) NOT NULL,
|
||||
value_as_string varchar(250) NULL,
|
||||
value_as_concept_id integer NULL,
|
||||
value_as_number float NULL,
|
||||
metadata_date date NULL,
|
||||
metadata_datetime datetime NULL )
|
||||
WITH (DISTRIBUTION = REPLICATE);
|
||||
|
@ -501,6 +532,13 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.DRUG_STRENGTH (dru
|
|||
invalid_reason varchar(1) NULL )
|
||||
WITH (DISTRIBUTION = REPLICATE);
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.COHORT (cohort_definition_id integer NOT NULL,
|
||||
subject_id integer NOT NULL,
|
||||
cohort_start_date date NOT NULL,
|
||||
cohort_end_date date NOT NULL )
|
||||
WITH (DISTRIBUTION = HASH(subject_id));
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (cohort_definition_id integer NOT NULL,
|
||||
cohort_definition_name varchar(255) NOT NULL,
|
||||
|
@ -510,11 +548,3 @@ IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION
|
|||
subject_concept_id integer NOT NULL,
|
||||
cohort_initiation_date date NULL )
|
||||
WITH (DISTRIBUTION = REPLICATE);
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
IF XACT_STATE() = 1 COMMIT; CREATE TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION (attribute_definition_id integer NOT NULL,
|
||||
attribute_name varchar(255) NOT NULL,
|
||||
attribute_description VARCHAR(1000) NULL,
|
||||
attribute_type_concept_id integer NOT NULL,
|
||||
attribute_syntax VARCHAR(1000) NULL )
|
||||
WITH (DISTRIBUTION = REPLICATE);
|
|
@ -42,6 +42,10 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT xpk_DOSE_ERA PRIMARY KEY
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT xpk_CONDITION_ERA PRIMARY KEY NONCLUSTERED (condition_era_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT xpk_EPISODE PRIMARY KEY NONCLUSTERED (episode_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT xpk_METADATA PRIMARY KEY NONCLUSTERED (metadata_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONCEPT ADD CONSTRAINT xpk_CONCEPT PRIMARY KEY NONCLUSTERED (concept_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VOCABULARY ADD CONSTRAINT xpk_VOCABULARY PRIMARY KEY NONCLUSTERED (vocabulary_id);
|
||||
|
|
|
@ -36,7 +36,7 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRE
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_preceding_visit_occurrence_id FOREIGN KEY (preceding_visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -54,11 +54,11 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visi
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_preceding_visit_detail_id FOREIGN KEY (preceding_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_detail_parent_id FOREIGN KEY (visit_detail_parent_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_parent_visit_detail_id FOREIGN KEY (parent_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_occurrence_id FOREIGN KEY (visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -136,6 +136,10 @@ ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_measurement_source_concept_id FOREIGN KEY (measurement_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_unit_source_concept_id FOREIGN KEY (unit_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_meas_event_field_concept_id FOREIGN KEY (meas_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_concept_id FOREIGN KEY (observation_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -156,6 +160,8 @@ ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_source_concept_id FOREIGN KEY (observation_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_obs_event_field_concept_id FOREIGN KEY (obs_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_death_type_concept_id FOREIGN KEY (death_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -166,6 +172,8 @@ ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_cause_source_conce
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_event_field_concept_id FOREIGN KEY (note_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_type_concept_id FOREIGN KEY (note_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_class_concept_id FOREIGN KEY (note_class_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -260,6 +268,20 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT fpk_DOSE_ERA_unit_concept
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT fpk_CONDITION_ERA_condition_concept_id FOREIGN KEY (condition_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_concept_id FOREIGN KEY (episode_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_object_concept_id FOREIGN KEY (episode_object_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_type_concept_id FOREIGN KEY (episode_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_source_concept_id FOREIGN KEY (episode_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_id FOREIGN KEY (episode_id) REFERENCES @cdmDatabaseSchema.EPISODE (EPISODE_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_event_field_concept_id FOREIGN KEY (episode_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_concept_id FOREIGN KEY (metadata_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_type_concept_id FOREIGN KEY (metadata_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -313,5 +335,3 @@ ALTER TABLE @cdmDatabaseSchema.DRUG_STRENGTH ADD CONSTRAINT fpk_DRUG_STRENGTH_de
|
|||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_definition_type_concept_id FOREIGN KEY (definition_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_subject_concept_id FOREIGN KEY (subject_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION ADD CONSTRAINT fpk_ATTRIBUTE_DEFINITION_attribute_type_concept_id FOREIGN KEY (attribute_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
|
|
@ -45,8 +45,8 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE (
|
|||
visit_source_concept_id integer NULL,
|
||||
admitted_from_concept_id integer NULL,
|
||||
admitted_from_source_value varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
discharge_to_source_value varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
discharged_to_source_value varchar(50) NULL,
|
||||
preceding_visit_occurrence_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -63,12 +63,12 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_DETAIL (
|
|||
care_site_id integer NULL,
|
||||
visit_detail_source_value varchar(50) NULL,
|
||||
visit_detail_source_concept_id Integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
admitted_from_concept_id Integer NULL,
|
||||
discharge_to_source_value Varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
discharged_to_source_value Varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
preceding_visit_detail_id integer NULL,
|
||||
visit_detail_parent_id integer NULL,
|
||||
parent_visit_detail_id integer NULL,
|
||||
visit_occurrence_id integer NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -178,7 +178,10 @@ CREATE TABLE @cdmDatabaseSchema.MEASUREMENT (
|
|||
measurement_source_value varchar(50) NULL,
|
||||
measurement_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL );
|
||||
unit_source_concept_id integer NULL,
|
||||
value_source_value varchar(50) NULL,
|
||||
measurement_event_id bigint NULL,
|
||||
meas_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
||||
|
@ -200,7 +203,9 @@ CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
|||
observation_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
qualifier_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL );
|
||||
value_source_value varchar(50) NULL,
|
||||
observation_event_id bigint NULL,
|
||||
obs_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.DEATH (
|
||||
|
@ -216,6 +221,8 @@ CREATE TABLE @cdmDatabaseSchema.DEATH (
|
|||
CREATE TABLE @cdmDatabaseSchema.NOTE (
|
||||
note_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
note_event_id bigint NULL,
|
||||
note_event_field_concept_id integer NULL,
|
||||
note_date date NOT NULL,
|
||||
note_datetime TIMESTAMP NULL,
|
||||
note_type_concept_id integer NOT NULL,
|
||||
|
@ -386,13 +393,37 @@ CREATE TABLE @cdmDatabaseSchema.CONDITION_ERA (
|
|||
condition_era_end_date TIMESTAMP NOT NULL,
|
||||
condition_occurrence_count integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE (
|
||||
episode_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
episode_concept_id integer NOT NULL,
|
||||
episode_start_date date NOT NULL,
|
||||
episode_start_datetime TIMESTAMP NULL,
|
||||
episode_end_date date NULL,
|
||||
episode_end_datetime TIMESTAMP NULL,
|
||||
episode_parent_id integer NULL,
|
||||
episode_number integer NULL,
|
||||
episode_object_concept_id integer NOT NULL,
|
||||
episode_type_concept_id integer NOT NULL,
|
||||
episode_source_value varchar(50) NULL,
|
||||
episode_source_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE_EVENT (
|
||||
episode_id integer NOT NULL,
|
||||
event_id integer NOT NULL,
|
||||
episode_event_field_concept_id integer NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.METADATA (
|
||||
metadata_id integer NOT NULL,
|
||||
metadata_concept_id integer NOT NULL,
|
||||
metadata_type_concept_id integer NOT NULL,
|
||||
name varchar(250) NOT NULL,
|
||||
value_as_string varchar(250) NULL,
|
||||
value_as_concept_id integer NULL,
|
||||
value_as_number NUMERIC NULL,
|
||||
metadata_date date NULL,
|
||||
metadata_datetime TIMESTAMP NULL );
|
||||
|
||||
|
@ -501,6 +532,13 @@ CREATE TABLE @cdmDatabaseSchema.DRUG_STRENGTH (
|
|||
valid_end_date date NOT NULL,
|
||||
invalid_reason varchar(1) NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT (
|
||||
cohort_definition_id integer NOT NULL,
|
||||
subject_id integer NOT NULL,
|
||||
cohort_start_date date NOT NULL,
|
||||
cohort_end_date date NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
||||
cohort_definition_id integer NOT NULL,
|
||||
|
@ -510,11 +548,3 @@ CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
|||
cohort_definition_syntax TEXT NULL,
|
||||
subject_concept_id integer NOT NULL,
|
||||
cohort_initiation_date date NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION (
|
||||
attribute_definition_id integer NOT NULL,
|
||||
attribute_name varchar(255) NOT NULL,
|
||||
attribute_description TEXT NULL,
|
||||
attribute_type_concept_id integer NOT NULL,
|
||||
attribute_syntax TEXT NULL );
|
|
@ -42,6 +42,10 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT xpk_DOSE_ERA PRIMARY KEY
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT xpk_CONDITION_ERA PRIMARY KEY (condition_era_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT xpk_EPISODE PRIMARY KEY (episode_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT xpk_METADATA PRIMARY KEY (metadata_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONCEPT ADD CONSTRAINT xpk_CONCEPT PRIMARY KEY (concept_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VOCABULARY ADD CONSTRAINT xpk_VOCABULARY PRIMARY KEY (vocabulary_id);
|
||||
|
|
|
@ -36,7 +36,7 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRE
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_preceding_visit_occurrence_id FOREIGN KEY (preceding_visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -54,11 +54,11 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visi
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_preceding_visit_detail_id FOREIGN KEY (preceding_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_detail_parent_id FOREIGN KEY (visit_detail_parent_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_parent_visit_detail_id FOREIGN KEY (parent_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_occurrence_id FOREIGN KEY (visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -136,6 +136,10 @@ ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_measurement_source_concept_id FOREIGN KEY (measurement_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_unit_source_concept_id FOREIGN KEY (unit_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_meas_event_field_concept_id FOREIGN KEY (meas_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_concept_id FOREIGN KEY (observation_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -156,6 +160,8 @@ ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_source_concept_id FOREIGN KEY (observation_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_obs_event_field_concept_id FOREIGN KEY (obs_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_death_type_concept_id FOREIGN KEY (death_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -166,6 +172,8 @@ ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_cause_source_conce
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_event_field_concept_id FOREIGN KEY (note_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_type_concept_id FOREIGN KEY (note_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_class_concept_id FOREIGN KEY (note_class_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -260,6 +268,20 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT fpk_DOSE_ERA_unit_concept
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT fpk_CONDITION_ERA_condition_concept_id FOREIGN KEY (condition_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_concept_id FOREIGN KEY (episode_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_object_concept_id FOREIGN KEY (episode_object_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_type_concept_id FOREIGN KEY (episode_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_source_concept_id FOREIGN KEY (episode_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_id FOREIGN KEY (episode_id) REFERENCES @cdmDatabaseSchema.EPISODE (EPISODE_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_event_field_concept_id FOREIGN KEY (episode_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_concept_id FOREIGN KEY (metadata_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_type_concept_id FOREIGN KEY (metadata_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -313,5 +335,3 @@ ALTER TABLE @cdmDatabaseSchema.DRUG_STRENGTH ADD CONSTRAINT fpk_DRUG_STRENGTH_de
|
|||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_definition_type_concept_id FOREIGN KEY (definition_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_subject_concept_id FOREIGN KEY (subject_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION ADD CONSTRAINT fpk_ATTRIBUTE_DEFINITION_attribute_type_concept_id FOREIGN KEY (attribute_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
|
|
@ -44,8 +44,8 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE (visit_occurrence_id integer N
|
|||
visit_source_concept_id integer NULL,
|
||||
admitted_from_concept_id integer NULL,
|
||||
admitted_from_source_value varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
discharge_to_source_value varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
discharged_to_source_value varchar(50) NULL,
|
||||
preceding_visit_occurrence_id integer NULL )
|
||||
DISTKEY(person_id);
|
||||
|
||||
|
@ -62,12 +62,12 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_DETAIL (visit_detail_id integer NOT NULL,
|
|||
care_site_id integer NULL,
|
||||
visit_detail_source_value varchar(50) NULL,
|
||||
visit_detail_source_concept_id Integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
admitted_from_concept_id Integer NULL,
|
||||
discharge_to_source_value Varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
discharged_to_source_value Varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
preceding_visit_detail_id integer NULL,
|
||||
visit_detail_parent_id integer NULL,
|
||||
parent_visit_detail_id integer NULL,
|
||||
visit_occurrence_id integer NOT NULL )
|
||||
DISTKEY(person_id);
|
||||
|
||||
|
@ -177,7 +177,10 @@ CREATE TABLE @cdmDatabaseSchema.MEASUREMENT (measurement_id integer NOT NULL,
|
|||
measurement_source_value varchar(50) NULL,
|
||||
measurement_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL )
|
||||
unit_source_concept_id integer NULL,
|
||||
value_source_value varchar(50) NULL,
|
||||
measurement_event_id bigint NULL,
|
||||
meas_event_field_concept_id integer NULL )
|
||||
DISTKEY(person_id);
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -199,7 +202,9 @@ CREATE TABLE @cdmDatabaseSchema.OBSERVATION (observation_id integer NOT NULL,
|
|||
observation_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
qualifier_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL )
|
||||
value_source_value varchar(50) NULL,
|
||||
observation_event_id bigint NULL,
|
||||
obs_event_field_concept_id integer NULL )
|
||||
DISTKEY(person_id);
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -215,6 +220,8 @@ DISTKEY(person_id);
|
|||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.NOTE (note_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
note_event_id bigint NULL,
|
||||
note_event_field_concept_id integer NULL,
|
||||
note_date date NOT NULL,
|
||||
note_datetime TIMESTAMP NULL,
|
||||
note_type_concept_id integer NOT NULL,
|
||||
|
@ -386,12 +393,36 @@ CREATE TABLE @cdmDatabaseSchema.CONDITION_ERA (condition_era_id integer NOT NUL
|
|||
condition_occurrence_count integer NULL )
|
||||
DISTKEY(person_id);
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE (episode_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
episode_concept_id integer NOT NULL,
|
||||
episode_start_date date NOT NULL,
|
||||
episode_start_datetime TIMESTAMP NULL,
|
||||
episode_end_date date NULL,
|
||||
episode_end_datetime TIMESTAMP NULL,
|
||||
episode_parent_id integer NULL,
|
||||
episode_number integer NULL,
|
||||
episode_object_concept_id integer NOT NULL,
|
||||
episode_type_concept_id integer NOT NULL,
|
||||
episode_source_value varchar(50) NULL,
|
||||
episode_source_concept_id integer NULL )
|
||||
DISTKEY(person_id);
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.METADATA (metadata_concept_id integer NOT NULL,
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE_EVENT (episode_id integer NOT NULL,
|
||||
event_id integer NOT NULL,
|
||||
episode_event_field_concept_id integer NOT NULL )
|
||||
DISTSTYLE ALL;
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.METADATA (metadata_id integer NOT NULL,
|
||||
metadata_concept_id integer NOT NULL,
|
||||
metadata_type_concept_id integer NOT NULL,
|
||||
name varchar(250) NOT NULL,
|
||||
value_as_string varchar(250) NULL,
|
||||
value_as_concept_id integer NULL,
|
||||
value_as_number float NULL,
|
||||
metadata_date date NULL,
|
||||
metadata_datetime TIMESTAMP NULL )
|
||||
DISTSTYLE ALL;
|
||||
|
@ -501,6 +532,13 @@ CREATE TABLE @cdmDatabaseSchema.DRUG_STRENGTH (drug_concept_id integer NOT NULL
|
|||
invalid_reason varchar(1) NULL )
|
||||
DISTSTYLE ALL;
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT (cohort_definition_id integer NOT NULL,
|
||||
subject_id integer NOT NULL,
|
||||
cohort_start_date date NOT NULL,
|
||||
cohort_end_date date NOT NULL )
|
||||
DISTKEY(subject_id);
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (cohort_definition_id integer NOT NULL,
|
||||
cohort_definition_name varchar(255) NOT NULL,
|
||||
|
@ -510,11 +548,3 @@ CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (cohort_definition_id integer
|
|||
subject_concept_id integer NOT NULL,
|
||||
cohort_initiation_date date NULL )
|
||||
DISTSTYLE ALL;
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.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 )
|
||||
DISTSTYLE ALL;
|
|
@ -42,6 +42,10 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT xpk_DOSE_ERA PRIMARY KEY
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT xpk_CONDITION_ERA PRIMARY KEY (condition_era_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT xpk_EPISODE PRIMARY KEY (episode_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT xpk_METADATA PRIMARY KEY (metadata_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONCEPT ADD CONSTRAINT xpk_CONCEPT PRIMARY KEY (concept_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VOCABULARY ADD CONSTRAINT xpk_VOCABULARY PRIMARY KEY (vocabulary_id);
|
||||
|
|
|
@ -36,7 +36,7 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRE
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE ADD CONSTRAINT fpk_VISIT_OCCURRENCE_preceding_visit_occurrence_id FOREIGN KEY (preceding_visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -54,11 +54,11 @@ ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visi
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_admitted_from_concept_id FOREIGN KEY (admitted_from_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharge_to_concept_id FOREIGN KEY (discharge_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_discharged_to_concept_id FOREIGN KEY (discharged_to_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_preceding_visit_detail_id FOREIGN KEY (preceding_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_detail_parent_id FOREIGN KEY (visit_detail_parent_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_parent_visit_detail_id FOREIGN KEY (parent_visit_detail_id) REFERENCES @cdmDatabaseSchema.VISIT_DETAIL (VISIT_DETAIL_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VISIT_DETAIL ADD CONSTRAINT fpk_VISIT_DETAIL_visit_occurrence_id FOREIGN KEY (visit_occurrence_id) REFERENCES @cdmDatabaseSchema.VISIT_OCCURRENCE (VISIT_OCCURRENCE_ID);
|
||||
|
||||
|
@ -136,6 +136,10 @@ ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_measurement_source_concept_id FOREIGN KEY (measurement_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_unit_source_concept_id FOREIGN KEY (unit_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.MEASUREMENT ADD CONSTRAINT fpk_MEASUREMENT_meas_event_field_concept_id FOREIGN KEY (meas_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_concept_id FOREIGN KEY (observation_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -156,6 +160,8 @@ ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_visit_
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_observation_source_concept_id FOREIGN KEY (observation_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.OBSERVATION ADD CONSTRAINT fpk_OBSERVATION_obs_event_field_concept_id FOREIGN KEY (obs_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_death_type_concept_id FOREIGN KEY (death_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -166,6 +172,8 @@ ALTER TABLE @cdmDatabaseSchema.DEATH ADD CONSTRAINT fpk_DEATH_cause_source_conce
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_event_field_concept_id FOREIGN KEY (note_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_type_concept_id FOREIGN KEY (note_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.NOTE ADD CONSTRAINT fpk_NOTE_note_class_concept_id FOREIGN KEY (note_class_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -260,6 +268,20 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT fpk_DOSE_ERA_unit_concept
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT fpk_CONDITION_ERA_condition_concept_id FOREIGN KEY (condition_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_person_id FOREIGN KEY (person_id) REFERENCES @cdmDatabaseSchema.PERSON (PERSON_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_concept_id FOREIGN KEY (episode_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_object_concept_id FOREIGN KEY (episode_object_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_type_concept_id FOREIGN KEY (episode_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT fpk_EPISODE_episode_source_concept_id FOREIGN KEY (episode_source_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_id FOREIGN KEY (episode_id) REFERENCES @cdmDatabaseSchema.EPISODE (EPISODE_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE_EVENT ADD CONSTRAINT fpk_EPISODE_EVENT_episode_event_field_concept_id FOREIGN KEY (episode_event_field_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_concept_id FOREIGN KEY (metadata_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT fpk_METADATA_metadata_type_concept_id FOREIGN KEY (metadata_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
@ -313,5 +335,3 @@ ALTER TABLE @cdmDatabaseSchema.DRUG_STRENGTH ADD CONSTRAINT fpk_DRUG_STRENGTH_de
|
|||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_definition_type_concept_id FOREIGN KEY (definition_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.COHORT_DEFINITION ADD CONSTRAINT fpk_COHORT_DEFINITION_subject_concept_id FOREIGN KEY (subject_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.ATTRIBUTE_DEFINITION ADD CONSTRAINT fpk_ATTRIBUTE_DEFINITION_attribute_type_concept_id FOREIGN KEY (attribute_type_concept_id) REFERENCES @cdmDatabaseSchema.CONCEPT (CONCEPT_ID);
|
||||
|
|
|
@ -45,8 +45,8 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_OCCURRENCE (
|
|||
visit_source_concept_id integer NULL,
|
||||
admitted_from_concept_id integer NULL,
|
||||
admitted_from_source_value varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
discharge_to_source_value varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
discharged_to_source_value varchar(50) NULL,
|
||||
preceding_visit_occurrence_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -63,12 +63,12 @@ CREATE TABLE @cdmDatabaseSchema.VISIT_DETAIL (
|
|||
care_site_id integer NULL,
|
||||
visit_detail_source_value varchar(50) NULL,
|
||||
visit_detail_source_concept_id Integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
admitted_from_concept_id Integer NULL,
|
||||
discharge_to_source_value Varchar(50) NULL,
|
||||
discharge_to_concept_id integer NULL,
|
||||
admitted_from_source_value Varchar(50) NULL,
|
||||
discharged_to_source_value Varchar(50) NULL,
|
||||
discharged_to_concept_id integer NULL,
|
||||
preceding_visit_detail_id integer NULL,
|
||||
visit_detail_parent_id integer NULL,
|
||||
parent_visit_detail_id integer NULL,
|
||||
visit_occurrence_id integer NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
|
@ -178,7 +178,10 @@ CREATE TABLE @cdmDatabaseSchema.MEASUREMENT (
|
|||
measurement_source_value varchar(50) NULL,
|
||||
measurement_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL );
|
||||
unit_source_concept_id integer NULL,
|
||||
value_source_value varchar(50) NULL,
|
||||
measurement_event_id bigint NULL,
|
||||
meas_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
||||
|
@ -200,7 +203,9 @@ CREATE TABLE @cdmDatabaseSchema.OBSERVATION (
|
|||
observation_source_concept_id integer NULL,
|
||||
unit_source_value varchar(50) NULL,
|
||||
qualifier_source_value varchar(50) NULL,
|
||||
value_source_value varchar(50) NULL );
|
||||
value_source_value varchar(50) NULL,
|
||||
observation_event_id bigint NULL,
|
||||
obs_event_field_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.DEATH (
|
||||
|
@ -216,6 +221,8 @@ CREATE TABLE @cdmDatabaseSchema.DEATH (
|
|||
CREATE TABLE @cdmDatabaseSchema.NOTE (
|
||||
note_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
note_event_id bigint NULL,
|
||||
note_event_field_concept_id integer NULL,
|
||||
note_date date NOT NULL,
|
||||
note_datetime datetime NULL,
|
||||
note_type_concept_id integer NOT NULL,
|
||||
|
@ -386,13 +393,37 @@ CREATE TABLE @cdmDatabaseSchema.CONDITION_ERA (
|
|||
condition_era_end_date datetime NOT NULL,
|
||||
condition_occurrence_count integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON KEY (person_id)
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE (
|
||||
episode_id integer NOT NULL,
|
||||
person_id integer NOT NULL,
|
||||
episode_concept_id integer NOT NULL,
|
||||
episode_start_date date NOT NULL,
|
||||
episode_start_datetime datetime NULL,
|
||||
episode_end_date date NULL,
|
||||
episode_end_datetime datetime NULL,
|
||||
episode_parent_id integer NULL,
|
||||
episode_number integer NULL,
|
||||
episode_object_concept_id integer NOT NULL,
|
||||
episode_type_concept_id integer NOT NULL,
|
||||
episode_source_value varchar(50) NULL,
|
||||
episode_source_concept_id integer NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.EPISODE_EVENT (
|
||||
episode_id integer NOT NULL,
|
||||
event_id integer NOT NULL,
|
||||
episode_event_field_concept_id integer NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.METADATA (
|
||||
metadata_id integer NOT NULL,
|
||||
metadata_concept_id integer NOT NULL,
|
||||
metadata_type_concept_id integer NOT NULL,
|
||||
name varchar(250) NOT NULL,
|
||||
value_as_string varchar(250) NULL,
|
||||
value_as_concept_id integer NULL,
|
||||
value_as_number float NULL,
|
||||
metadata_date date NULL,
|
||||
metadata_datetime datetime NULL );
|
||||
|
||||
|
@ -501,6 +532,13 @@ CREATE TABLE @cdmDatabaseSchema.DRUG_STRENGTH (
|
|||
valid_end_date date NOT NULL,
|
||||
invalid_reason varchar(1) NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT (
|
||||
cohort_definition_id integer NOT NULL,
|
||||
subject_id integer NOT NULL,
|
||||
cohort_start_date date NOT NULL,
|
||||
cohort_end_date date NOT NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
||||
cohort_definition_id integer NOT NULL,
|
||||
|
@ -510,11 +548,3 @@ CREATE TABLE @cdmDatabaseSchema.COHORT_DEFINITION (
|
|||
cohort_definition_syntax varchar(MAX) NULL,
|
||||
subject_concept_id integer NOT NULL,
|
||||
cohort_initiation_date date NULL );
|
||||
|
||||
--HINT DISTRIBUTE ON RANDOM
|
||||
CREATE TABLE @cdmDatabaseSchema.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 );
|
|
@ -42,6 +42,10 @@ ALTER TABLE @cdmDatabaseSchema.DOSE_ERA ADD CONSTRAINT xpk_DOSE_ERA PRIMARY KEY
|
|||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONDITION_ERA ADD CONSTRAINT xpk_CONDITION_ERA PRIMARY KEY NONCLUSTERED (condition_era_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.EPISODE ADD CONSTRAINT xpk_EPISODE PRIMARY KEY NONCLUSTERED (episode_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.METADATA ADD CONSTRAINT xpk_METADATA PRIMARY KEY NONCLUSTERED (metadata_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.CONCEPT ADD CONSTRAINT xpk_CONCEPT PRIMARY KEY NONCLUSTERED (concept_id);
|
||||
|
||||
ALTER TABLE @cdmDatabaseSchema.VOCABULARY ADD CONSTRAINT xpk_VOCABULARY PRIMARY KEY NONCLUSTERED (vocabulary_id);
|
||||
|
|
|
@ -167,6 +167,8 @@ MEASUREMENT,measurement_source_concept_id,No,integer,"This is the concept repres
|
|||
MEASUREMENT,unit_source_value,No,varchar(50),This field houses the verbatim value from the source data representing the unit of the Measurement that occurred. ,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,No,,,,,
|
||||
MEASUREMENT,unit_source_concept_id,No,integer,"""This is the concept representing the UNIT_SOURCE_VALUE and may not necessarily be standard. This field is discouraged from use in analysis because it is not required to contain Standard Concepts that are used across the OHDSI community, and should only be used when Standard Concepts do not adequately represent the source detail for the Measurement necessary for a given analytic use case. Consider using UNIT_CONCEPT_ID instead to enable standardized analytics that can be consistent across the network.""",If the UNIT_SOURCE_VALUE is coded in the source data using an OMOP supported vocabulary put the concept id representing the source value here.,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
MEASUREMENT,value_source_value,No,varchar(50),This field houses the verbatim result value of the Measurement from the source data . ,"If both a continuous and categorical result are given in the source data such that both VALUE_AS_NUMBER and VALUE_AS_CONCEPT_ID are both included, store the verbatim value that was mapped to VALUE_AS_CONCEPT_ID here.",No,No,,,,,
|
||||
MEASUREMENT,measurement_event_id,No,bigint,"If the Measurement record is related to another record in the database, this field is the primary key of the linked record. ","Put the primary key of the linked record, if applicable, here. ",No,No,,,,,
|
||||
MEASUREMENT,meas_event_field_concept_id,No,integer,"If the Measurement record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ",Put the CONCEPT_ID that identifies which table and field the MEASUREMENT_EVENT_ID came from.,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
OBSERVATION,observation_id,Yes,integer,The unique key given to an Observation record for a Person. Refer to the ETL for how duplicate Observations during the same Visit were handled.,Each instance of an observation present in the source data should be assigned this unique key. ,Yes,No,,,,,
|
||||
OBSERVATION,person_id,Yes,integer,The PERSON_ID of the Person for whom the Observation is recorded. This may be a system generated code.,,No,Yes,PERSON,PERSON_ID,,,
|
||||
OBSERVATION,observation_concept_id,Yes,integer,"The OBSERVATION_CONCEPT_ID field is recommended for primary use in analyses, and must be used for network studies.","The CONCEPT_ID that the OBSERVATION_SOURCE_CONCEPT_ID maps to. There is no specified domain that the Concepts in this table must adhere to. The only rule is that records with Concepts in the Condition, Procedure, Drug, Measurement, or Device domains MUST go to the corresponding table. ",No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
|
@ -186,6 +188,8 @@ OBSERVATION,observation_source_concept_id,No,integer,"This is the concept repres
|
|||
OBSERVATION,unit_source_value,No,varchar(50),This field houses the verbatim value from the source data representing the unit of the Observation that occurred. ,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,No,,,,,
|
||||
OBSERVATION,qualifier_source_value,No,varchar(50),This field houses the verbatim value from the source data representing the qualifier of the Observation that occurred. ,This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,No,No,,,,,
|
||||
OBSERVATION,value_source_value,No,varchar(50),This field houses the verbatim result value of the Observation from the source data. Do not get confused with the Observation_source_value which captures source value of the observation mapped to observation_concept_id. This field is the observation result value from the source.," If the observation_source_value was a question, for example, or an observation that requires a result then this field is the answer/ result from the source data. Store the verbatim value that represents the result of the observation_source_value. ",No,No,,,,,
|
||||
OBSERVATION,observation_event_id,No,bigint,"If the Observation record is related to another record in the database, this field is the primary key of the linked record. ","Put the primary key of the linked record, if applicable, here. See the [ETL Conventions for the OBSERVATION](https://ohdsi.github.io/CommonDataModel/cdm60.html#observation) table for more details.",No,No,,,,,
|
||||
OBSERVATION,obs_event_field_concept_id,No,integer,"If the Observation record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ",Put the CONCEPT_ID that identifies which table and field the OBSERVATION_EVENT_ID came from.,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
DEATH,person_id,Yes,integer,,,No,Yes,PERSON,PERSON_ID,,,
|
||||
DEATH,death_date,Yes,date,The date the person was deceased.,"If the precise date include day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",No,No,,,,,
|
||||
DEATH,death_datetime,No,datetime,,If not available set time to midnight (00:00:00),No,No,,,,,
|
||||
|
@ -195,6 +199,8 @@ DEATH,cause_source_value,No,varchar(50),,"If available, put the source code repr
|
|||
DEATH,cause_source_concept_id,No,integer,,If the cause of death was coded using a Vocabulary present in the OMOP Vocabularies put the CONCEPT_ID representing the cause of death here.,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
NOTE,note_id,Yes,integer,A unique identifier for each note.,,Yes,No,,,,,
|
||||
NOTE,person_id,Yes,integer,,,No,Yes,PERSON,PERSON_ID,,,
|
||||
NOTE,note_event_id,No,bigint,"If the Note record is related to another record in the database, this field is the primary key of the linked record. ","Put the primary key of the linked record, if applicable, here.",No,No,,,,,
|
||||
NOTE,note_event_field_concept_id,No,integer,"If the Note record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ",Put the CONCEPT_ID that identifies which table and field the NOTE_EVENT_ID came from.,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
NOTE,note_date,Yes,date,The date the note was recorded.,,No,No,,,,,
|
||||
NOTE,note_datetime,No,datetime,,If time is not given set the time to midnight.,No,No,,,,,
|
||||
NOTE,note_type_concept_id,Yes,integer,The provenance of the note. Most likely this will be EHR. ,"Put the source system of the note, as in EHR record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?standardConcept=Standard&domain=Type+Concept&page=1&pageSize=15&query=).",No,Yes,CONCEPT,CONCEPT_ID,Type Concept,,
|
||||
|
@ -260,7 +266,7 @@ LOCATION,location_id,Yes,integer,The unique key given to a unique Location.,Each
|
|||
LOCATION,address_1,No,varchar(50),This is the first line of the address.,,No,No,,,,,
|
||||
LOCATION,address_2,No,varchar(50),This is the second line of the address,,No,No,,,,,
|
||||
LOCATION,city,No,varchar(50),,,No,No,,,,,
|
||||
LOCATION,state,No,varchar(2),,,No,No,,,,,
|
||||
LOCATION,state,No,varchar(2),Please see the user guide for the location table for clarification on what this field represents in locations outside of the US.,,No,No,,,,,
|
||||
LOCATION,zip,No,varchar(9),,"Zip codes are handled as strings of up to 9 characters length. For US addresses, these represent either a 3-digit abbreviated Zip code as provided by many sources for patient protection reasons, the full 5-digit Zip or the 9-digit (ZIP + 4) codes. Unless for specific reasons analytical methods should expect and utilize only the first 3 digits. For international addresses, different rules apply.",No,No,,,,,
|
||||
LOCATION,county,No,varchar(20),,,No,No,,,,,
|
||||
LOCATION,location_source_value,No,varchar(50),,"Put the verbatim value for the location here, as it shows up in the source. ",No,No,,,,,
|
||||
|
@ -361,6 +367,22 @@ Condition.",,No,No,,,,,
|
|||
CONDITION_ERA,condition_occurrence_count,No,integer,"The number of individual Condition
|
||||
Occurrences used to construct the
|
||||
condition era.",,No,No,,,,,
|
||||
EPISODE,episode_id,Yes,integer,A unique identifier for each Episode.,,Yes,No,,,,,
|
||||
EPISODE,person_id,Yes,integer,The PERSON_ID of the PERSON for whom the episode is recorded.,,No,Yes,PERSON,PERSON_ID,,,
|
||||
EPISODE,episode_concept_id,Yes,integer,"The EPISODE_CONCEPT_ID represents the kind abstraction related to the disease phase, outcome or treatment.","Choose a concept in the Episode domain that best represents the ongoing disease phase, outcome, or treatment. Please see [article] for cancers and [article] for non-cancers describing how these are defined. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Episode&page=1&pageSize=15&query=)",No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
EPISODE,episode_start_date,Yes,date,The date when the Episode beings. ,Please see [article] for how to define an Episode start date.,No,No,,,,,
|
||||
EPISODE,episode_start_datetime,No,datetime,The date and time when the Episode begins.,,No,No,,,,,
|
||||
EPISODE,episode_end_date,No,date,The date when the instance of the Episode is considered to have ended.,Please see [article] for how to define an Episode end date.,,,,,,,
|
||||
EPISODE,episode_end_datetime,No,datetime,The date when the instance of the Episode is considered to have ended.,,No,No,,,,,
|
||||
EPISODE,episode_parent_id,No,integer,Use this field to find the Episode that subsumes the given Episode record. This is used in the case that an Episode are nested into each other.,"If there are multiple nested levels to how Episodes are represented, the EPISODE_PARENT_ID can be used to record this relationship. ",No,No,,,,,
|
||||
EPISODE,episode_number,No,integer,"For sequences of episodes, this is used to indicate the order the episodes occurred. For example, lines of treatment could be indicated here. ",Please see [article] for the details of how to count episodes.,No,No,,,,,
|
||||
EPISODE,episode_object_concept_id,Yes,integer,"A Standard Concept representing the disease phase, outcome, or other abstraction of which the episode consists. For example, if the EPISODE_CONCEPT_ID is [treatment regimen](https://athena.ohdsi.org/search-terms/terms/32531) then the EPISODE_OBJECT_CONCEPT_ID should contain the chemotherapy regimen concept, like [Afatinib monotherapy](https://athena.ohdsi.org/search-terms/terms/35804392). ",Episode entries from the 'Disease Episode' concept class should have an episode_object_concept_id that comes from the Condition domain. Episode entries from the 'Treatment Episode' concept class should have an episode_object_concept_id that scome from the 'Procedure' domain or 'Regimen' concept class.,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
EPISODE,episode_type_concept_id,Yes,integer,"This field can be used to determine the provenance of the Episode record, as in whether the episode was from an EHR system, insurance claim, registry, or other sources.",Choose the EPISODE_TYPE_CONCEPT_ID that best represents the provenance of the record. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).,No,Yes,CONCEPT,CONCEPT_ID,Type Concept,,
|
||||
EPISODE,episode_source_value,No,varchar(50),The source code for the Episdoe as it appears in the source data. This code is mapped to a Standard Condition Concept in the Standardized Vocabularies and the original code is stored here for reference.,,No,No,,,,,
|
||||
EPISODE,episode_source_concept_id,No,integer,A foreign key to a Episode Concept that refers to the code used in the source.,Given that the Episodes are user-defined it is unlikely that there will be a Source Concept available. If that is the case then set this field to zero. ,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
EPISODE_EVENT,episode_id,Yes,integer,Use this field to link the EPISODE_EVENT record to its EPISODE.,Put the EPISODE_ID that subsumes the EPISODE_EVENT record here.,No,Yes,EPISODE,EPISODE_ID,,,
|
||||
EPISODE_EVENT,event_id,Yes,integer,"This field is the primary key of the linked record in the database. For example, if the Episode Event is a Condition Occurrence, then the CONDITION_OCCURRENCE_ID of the linked record goes in this field. ",Put the primary key of the linked record here. ,No,No,,,,,
|
||||
EPISODE_EVENT,episode_event_field_concept_id,Yes,integer,This field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ,Put the CONCEPT_ID that identifies which table and field the EVENT_ID came from. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?vocabulary=CDM&conceptClass=Field&page=1&pageSize=15&query=),No,Yes,CONCEPT,CONCEPT_ID,Metadata,,
|
||||
METADATA,metadata_id,Yes,integer,The unique key given to a Metadata record.,Attribute value is auto-generated,Yes,No,,,,,
|
||||
METADATA,metadata_concept_id,Yes,integer,,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
METADATA,metadata_type_concept_id,Yes,integer,,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
|
|
|
|
@ -40,7 +40,7 @@ SPECIMEN,CDM,No,SPECIMEN_,Yes,0,,The specimen domain contains the records identi
|
|||
FACT_RELATIONSHIP,CDM,No,,No,,,"The FACT_RELATIONSHIP table contains records about the relationships between facts stored as records in any table of the CDM. Relationships can be defined between facts from the same domain, or different domains. Examples of Fact Relationships include: [Person relationships](https://athena.ohdsi.org/search-terms/terms?domain=Relationship&standardConcept=Standard&page=2&pageSize=15&query=) (parent-child), care site relationships (hierarchical organizational structure of facilities within a health system), indication relationship (between drug exposures and associated conditions), usage relationships (of devices during the course of an associated procedure), or facts derived from one another (measurements derived from an associated specimen).",,"All relationships are directional, and each relationship is represented twice symmetrically within the FACT_RELATIONSHIP table. For example, two persons if person_id = 1 is the mother of person_id = 2 two records are in the FACT_RELATIONSHIP table (all strings in fact concept_id records in the Concept table:
|
||||
- Person, 1, Person, 2, parent of
|
||||
- Person, 2, Person, 1, child of"
|
||||
LOCATION,CDM,No,,No,,,The LOCATION table represents a generic way to capture physical location or address information of Persons and Care Sites.,,"Each address or Location is unique and is present only once in the table. Locations do not contain names, such as the name of a hospital. In order to construct a full address that can be used in the postal service, the address information from the Location needs to be combined with information from the Care Site."
|
||||
LOCATION,CDM,No,,No,,,The LOCATION table represents a generic way to capture physical location or address information of Persons and Care Sites.,"The current iteration of the LOCATION table is US centric. Until a major release to correct this, certain fields can be used to represent different international values. <br><br> - STATE can also be used for province or district<br>- ZIP is also the postal code or postcode","Each address or Location is unique and is present only once in the table. Locations do not contain names, such as the name of a hospital. In order to construct a full address that can be used in the postal service, the address information from the Location needs to be combined with information from the Care Site."
|
||||
CARE_SITE,CDM,No,,No,,,"The CARE_SITE table contains a list of uniquely identified institutional (physical or organizational) units where healthcare delivery is practiced (offices, wards, hospitals, clinics, etc.).",,"Care site is a unique combination of location_id and place_of_service_source_value. Care site does not take into account the provider (human) information such a specialty. Many source data do not make a distinction between individual and institutional providers. The CARE_SITE table contains the institutional providers. If the source, instead of uniquely identifying individual Care Sites, only provides limited information such as Place of Service, generic or ""pooled"" Care Site records are listed in the CARE_SITE table. There can be hierarchical and business relationships between Care Sites. For example, wards can belong to clinics or departments, which can in turn belong to hospitals, which in turn can belong to hospital systems, which in turn can belong to HMOs.The relationships between Care Sites are defined in the FACT_RELATIONSHIP table."
|
||||
PROVIDER,CDM,No,,No,,,"The PROVIDER table contains a list of uniquely identified healthcare providers. These are individuals providing hands-on healthcare to patients, such as physicians, nurses, midwives, physical therapists etc.","Many sources do not make a distinction between individual and institutional providers. The PROVIDER table contains the individual providers. If the source, instead of uniquely identifying individual providers, only provides limited information such as specialty, generic or 'pooled' Provider records are listed in the PROVIDER table.",
|
||||
PAYER_PLAN_PERIOD,CDM,No,,Yes,0,,"The PAYER_PLAN_PERIOD table captures details of the period of time that a Person is continuously enrolled under a specific health Plan benefit structure from a given Payer. Each Person receiving healthcare is typically covered by a health benefit plan, which pays for (fully or partially), or directly provides, the care. These benefit plans are provided by payers, such as health insurances or state or government agencies. In each plan the details of the health benefits are defined for the Person or her family, and the health benefit Plan might change over time typically with increasing utilization (reaching certain cost thresholds such as deductibles), plan availability and purchasing choices of the Person. The unique combinations of Payer organizations, health benefit Plans and time periods in which they are valid for a Person are recorded in this table.","A Person can have multiple, overlapping, Payer_Plan_Periods in this table. For example, medical and drug coverage in the US can be represented by two Payer_Plan_Periods. The details of the benefit structure of the Plan is rarely known, the idea is just to identify that the Plans are different.",
|
||||
|
|
|
|
@ -118,7 +118,7 @@ PROCEDURE_OCCURRENCE,procedure_concept_id,Yes,integer,"The PROCEDURE_CONCEPT_ID
|
|||
PROCEDURE_OCCURRENCE,procedure_date,No,date,Use this date to determine the date the procedure occurred.,"If a procedure lasts more than a day, then it should be recorded as a separate record for each day the procedure occurred, this logic is in lieu of the procedure_end_date, which will be added in a future version of the CDM.",No,No,,,,,
|
||||
PROCEDURE_OCCURRENCE,procedure_datetime,Yes,datetime,,"This is not required, though it is in v6. If a source does not specify datetime the convention is to set the time to midnight (00:00:0000)",No,No,,,,,
|
||||
PROCEDURE_OCCURRENCE,procedure_type_concept_id,Yes,integer,"This field can be used to determine the provenance of the Procedure record, as in whether the procedure was from an EHR system, insurance claim, registry, or other sources.","Choose the PROCEDURE_TYPE_CONCEPT_ID that best represents the provenance of the record, for example whether it came from an EHR record or billing claim. If a procedure is recorded as an EHR encounter, the PROCEDURE_TYPE_CONCEPT would be 'EHR encounter record'. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?domain=Type+Concept&standardConcept=Standard&page=1&pageSize=15&query=).",No,Yes,CONCEPT,CONCEPT_ID,Type Concept,,
|
||||
PROCEDURE_OCCURRENCE,modifier_concept_id,Yes,integer,The modifiers are intended to give additional information about the procedure but as of now the vocabulary is under review.,"It is up to the ETL to choose how to map modifiers if they exist in source data. These concepts are typically distinguished by 'Modifier' concept classes (e.g., 'CPT4 Modifier' as part of the 'CPT4' vocabulary). If there is more than one modifier on a record, one should be chosen that pertains to the procedure rather than provider. If not available, set to 0. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?conceptClass=CPT4+Modifier&conceptClass=HCPCS+Modifier&vocabulary=CPT4&vocabulary=HCPCS&standardConcept=Standard&page=1&pageSize=15&query=).",No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
PROCEDURE_OCCURRENCE,modifier_concept_id,No,integer,The modifiers are intended to give additional information about the procedure but as of now the vocabulary is under review.,"It is up to the ETL to choose how to map modifiers if they exist in source data. These concepts are typically distinguished by 'Modifier' concept classes (e.g., 'CPT4 Modifier' as part of the 'CPT4' vocabulary). If there is more than one modifier on a record, one should be chosen that pertains to the procedure rather than provider. If not available, set to 0. [Accepted Concepts](https://athena.ohdsi.org/search-terms/terms?conceptClass=CPT4+Modifier&conceptClass=HCPCS+Modifier&vocabulary=CPT4&vocabulary=HCPCS&standardConcept=Standard&page=1&pageSize=15&query=).",No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
PROCEDURE_OCCURRENCE,quantity,No,integer,"If the quantity value is omitted, a single procedure is assumed.","If a Procedure has a quantity of '0' in the source, this should default to '1' in the ETL. If there is a record in the source it can be assumed the exposure occurred at least once",No,No,,,,,
|
||||
PROCEDURE_OCCURRENCE,provider_id,No,bigint,"The provider associated with the procedure record, e.g. the provider who performed the Procedure.","The ETL may need to make a choice as to which PROVIDER_ID to put here. Based on what is available this may or may not be different than the provider associated with the overall VISIT_OCCURRENCE record, for example the admitting vs attending physician on an EHR record.",No,No,PROVIDER,PROVIDER_ID,,,
|
||||
PROCEDURE_OCCURRENCE,visit_occurrence_id,No,bigint,The visit during which the procedure occurred.,"Depending on the structure of the source data, this may have to be determined based on dates. If a PROCEDURE_DATE occurs within the start and end date of a Visit it is a valid ETL choice to choose the VISIT_OCCURRENCE_ID from the Visit that subsumes it, even if not explicitly stated in the data. While not required, an attempt should be made to locate the VISIT_OCCURRENCE_ID of the PROCEDURE_OCCURRENCE record.",No,No,VISIT_OCCURRENCE,VISIT_OCCURRENCE_ID,,,
|
||||
|
@ -210,7 +210,7 @@ NOTE_NLP,note_nlp_id,Yes,bigint,A unique identifier for the NLP record.,,Yes,No,
|
|||
NOTE_NLP,note_id,Yes,integer,This is the NOTE_ID for the NOTE record the NLP record is associated to.,,No,No,,,,,
|
||||
NOTE_NLP,section_concept_id,No,integer,,"The SECTION_CONCEPT_ID should be used to represent the note section contained in the NOTE_NLP record. These concepts can be found as parts of document panels and are based on the type of note written, i.e. a discharge summary. These panels can be found as concepts with the relationship 'Subsumes' to CONCEPT_ID [45875957](https://athena.ohdsi.org/search-terms/terms/45875957).",No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
NOTE_NLP,snippet,No,varchar(250),A small window of text surrounding the term,,No,No,,,,,
|
||||
NOTE_NLP,offset,No,varchar(50),Character offset of the extracted term in the input note,,No,No,,,,,
|
||||
NOTE_NLP,"\""offset\""",No,varchar(50),Character offset of the extracted term in the input note,,No,No,,,,,
|
||||
NOTE_NLP,lexical_variant,Yes,varchar(250),Raw text extracted from the NLP tool.,,No,No,,,,,
|
||||
NOTE_NLP,note_nlp_concept_id,No,integer,,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
NOTE_NLP,note_nlp_source_concept_id,No,integer,,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
|
@ -334,33 +334,29 @@ PAYER_PLAN_PERIOD,family_source_value,No,varchar(50),The common identifier for a
|
|||
PAYER_PLAN_PERIOD,stop_reason_concept_id,No,integer,"This field represents the reason the Person left the Plan, if known.",Map the stop reason directly to a standard CONCEPT_ID. If one does not exists please contact the vocabulary team. There is no global controlled vocabulary available for this information. [Accepted Concepts](http://athena.ohdsi.org/search-terms/terms?domain=Plan+Stop+Reason&standardConcept=Standard&page=1&pageSize=15&query=).,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
PAYER_PLAN_PERIOD,stop_reason_source_value,No,varchar(50),The Plan stop reason as it appears in the source data.,,No,No,,,,,
|
||||
PAYER_PLAN_PERIOD,stop_reason_source_concept_id,No,integer,,If the source data codes the stop reason in an OMOP supported vocabulary store the concept_id here.,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,cost_id,Yes,INTEGER,,,Yes,No,,,,,
|
||||
COST,cost_event_id,Yes,bigint,,,No,No,,,,,
|
||||
COST,cost_domain_id,Yes,VARCHAR(20),,,No,Yes,DOMAIN,DOMAIN_ID,,,
|
||||
COST,cost_type_concept_id,Yes,integer,,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,currency_concept_id,No,integer,,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,total_charge,No,FLOAT,,,No,No,,,,,
|
||||
COST,total_cost,No,FLOAT,,,No,No,,,,,
|
||||
COST,total_paid,No,FLOAT,,,No,No,,,,,
|
||||
COST,paid_by_payer,No,FLOAT,,,No,No,,,,,
|
||||
COST,paid_by_patient,No,FLOAT,,,No,No,,,,,
|
||||
COST,paid_patient_copay,No,FLOAT,,,No,No,,,,,
|
||||
COST,paid_patient_coinsurance,No,FLOAT,,,No,No,,,,,
|
||||
COST,paid_patient_deductible,No,FLOAT,,,No,No,,,,,
|
||||
COST,paid_by_primary,No,FLOAT,,,No,No,,,,,
|
||||
COST,paid_ingredient_cost,No,FLOAT,,,No,No,,,,,
|
||||
COST,paid_dispensing_fee,No,FLOAT,,,No,No,,,,,
|
||||
COST,payer_plan_period_id,No,bigint,,,No,No,,,,,
|
||||
COST,amount_allowed,No,FLOAT,,,No,No,,,,,
|
||||
COST,revenue_code_concept_id,No,integer,,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,revenue_code_source_value,No,VARCHAR(50),Revenue codes are a method to charge for a class of procedures and conditions in the U.S. hospital system.,,No,No,,,,,
|
||||
COST,drg_concept_id,No,integer,,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,drg_source_value,No,VARCHAR(3),Diagnosis Related Groups are US codes used to classify hospital cases into one of approximately 500 groups. ,,No,No,,,,,
|
||||
COST,cost_id,Yes,bigint,A unique identifier for each COST record.,,Yes,No,,,,,
|
||||
COST,person_id,Yes,bigint,,,No,No,,,,,
|
||||
COST,cost_event_id,Yes,bigint,"If the Cost record is related to another record in the database, this field is the primary key of the linked record. ","Put the primary key of the linked record, if applicable, here.",No,No,,,,,
|
||||
COST,cost_event_field_concept_id,Yes,integer,"If the Cost record is related to another record in the database, this field is the CONCEPT_ID that identifies which table the primary key of the linked record came from. ",Put the CONCEPT_ID that identifies which table and field the COST_EVENT_ID came from.,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,cost_concept_id,No,integer,A foreign key that refers to a Standard Cost Concept identifier in the Standardized Vocabularies belonging to the 'Cost' vocabulary.,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,cost_type_concept_id,No,integer,A foreign key identifier to a concept in the CONCEPT table for the provenance or the source of the COST data and belonging to the 'Type Concept' vocabulary,,No,Yes,CONCEPT,CONCEPT_ID,Type Concept,,
|
||||
COST,cost_source_concept_id,No,integer,A foreign key to a Cost Concept that refers to the code used in the source.,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,cost_source_value,No,varchar(50),The source value for the cost as it appears in the source data,,No,No,,,,,
|
||||
COST,currency_concept_id,No,integer,"A foreign key identifier to the concept representing the 3-letter code used to delineate international currencies, such as USD for US Dollar. These belong to the 'Currency' vocabulary",,No,No,CONCEPT,CONCEPT_ID,,,
|
||||
COST,cost,No,float,The actual financial cost amount,,No,No,,,,,
|
||||
COST,incurred_date,No,date,"The first date of service of the clinical event corresponding to the cost as in table capturing the information (e.g. date of visit, date of procedure, date of condition, date of drug etc).",,No,No,,,,,
|
||||
COST,billed_date,No,date,The date a bill was generated for a service or encounter,,No,No,,,,,
|
||||
COST,paid_date,No,date,The date payment was received for a service or encounter,,No,No,,,,,
|
||||
COST,revenue_code_concept_id,No,integer,A foreign key referring to a Standard Concept ID in the Standardized Vocabularies for Revenue codes belonging to the 'Revenue Code' vocabulary.,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,drg_concept_id,No,integer,A foreign key referring to a Standard Concept ID in the Standardized Vocabularies for DRG codes belonging to the 'DRG' vocabulary.,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
COST,revenue_code_source_value,No,varchar(50),"The source value for the Revenue code as it appears in the source data, stored here for reference.",,No,No,,,,,
|
||||
COST,drg_source_value,No,varchar(50),"The source value for the 3-digit DRG source code as it appears in the source data, stored here for reference.",,No,No,,,,,
|
||||
COST,payer_plan_period_id,No,bigint,"A foreign key to the PAYER_PLAN_PERIOD table, where the details of the Payer, Plan and Family are stored. Record the payer_plan_id that relates to the payer who contributed to the paid_by_payer field.",,No,No,,,,,
|
||||
DRUG_ERA,drug_era_id,Yes,bigint,,,Yes,No,,,,,
|
||||
DRUG_ERA,person_id,Yes,bigint,,,No,Yes,PERSON,PERSON_ID,,,
|
||||
DRUG_ERA,drug_concept_id,Yes,integer,The Concept Id representing the specific drug ingredient.,,No,Yes,CONCEPT,CONCEPT_ID,Drug,Ingredient,
|
||||
DRUG_ERA,drug_era_start_date,Yes,datetime,,"The Drug Era Start Date is the start date of the first Drug Exposure for a given ingredient, with at least 31 days since the previous exposure. ",No,No,,,,,
|
||||
DRUG_ERA,drug_era_end_date,Yes,datetime,,"The Drug Era End Date is the end date of the last Drug Exposure. The End Date of each Drug Exposure is either taken from the field drug_exposure_end_date or, as it is typically not available, inferred using the following rules:
|
||||
DRUG_ERA,drug_era_start_datetime,Yes,datetime,,"The Drug Era Start Date is the start date of the first Drug Exposure for a given ingredient, with at least 31 days since the previous exposure. ",No,No,,,,,
|
||||
DRUG_ERA,drug_era_end_datetime,Yes,datetime,,"The Drug Era End Date is the end date of the last Drug Exposure. The End Date of each Drug Exposure is either taken from the field drug_exposure_end_date or, as it is typically not available, inferred using the following rules:
|
||||
For pharmacy prescription data, the date when the drug was dispensed plus the number of days of supply are used to extrapolate the End Date for the Drug Exposure. Depending on the country-specific healthcare system, this supply information is either explicitly provided in the day_supply field or inferred from package size or similar information.
|
||||
For Procedure Drugs, usually the drug is administered on a single date (i.e., the administration date).
|
||||
A standard Persistence Window of 30 days (gap, slack) is permitted between two subsequent such extrapolated DRUG_EXPOSURE records to be considered to be merged into a single Drug Era.",No,No,,,,,
|
||||
|
@ -371,18 +367,18 @@ DOSE_ERA,person_id,Yes,bigint,,,No,Yes,PERSON,PERSON_ID,,,
|
|||
DOSE_ERA,drug_concept_id,Yes,integer,The Concept Id representing the specific drug ingredient.,,No,Yes,CONCEPT,CONCEPT_ID,Drug,Ingredient,
|
||||
DOSE_ERA,unit_concept_id,Yes,integer,The Concept Id representing the unit of the specific drug ingredient.,,No,Yes,CONCEPT,CONCEPT_ID,Unit,,
|
||||
DOSE_ERA,dose_value,Yes,float,The numeric value of the dosage of the drug_ingredient.,,No,No,,,,,
|
||||
DOSE_ERA,dose_era_start_date,Yes,datetime,"The date the Person started on the specific dosage, with at least 31 days since any prior exposure.",,No,No,,,,,
|
||||
DOSE_ERA,dose_era_end_date,Yes,datetime,,The date the Person was no longer exposed to the dosage of the specific drug ingredient. An era is ended if there are 31 days or more between dosage records.,No,No,,,,,
|
||||
CONDITION_ERA,condition_era_id,Yes,integer,,,Yes,No,,,,,
|
||||
DOSE_ERA,dose_era_start_datetime,Yes,datetime,"The date the Person started on the specific dosage, with at least 31 days since any prior exposure.",,No,No,,,,,
|
||||
DOSE_ERA,dose_era_end_datetime,Yes,datetime,,The date the Person was no longer exposed to the dosage of the specific drug ingredient. An era is ended if there are 31 days or more between dosage records.,No,No,,,,,
|
||||
CONDITION_ERA,condition_era_id,Yes,bigint,,,Yes,No,,,,,
|
||||
CONDITION_ERA,person_id,Yes,bigint,,,No,No,PERSON,PERSON_ID,,,
|
||||
CONDITION_ERA,condition_concept_id,Yes,integer,The Concept Id representing the Condition.,,No,Yes,CONCEPT,CONCEPT_ID,Condition,,
|
||||
CONDITION_ERA,condition_era_start_date,Yes,datetime,"The start date for the Condition Era
|
||||
CONDITION_ERA,condition_era_start_datetime,Yes,datetime,"The start date for the Condition Era
|
||||
constructed from the individual
|
||||
instances of Condition Occurrences.
|
||||
It is the start date of the very first
|
||||
chronologically recorded instance of
|
||||
the condition with at least 31 days since any prior record of the same Condition. ",,No,No,,,,,
|
||||
CONDITION_ERA,condition_era_end_date,Yes,datetime,"The end date for the Condition Era
|
||||
CONDITION_ERA,condition_era_end_datetime,Yes,datetime,"The end date for the Condition Era
|
||||
constructed from the individual
|
||||
instances of Condition Occurrences.
|
||||
It is the end date of the final
|
||||
|
@ -538,7 +534,7 @@ recorded. The default value is
|
|||
1-Jan-1970.",,No,No,,,,,
|
||||
DRUG_STRENGTH,valid_end_date,Yes,date,The date when then Concept became invalid.,,No,No,,,,,
|
||||
DRUG_STRENGTH,invalid_reason,No,varchar(1),"Reason the concept was invalidated. Possible values are D (deleted), U (replaced with an update) or NULL when valid_end_date has the default value.",,No,No,,,,,
|
||||
COHORT_DEFINITION,cohort_definition_id,Yes,integer,"This is the identifier given to the cohort, usually by the ATLAS application",,No,No,,,,,
|
||||
COHORT_DEFINITION,cohort_definition_id,Yes,bigint,"This is the identifier given to the cohort, usually by the ATLAS application",,No,No,,,,,
|
||||
COHORT_DEFINITION,cohort_definition_name,Yes,varchar(255),A short description of the cohort,,No,No,,,,,
|
||||
COHORT_DEFINITION,cohort_definition_description,No,varchar(MAX),A complete description of the cohort.,,No,No,,,,,
|
||||
COHORT_DEFINITION,definition_type_concept_id,Yes,integer,Type defining what kind of Cohort Definition the record represents and how the syntax may be executed.,,No,Yes,CONCEPT,CONCEPT_ID,,,
|
||||
|
|
|
Loading…
Reference in New Issue