In this article, I’m going to describe how to create MIMIC-III in a local Postgres database on Ubuntu.
- Download the MIMIC-III Clinical Database. You need to gain access to the dataset.
- Create a Docker container. Install Postgres by
apt-get install postgresql
. - Clone the mimic-code repository into a local directory using
git clone https://github.com/MIT-LCP/mimic-code.git
. - Go to the
mimic-code/buildmimic/postgres
directory and usemake
to run the Makefile, which contains instructions for creating MIMIC in a local Postgres database. - Create a new PostgreSQL user by
createuser -P -s -e -d root
. Replaceroot
with your local username.
macOS 10.15 (Catalina)
- Install Postgres by
brew install postgres
. - Run Postgres by
postgres -D /usr/local/var/postgres
. - Create a new PostgreSQL user by
createuser -P -s -e -d postgres
. Herepostgres
is the username. - Build MIMIC-III using .csv.gz files in the /path/to/data directory by
make create-user mimic-gz datadir="/Volumes/Logitec_2TB_OHI/physionet.org/files/mimiciii/1.4"
. By default, the database name ismimic
, username ispostgres
, schema ismimiciii
. - Connect to the database using
psql -U postgres -d mimic
.
Now try to count the number of patients in the database.
select count(subject_id) from mimiciii.patients;
Comments