MIT-LCP / MIT-LCP/mimic-code

there is some errors in mimic-code-2.5.0\mimic-iv\buildmimic\postgres\constraint.sql

Open
#1,792 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
3.4k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

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".

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with mimic-code-2.5.0\mimic-iv\buildmimic\postgres\constraint.sql and reproduce the diagnoses_icd foreign-key statements against the database. Check the reported subject_id mismatch and the similar constraint errors described in the issue. Done means the constraints in this file can be applied without foreign-key violations.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.