Permalink
Newer
Older
100644 41 lines (27 sloc) 2.1 KB
Jul 10, 2016 @jeblundell Initial documentation of build system
1
2 ## Introduction to the build system
3
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
4 The build system for mimic code uses the GNU Makefile system. From a user's point of view this makes the whole process very straightforward.
5 Starting from a fresh system which has both GNU Make installed, PostgreSQL installed, and a local copy of this repository, an instance of the MIMIC database can be imported from PhysioNet by running the following:
Jul 10, 2016 @jeblundell Initial documentation of build system
6
Sep 14, 2016 @jeblundell Added information on .pgpass to Makefile.md
7 ```
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
8 make mimic-download
Sep 14, 2016 @jeblundell Added information on .pgpass to Makefile.md
9 make mimic-gz DATADIR=/path/to/data
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
10 ```
11
12 Note that if you have already downloaded the data, you can skip the `make mimic-download`. If you have already decompressed the data into `.csv` files, then you can run `make mimic DATADIR=/path/to/data`.
Sep 14, 2016 @jeblundell Added information on .pgpass to Makefile.md
13
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
14 Optionally, additional contributed materialized views can be created afterward by running:
15
16 ```
17 make concepts
Sep 14, 2016 @jeblundell Added information on .pgpass to Makefile.md
18 ```
19
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
20 Note that you may want to modify parameters at the top of the Makefile - e.g. the username (see below "non-standard username or database name").
21
Sep 14, 2016 @jeblundell Added information on .pgpass to Makefile.md
22 ### Authentication
23 In order to avoid the prompts for your database password each time, you may create a file in your home directory called .pgpass containing the following:
24
25 ```
26 localhost:5432:*:mimic:password
27 ```
28
29 Replace ```mimic``` with your username and ```password``` with your password. Note that this is storage of your database password in the clear and so we would recommend only doing this for installation.
30
31 ### Non-standard username or database name
32 If you need to use a username or database name other than ```mimic```, then you will need to specify this by modifying the top-level Makefile:
33
34 ```
35 DBNAME=mimic
36 DBUSER=mimic
37 ```
38
39 ## Contributing
Jan 4, 2017 @alistairewj reworked make to call a single sql file to create concepts
40 If you would like to contribute code to create a materialized view to the `concepts` folder, the existence of this makefile places an additional (and hopefully very minor) burden to ensure that your views are included in this build system. The top-level Makefile (i.e. the one in the root of this repository) is a wrapper that calls `concepts/make-concepts.sql`: simply add a command which calls the script to this file. The format is fairly straightforward: e.g. adding the `\i sepsis/angus.sql` line informs the script to call the `concepts/sepsis/angus.sql` file.