Error loading MIMIC-IV 3.0 with the V 2.2 postgres create.sql script
Prerequisites
- [X ] 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
Description of the issue, including:
- The admissions.csv in version 3.0 has values for too long for the 'language' column. This causes the load.sql script to fail:
- SET psql:load.sql:16: ERROR: value too long for type character varying(10) CONTEXT: COPY admissions, line 238, column language: "Kabuverdianu" and later with psql:load_admissions.sql:16: ERROR: value too long for type character varying(12) CONTEXT: COPY admissions, line 387, column language: "American Sign Language"
I fixed it by changing the 'language' column VARCHAR limit to 30. This will surely be fixed if and when a 3.0 version of code is released.
I came across a similar error with COPY admissions. Could you tell me how you fixed the problem in detail? I don't know how to change the the 'language' column VARCHAR limit. Thank you.
The exact fix is to change the create_admissions.sql file. I my case the location is mimic-code\mimic-iv\buildmimic\postgres\create_admissions.sql (I am working with postgres on Windows 11). In that file, change the line that starts with language to language VARCHAR (30) and build the database again.
Yep that works! Or run alter table mimiciv_hosp.admissions alter column language type varchar(25); before you run the load script. Hopefully we push fixes soon :)