N.B. This is for the raw data rather than the merged or imputed.
wget -r -N -c -np --user physionet user --ask-password https://physionet.org/files/hirid/1.1.1/raw_stage/observation_tables_csv.tar.gz
wget -r -N -c -np --user physionet user --ask-password https://physionet.org/files/hirid/1.1.1/raw_stage/pharma_records_csv.tar.gz
sudo apt-get install postgresql # (Linux)
brew install postgres # (Mac OS)
or http://www.postgresql.org/download/ (Any Operating System incl Windows)
sudo -u postgres psql # enter into postgres
# in postgres pay attention to the semicolons!
ALTER USER postgres PASSWORD 'myPassword'; # create password
#ALTER ROLE
CREATE DATABASE hirid; # create database
#CREATE DATABASE
\c hirid # connect to database
#you are now connected to database "hirid" as user "postgres"
CREATE SCHEMA hirid;
# CREATE SCHEMA
\q # quit
cd /folder/containing/data/and/scripts
psql -U postgres -h 127.0.0.1 -f create_tables.sql 'dbname=hirid options=--search_path=hirid password = myPassword' # create tables
psql -U postgres -h 127.0.0.1 -f load_data.sql 'dbname=hirid options=--search_path=hirid password = myPassword' # load hirid data into tables. This may take a while
psql -U postgres -h 127.0.0.1 -f postgres_check.sql 'dbname=hirid options=--search_path=hirid password = myPassword' # checks if the data has been loaded corrected