diff --git a/Impala/OMOP_CDM_ddl_Impala.sql b/Impala/OMOP_CDM_ddl_Impala.sql index fe122601..d1ade63b 100644 --- a/Impala/OMOP_CDM_ddl_Impala.sql +++ b/Impala/OMOP_CDM_ddl_Impala.sql @@ -333,7 +333,7 @@ CREATE TABLE visit_occurrence ( visit_source_concept_id INTEGER, admitting_source_concept_id INTEGER, admitting_source_value VARCHAR(50), - discharge_to_concept_id INTEGER(50), + discharge_to_concept_id INTEGER, discharge_to_source_value VARCHAR(50), preceding_visit_occurrence_id INTEGER ) diff --git a/Oracle/OMOP CDM constraints - Oracle.sql b/Oracle/OMOP CDM constraints - Oracle.sql index 69ca56f9..884473cd 100644 --- a/Oracle/OMOP CDM constraints - Oracle.sql +++ b/Oracle/OMOP CDM constraints - Oracle.sql @@ -353,8 +353,6 @@ ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_type_concept FOREIGN KEY (drug ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_route_concept FOREIGN KEY (route_concept_id) REFERENCES concept (concept_id); -ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_dose_unit_concept FOREIGN KEY (dose_unit_concept_id) REFERENCES concept (concept_id); - ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_provider FOREIGN KEY (provider_id) REFERENCES provider (provider_id); ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_visit FOREIGN KEY (visit_occurrence_id) REFERENCES visit_occurrence (visit_occurrence_id); diff --git a/Oracle/OMOP CDM ddl - Oracle.sql b/Oracle/OMOP CDM ddl - Oracle.sql index cdfaf167..76011cc7 100644 --- a/Oracle/OMOP CDM ddl - Oracle.sql +++ b/Oracle/OMOP CDM ddl - Oracle.sql @@ -315,7 +315,7 @@ CREATE TABLE visit_occurrence visit_source_concept_id INTEGER NULL, admitting_source_concept_id INTEGER NULL , admitting_source_value VARCHAR(50) NULL , - discharge_to_concept_id INTEGER(50) NULL , + discharge_to_concept_id INTEGER NULL , discharge_to_source_value VARCHAR(50) NULL , preceding_visit_occurrence_id INTEGER NULL ) diff --git a/Oracle/OMOP CDM indexes required - Oracle - With constraints.sql b/Oracle/OMOP CDM indexes required - Oracle - With constraints.sql index f0a013c8..e6739f5b 100644 --- a/Oracle/OMOP CDM indexes required - Oracle - With constraints.sql +++ b/Oracle/OMOP CDM indexes required - Oracle - With constraints.sql @@ -113,7 +113,6 @@ CREATE INDEX idx_note_person_id ON note (person_id ASC); CREATE INDEX idx_note_concept_id ON note (note_type_concept_id ASC); CREATE INDEX idx_note_visit_id ON note (visit_occurrence_id ASC); -CREATE INDEX idx_note_nlp_person_id ON note_nlp (person_id ASC); CREATE INDEX idx_note_nlp_note_id ON note_nlp (note_id ASC); CREATE INDEX idx_note_nlp_concept_id ON note_nlp (note_nlp_concept_id ASC); diff --git a/Oracle/OMOP CDM indexes required - Oracle - Without constraints.sql b/Oracle/OMOP CDM indexes required - Oracle - Without constraints.sql index c28f05de..8d646d44 100644 --- a/Oracle/OMOP CDM indexes required - Oracle - Without constraints.sql +++ b/Oracle/OMOP CDM indexes required - Oracle - Without constraints.sql @@ -132,7 +132,6 @@ CREATE INDEX idx_note_person_id ON note (person_id ASC); CREATE INDEX idx_note_concept_id ON note (note_type_concept_id ASC); CREATE INDEX idx_note_visit_id ON note (visit_occurrence_id ASC); -CREATE INDEX idx_note_nlp_person_id ON note_nlp (person_id ASC); CREATE INDEX idx_note_nlp_note_id ON note_nlp (note_id ASC); CREATE INDEX idx_note_nlp_concept_id ON note_nlp (note_nlp_concept_id ASC); diff --git a/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql b/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql index 161bc50f..8315147e 100644 --- a/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql +++ b/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql @@ -126,7 +126,7 @@ ALTER TABLE measurement ADD CONSTRAINT xpk_measurement PRIMARY KEY ( measurement ALTER TABLE note ADD CONSTRAINT xpk_note PRIMARY KEY ( note_id ) ; -ALTER TABLE note_nlp ADD CONSTRAINT xpk_note_nlp PRIMARY KEY NONCLUSTERED ( note_nlp_id ) ; +ALTER TABLE note_nlp ADD CONSTRAINT xpk_note_nlp PRIMARY KEY ( note_nlp_id ) ; ALTER TABLE observation ADD CONSTRAINT xpk_observation PRIMARY KEY ( observation_id ) ; @@ -352,8 +352,6 @@ ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_type_concept FOREIGN KEY (drug ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_route_concept FOREIGN KEY (route_concept_id) REFERENCES concept (concept_id); -ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_dose_unit_concept FOREIGN KEY (dose_unit_concept_id) REFERENCES concept (concept_id); - ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_provider FOREIGN KEY (provider_id) REFERENCES provider (provider_id); ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_visit FOREIGN KEY (visit_occurrence_id) REFERENCES visit_occurrence (visit_occurrence_id); diff --git a/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql b/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql index cdae76e4..acc06c6c 100644 --- a/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql +++ b/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql @@ -465,7 +465,7 @@ CREATE TABLE note_nlp note_id INTEGER NOT NULL , section_concept_id INTEGER NULL , snippet VARCHAR(250) NULL , - offset VARCHAR(250) NULL , + "offset" VARCHAR(250) NULL , lexical_variant VARCHAR(250) NOT NULL , note_nlp_concept_id INTEGER NULL , note_nlp_source_concept_id INTEGER NULL , diff --git a/PostgreSQL/OMOP CDM indexes required - PostgreSQL.sql b/PostgreSQL/OMOP CDM indexes required - PostgreSQL.sql index fb7aeaf8..5192f01f 100644 --- a/PostgreSQL/OMOP CDM indexes required - PostgreSQL.sql +++ b/PostgreSQL/OMOP CDM indexes required - PostgreSQL.sql @@ -153,9 +153,8 @@ CLUSTER note USING idx_note_person_id ; CREATE INDEX idx_note_concept_id ON note (note_type_concept_id ASC); CREATE INDEX idx_note_visit_id ON note (visit_occurrence_id ASC); -CREATE INDEX idx_note_nlp_person_id ON note_nlp (person_id ASC); -CLUSTER note_nlp USING idx_note_nlp_person_id ; CREATE INDEX idx_note_nlp_note_id ON note_nlp (note_id ASC); +CLUSTER note_nlp USING idx_note_nlp_note_id ; CREATE INDEX idx_note_nlp_concept_id ON note_nlp (note_nlp_concept_id ASC); CREATE INDEX idx_observation_person_id ON observation (person_id ASC); diff --git a/Sql Server/OMOP CDM constraints - SQL Server.sql b/Sql Server/OMOP CDM constraints - SQL Server.sql index 484ea065..1448fb6e 100644 --- a/Sql Server/OMOP CDM constraints - SQL Server.sql +++ b/Sql Server/OMOP CDM constraints - SQL Server.sql @@ -352,8 +352,6 @@ ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_type_concept FOREIGN KEY (drug ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_route_concept FOREIGN KEY (route_concept_id) REFERENCES concept (concept_id); -ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_dose_unit_concept FOREIGN KEY (dose_unit_concept_id) REFERENCES concept (concept_id); - ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_provider FOREIGN KEY (provider_id) REFERENCES provider (provider_id); ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_visit FOREIGN KEY (visit_occurrence_id) REFERENCES visit_occurrence (visit_occurrence_id); diff --git a/Sql Server/OMOP CDM indexes required - SQL Server.sql b/Sql Server/OMOP CDM indexes required - SQL Server.sql index 60b24d0a..ea526d33 100644 --- a/Sql Server/OMOP CDM indexes required - SQL Server.sql +++ b/Sql Server/OMOP CDM indexes required - SQL Server.sql @@ -131,8 +131,7 @@ CREATE CLUSTERED INDEX idx_note_person_id ON note (person_id ASC); CREATE INDEX idx_note_concept_id ON note (note_type_concept_id ASC); CREATE INDEX idx_note_visit_id ON note (visit_occurrence_id ASC); -CREATE CLUSTERED INDEX idx_note_nlp_person_id ON note_nlp (person_id ASC); -CREATE INDEX idx_note_nlp_note_id ON note_nlp (note_id ASC); +CREATE CLUSTERED INDEX idx_note_nlp_note_id ON note_nlp (note_id ASC); CREATE INDEX idx_note_nlp_concept_id ON note_nlp (note_nlp_concept_id ASC); CREATE CLUSTERED INDEX idx_observation_person_id ON observation (person_id ASC);