You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there is many errors in mimic-code-2.5.0\mimic-iv\buildmimic\postgres\constraint.sql
here is one of them, the others is similar.
ALTER TABLE mimiciv_hosp.diagnoses_icd DROP CONSTRAINT IF EXISTS diagnoses_icd_patients_fk; ALTER TABLE mimiciv_hosp.diagnoses_icd ADD CONSTRAINT diagnoses_icd_patients_fk FOREIGN KEY (subject_id) REFERENCES mimiciv_hosp.patients (subject_id);
error is there is no subject_id = 11404231 in the table of patients, so ERROR: insert or update on table "diagnoses_icd" violates foreign key constraint "diagnoses_icd_patients_fk" DETAIL: Key (subject_id)=(11404231) is not present in table "patients".
The text was updated successfully, but these errors were encountered:
ALTER TABLE mimiciv_hosp.diagnoses_icd DROP CONSTRAINT IF EXISTS diagnoses_icd_patients_fk;
ALTER TABLE mimiciv_hosp.diagnoses_icd
ADD CONSTRAINT diagnoses_icd_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimiciv_hosp.patients (subject_id);
ALTER TABLE mimiciv_hosp.diagnoses_icd DROP CONSTRAINT IF EXISTS diagnoses_icd_admissions_fk;
ALTER TABLE mimiciv_hosp.diagnoses_icd
ADD CONSTRAINT diagnoses_icd_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimiciv_hosp.admissions (hadm_id);
-- drgcodes
ALTER TABLE mimiciv_hosp.drgcodes DROP CONSTRAINT IF EXISTS drgcodes_patients_fk;
ALTER TABLE mimiciv_hosp.drgcodes
ADD CONSTRAINT drgcodes_patients_fk
FOREIGN KEY (subject_id)
REFERENCES mimiciv_hosp.patients (subject_id);
ALTER TABLE mimiciv_hosp.drgcodes DROP CONSTRAINT IF EXISTS drgcodes_admissions_fk;
ALTER TABLE mimiciv_hosp.drgcodes
ADD CONSTRAINT drgcodes_admissions_fk
FOREIGN KEY (hadm_id)
REFERENCES mimiciv_hosp.admissions (hadm_id);
`
there is many errors in mimic-code-2.5.0\mimic-iv\buildmimic\postgres\constraint.sql
here is one of them, the others is similar.
ALTER TABLE mimiciv_hosp.diagnoses_icd DROP CONSTRAINT IF EXISTS diagnoses_icd_patients_fk; ALTER TABLE mimiciv_hosp.diagnoses_icd ADD CONSTRAINT diagnoses_icd_patients_fk FOREIGN KEY (subject_id) REFERENCES mimiciv_hosp.patients (subject_id);
error is there is no subject_id = 11404231 in the table of patients, so
ERROR: insert or update on table "diagnoses_icd" violates foreign key constraint "diagnoses_icd_patients_fk" DETAIL: Key (subject_id)=(11404231) is not present in table "patients".
The text was updated successfully, but these errors were encountered: