Error running constraint.sql on MIMIC-IV version 3.0
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 3.4k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Checked the online documentation: https://mimic.mit.edu/
- Checked that your issue isn't already addressed: https://github.com/MIT-LCP/mimic-code/issues?utf8=%E2%9C%93&q=
Description
I've tried in buide a local mimic on a MacOs system with the MIMIC-IV version 3.0. At the step of running constraint.sql, there's an error...
psql:mimic-iv/buildmimic/postgres/constraint.sql:207: 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".
I've checked the shasum256 of the downloaded mimic files.
Upon inspection, there is no subject_id=11404231 in the patients.csv file but it is present in the diagnoses_icd.csv file.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the constraint.sql failure at mimic-iv/buildmimic/postgres/constraint.sql:207 and compare subject_id 11404231 across diagnoses_icd.csv and patients.csv. Trace how these CSVs are loaded, then verify the import completes without the foreign-key violation and that the affected records are consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100