MIT-LCP / mimic-code

MIMIC Code Repository: Code shared by the research community for the MIMIC family of databases
https://mimic.mit.edu
MIT License
2.51k stars 1.5k forks source link

Issues running demo code #419

Open jbains223 opened 6 years ago

jbains223 commented 6 years ago

Prerequisites

Description

I am currently using a Mac and trying to set up the database using Postgresql as instructed in the tutorial on the MIMIC III database website. I have loaded the demo data into a file /buildmimic/postgres/data/ and have been trying to run make from /buildmimic/postgres/. However, every time I try to run make, it tells me "Unable to find /Data/ADMISSIONS.csv - exiting before build. make: *** [mimic-check] Error 1"

I have checked multiple times and the file is certainly there. Am I placing the data in the wrong place? I have checked online for any resources regarding this but I have not been able to solve this issue. Can you please help me. Thank you.

alistairewj commented 6 years ago

Can you run ls /buildmimic/postgres/data/ ? Interested to see what files you have there. We have a few demos, and the make file requires the CSV files.

The error is telling you that the /Data/ADMISSIONS.csv file does not exist. You can fix this by (1) changing the data directory, as detailed in the README, to a folder containing the data files such as ADMISSIONS.csv, or (2) move the data files to the /Data/ subfolder.

jbains223 commented 6 years ago

I can't run ls /buildmimic/postgres/data/ but when I go into the /buildmimic/postgres/data file and ls, I get the list of data files.

I have all the data files listed under /buildmimic/postgres/data/

Jazmins-MacBook-Pro:postgres j.bains$ ls Data postgres_checks.sql Makefile postgres_create_tables.sql README.md postgres_create_tables_pg10.sql create_mimic_user.sh postgres_load_data.sql postgres_add_comments.sql postgres_load_data_7zip.sql postgres_add_constraints.sql postgres_load_data_gz.sql postgres_add_indexes.sql Jazmins-MacBook-Pro:postgres j.bains$ cd Data Jazmins-MacBook-Pro:Data j.bains$ ls ADMISSIONS.csv D_ICD_DIAGNOSES.csv NOTEEVENTS.csv CALLOUT.csv D_ICD_PROCEDURES.csv OUTPUTEVENTS.csv CAREGIVERS.csv D_ITEMS.csv PATIENTS.csv CHARTEVENTS.csv D_LABITEMS.csv PRESCRIPTIONS.csv CPTEVENTS.csv ICUSTAYS.csv PROCEDUREEVENTS_MV.csv DATETIMEEVENTS.csv INPUTEVENTS_CV.csv PROCEDURES_ICD.csv DIAGNOSES_ICD.csv INPUTEVENTS_MV.csv SERVICES.csv DRGCODES.csv LABEVENTS.csv TRANSFERS.csv D_CPT.csv MICROBIOLOGYEVENTS.csv Jazmins-MacBook-Pro:Data j.bains$

alistairewj commented 6 years ago

Then, as detailed here https://github.com/MIT-LCP/mimic-code/blob/master/buildmimic/postgres/README.md

.. specify the datadir to the folder you put the data in, i.e. /buildmimic/postgres/data/

jbains223 commented 6 years ago

I have attempted that prior and did the same thing again and this is what comes up:

Jazmins-MacBook-Pro:postgres j.bains$ ls Data postgres_checks.sql Makefile postgres_create_tables.sql README.md postgres_create_tables_pg10.sql create_mimic_user.sh postgres_load_data.sql postgres_add_comments.sql postgres_load_data_7zip.sql postgres_add_constraints.sql postgres_load_data_gz.sql postgres_add_indexes.sql Jazmins-MacBook-Pro:postgres j.bains$ make create-user mimic datadir="/buildmimic/postgres/Data/"

-- Creating user, database, schema --

MIMIC_USER="postgres" MIMIC_DB="mimic" MIMIC_PASSWORD="postgres" MIMIC_SCHEMA="mimiciii" DBHOST="" DBPORT="" ./create_mimic_user.sh MIMIC_PASSWORD is set MIMIC_DB is set to 'mimic' User is set to 'postgres' DROP DATABASE CREATE DATABASE CREATE SCHEMA


-- Checking for data --

Data path: /buildmimic/postgres/Data/ Unable to find /buildmimic/postgres/Data/ADMISSIONS.csv - exiting before build. make: *** [mimic-check] Error 1 Jazmins-MacBook-Pro:postgres j.bains$

young310 commented 6 years ago

Hi @jbains223 ,

I am also using mac, and it looks like you place data in different directory. Could you try using the following command and give me the results?

  1. make create-user mimic datadir="Data/"
  2. pwd
jbains223 commented 6 years ago

Thank you for the suggestion @young310. I will try this as soon as I can but for some reason I am having trouble compressing my data files into a zip file. There's too much data and it's taking up too much space on my computer. Is there another way of doing this?

young310 commented 6 years ago

You can place the mimic data files in anywhere you want, for me, I just put them on an external hard drive. Then you have to use datadir="/Volume/your external driver/data". You can also use csv files to build the database, so you don't need to do extra compression jobs.

jbains223 commented 6 years ago

Hi @young310, Thank you so much!! When I ran the above make create-user mimic datadir="Data/", it ran and all the tables came back as PASSED.

One other question: I am using Postgres.app and downloaded the pgAdmin4 for the GUI aspect. However, since I downloaded that, Postgres.app is refusing to run on Port 5432 which is the default stating that there is already a server running on that port. Is there some way to troubleshoot this? I changed the port to 5433 and it worked fine. However, when I went to try to use the database in pgAdmin4 it didn't pull up for me to access. Did I do something wrong?

young310 commented 6 years ago

@jbains223 I never use "Postgres.app" before, and I guess you have installed more than one postgre server instance. For now, it's hard to help you without access to your computer. sorry.

jbains223 commented 6 years ago

Oh ok. No worries. @young310 what server or application are you using to run and build the database?

young310 commented 6 years ago

@jbains223 I am currently using docker, and had install server using the installer provided by by ENTERPRISEDB before.