Merge pull request #99 from OHDSI/CDM_5_2_bug_fixes
Bugfix issues #98, #97 and #96.
This commit is contained in:
commit
7dfa2b0ee9
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 ,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue