Skip to content

Commit

Permalink
fix: readme mimic-iv concept postgres links
Browse files Browse the repository at this point in the history
  • Loading branch information
chamathpali authored Dec 30, 2023
1 parent 4b7d260 commit dce20ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mimic-iv/concepts/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MIMIC-IV Concepts

This folder contains scripts to generate useful abstractions of raw MIMIC-IV data ("concepts").
The scripts are written using the **BigQuery Standard SQL Dialect**. Concepts are categorized into folders if possible, otherwise they remain in the top-level directory. The [postgres](/mimic-iv/concepts/postgres) subfolder contains automatically generated PostgreSQL versions of these scripts; [see below for how these were generated](#postgresql-concepts). Concepts are categorized into folders if possible, otherwise they remain in the top-level directory.
The scripts are written using the **BigQuery Standard SQL Dialect**. Concepts are categorized into folders if possible, otherwise they remain in the top-level directory. The [postgres](/mimic-iv/concepts_postgres) subfolder contains automatically generated PostgreSQL versions of these scripts; [see below for how these were generated](#postgresql-concepts). Concepts are categorized into folders if possible, otherwise they remain in the top-level directory.

The concepts are organized into individual SQL scripts, with each script generating a table. The BigQuery `mimiciv_derived` dataset under `physionet-data` contains the concepts pregenerated. Access to this dataset is available to MIMIC-IV approved users: see the [cloud instructions](https://mimic.mit.edu/docs/gettingstarted/cloud/) on how to access MIMIC-IV on BigQuery (which includes the derived concepts).

Expand All @@ -26,9 +26,9 @@ In general the concepts may be generated in any order, except for the *first_day

## Generating the concepts on PostgreSQL

These instructions are used to regenerate the [postgres](/mimic-iv/concepts/postgres) scripts from the BigQuery dialect scripts in the concepts folder.
These instructions are used to regenerate the [postgres](/mimic-iv/concepts_postgres) scripts from the BigQuery dialect scripts in the concepts folder.

* **If you just want to create PostgreSQL concepts for your installation of MIMIC-IV, go to the [postgres](/mimic-iv/concepts/postgres) subfolder**
* **If you just want to create PostgreSQL concepts for your installation of MIMIC-IV, go to the [postgres](/mimic-iv/concepts_postgres) subfolder**
* If you would like to understand the process better, and possibly improve upon it, read on

Analogously to [MIMIC-III Concepts](https://github.com/MIT-LCP/mimic-code/tree/master/concepts), the SQL scripts here are written in BigQuery's Standard SQL syntax. The concepts have been carefully written to allow conversion to PostgreSQL, so that only the following changes are necessary to make them compaible with PostgreSQL:
Expand All @@ -37,13 +37,13 @@ Analogously to [MIMIC-III Concepts](https://github.com/MIT-LCP/mimic-code/tree/m
* modify SQL scripts for incompatible syntax
* run the modified SQL scripts and direct the output into tables in the PostgreSQL database

To do this, we have created a (*nix/Mac OS X) compatible shell script which performs regular expression replacements for each script. To simplify the process for users, we output these automatically generated scripts to the [postgres](/mimic-iv/concepts/postgres) folder.
To do this, we have created a (*nix/Mac OS X) compatible shell script which performs regular expression replacements for each script. To simplify the process for users, we output these automatically generated scripts to the [postgres](/mimic-iv/concepts_postgres) folder.
Re-running this shell script can be done as follows:

1. Open a terminal in the `concepts` folder.
2. Run [convert_bigquery_to_postgres.sh](convert_bigquery_to_postgres.sh).
* e.g. `bash convert_bigquery_to_postgres.sh`
* This file outputs the scripts to the [postgres](/mimic-iv/concepts/postgres) subfolder after applying a few changes.
* This file outputs the scripts to the [postgres](/mimic-iv/concepts_postgres) subfolder after applying a few changes.
* This also creates the `postgres_make_concepts.sql` script in the postgres subfolder.

### Known Problems
Expand Down

0 comments on commit dce20ec

Please sign in to comment.