Skip to content

Commit

Permalink
Merge pull request #99 from OHDSI/CDM_5_2_bug_fixes
Browse files Browse the repository at this point in the history
Bugfix issues #98, #97 and #96.
  • Loading branch information
clairblacketer committed Aug 10, 2017
2 parents daf928e + 322ad1b commit 7dfa2b0
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Impala/OMOP_CDM_ddl_Impala.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 0 additions & 2 deletions Oracle/OMOP CDM constraints - Oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Oracle/OMOP CDM ddl - Oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 1 addition & 3 deletions PostgreSQL/OMOP CDM constraints - PostgreSQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ;

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion PostgreSQL/OMOP CDM ddl - PostgreSQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand Down
3 changes: 1 addition & 2 deletions PostgreSQL/OMOP CDM indexes required - PostgreSQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions Sql Server/OMOP CDM constraints - SQL Server.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions Sql Server/OMOP CDM indexes required - SQL Server.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7dfa2b0

Please sign in to comment.