Skip to content

Commit f689125

Browse files
committed
mimic-iv/concepts: fix relation names
Since 8ed4060 the relation name prefix is `mimiciv_`.
1 parent b6d6b6d commit f689125

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

mimic-iv/concepts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This folder contains scripts to generate useful abstractions of raw MIMIC-IV data ("concepts").
44
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.
55

6-
The concepts are organized into individual SQL scripts, with each script generating a table. The BigQuery `mimic_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).
6+
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).
77

88
* [List of the concept folders and their content](#concept-index)
99
* [Generating the concept tables on BigQuery](#generating-the-concepts-on-bigquery)

mimic-iv/concepts/make_concepts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# This script generates the concepts in the BigQuery table mimic_derived.
2+
# This script generates the concepts in the BigQuery table mimiciv_derived.
33
export TARGET_DATASET=mimiciv_derived
44

55
# specify bigquery query command options

mimic-iv/concepts/measurement/oxygen_delivery.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ with ce_stg1 as
6161
, itemid
6262
, value AS o2_device
6363
, ROW_NUMBER() OVER (PARTITION BY subject_id, charttime, itemid ORDER BY value) as rn
64-
FROM mimic_icu.chartevents
64+
FROM mimiciv_icu.chartevents
6565
WHERE itemid = 226732 -- oxygen delivery device(s)
6666
)
6767
, stg AS
@@ -95,4 +95,4 @@ SELECT
9595
, MAX(CASE WHEN rn = 4 THEN o2_device ELSE NULL END) AS o2_delivery_device_4
9696
FROM stg
9797
GROUP BY subject_id, charttime
98-
;
98+
;

mimic-iv/concepts/postgres/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ scripts are intended to be run against the MIMIC-IV data in a PostgreSQL databas
88
To generate concepts, change to this directory and run `psql`. Then within psql, run:
99

1010
```sql
11-
-- NOTE: many scripts *require* you to use mimic_derived as the schema for outputting concepts
11+
-- NOTE: many scripts *require* you to use mimiciv_derived as the schema for outputting concepts
1212
-- change the search path at your peril!
13-
set search_path to mimic_derived, mimic_core, mimic_hosp, mimic_icu, mimic_ed;
13+
set search_path to mimiciv_derived, mimiciv_hosp, mimiciv_icu, mimiciv_ed;
1414
\i postgres-functions.sql -- only needs to be run once
1515
\i postgres-make-concepts.sql
1616
```
1717

18-
... or, execute the SQL files in your GUI of choice.
18+
... or, execute the SQL files in your GUI of choice.

mimic-iv/concepts/postgres/comorbidity/first_day_lab.sql

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ WITH cbc AS
1111
, MAX(platelet) as platelets_max
1212
, MIN(wbc) as wbc_min
1313
, MAX(wbc) as wbc_max
14-
FROM mimic_icu.icustays ie
15-
LEFT JOIN mimic_derived.complete_blood_count le
14+
FROM mimiciv_icu.icustays ie
15+
LEFT JOIN mimiciv_derived.complete_blood_count le
1616
ON le.subject_id = ie.subject_id
1717
AND le.charttime >= DATETIME_SUB(ie.intime, INTERVAL '6' HOUR)
1818
AND le.charttime <= DATETIME_ADD(ie.intime, INTERVAL '1' DAY)
@@ -34,8 +34,8 @@ WITH cbc AS
3434
, MIN(glucose) AS glucose_min, MAX(glucose) AS glucose_max
3535
, MIN(sodium) AS sodium_min, MAX(sodium) AS sodium_max
3636
, MIN(potassium) AS potassium_min, MAX(potassium) AS potassium_max
37-
FROM mimic_icu.icustays ie
38-
LEFT JOIN mimic_derived.chemistry le
37+
FROM mimiciv_icu.icustays ie
38+
LEFT JOIN mimiciv_derived.chemistry le
3939
ON le.subject_id = ie.subject_id
4040
AND le.charttime >= DATETIME_SUB(ie.intime, INTERVAL '6' HOUR)
4141
AND le.charttime <= DATETIME_ADD(ie.intime, INTERVAL '1' DAY)
@@ -55,8 +55,8 @@ WITH cbc AS
5555
, MIN(immature_granulocytes) AS immature_granulocytes_min, MAX(immature_granulocytes) AS immature_granulocytes_max
5656
, MIN(metamyelocytes) AS metamyelocytes_min, MAX(metamyelocytes) AS metamyelocytes_max
5757
, MIN(nrbc) AS nrbc_min, MAX(nrbc) AS nrbc_max
58-
FROM mimic_icu.icustays ie
59-
LEFT JOIN mimic_derived.blood_differential le
58+
FROM mimiciv_icu.icustays ie
59+
LEFT JOIN mimiciv_derived.blood_differential le
6060
ON le.subject_id = ie.subject_id
6161
AND le.charttime >= DATETIME_SUB(ie.intime, INTERVAL '6' HOUR)
6262
AND le.charttime <= DATETIME_ADD(ie.intime, INTERVAL '1' DAY)
@@ -72,8 +72,8 @@ WITH cbc AS
7272
, MIN(inr) AS inr_min, MAX(inr) AS inr_max
7373
, MIN(pt) AS pt_min, MAX(pt) AS pt_max
7474
, MIN(ptt) AS ptt_min, MAX(ptt) AS ptt_max
75-
FROM mimic_icu.icustays ie
76-
LEFT JOIN mimic_derived.coagulation le
75+
FROM mimiciv_icu.icustays ie
76+
LEFT JOIN mimiciv_derived.coagulation le
7777
ON le.subject_id = ie.subject_id
7878
AND le.charttime >= DATETIME_SUB(ie.intime, INTERVAL '6' HOUR)
7979
AND le.charttime <= DATETIME_ADD(ie.intime, INTERVAL '1' DAY)
@@ -95,8 +95,8 @@ WITH cbc AS
9595
, MIN(ck_mb) AS ck_mb_min, MAX(ck_mb) AS ck_mb_max
9696
, MIN(ggt) AS ggt_min, MAX(ggt) AS ggt_max
9797
, MIN(ld_ldh) AS ld_ldh_min, MAX(ld_ldh) AS ld_ldh_max
98-
FROM mimic_icu.icustays ie
99-
LEFT JOIN mimic_derived.enzyme le
98+
FROM mimiciv_icu.icustays ie
99+
LEFT JOIN mimiciv_derived.enzyme le
100100
ON le.subject_id = ie.subject_id
101101
AND le.charttime >= DATETIME_SUB(ie.intime, INTERVAL '6' HOUR)
102102
AND le.charttime <= DATETIME_ADD(ie.intime, INTERVAL '1' DAY)
@@ -153,7 +153,7 @@ ie.subject_id
153153
, ck_mb_min, ck_mb_max
154154
, ggt_min, ggt_max
155155
, ld_ldh_min, ld_ldh_max
156-
FROM mimic_icu.icustays ie
156+
FROM mimiciv_icu.icustays ie
157157
LEFT JOIN cbc
158158
ON ie.stay_id = cbc.stay_id
159159
LEFT JOIN chem
@@ -164,4 +164,4 @@ LEFT JOIN coag
164164
ON ie.stay_id = coag.stay_id
165165
LEFT JOIN enz
166166
ON ie.stay_id = enz.stay_id
167-
;
167+
;

mimic-iv/concepts/postgres/measurement/oxygen_delivery.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ with ce_stg1 as
6363
, itemid
6464
, value AS o2_device
6565
, ROW_NUMBER() OVER (PARTITION BY subject_id, charttime, itemid ORDER BY value) as rn
66-
FROM mimic_icu.chartevents
66+
FROM mimiciv_icu.chartevents
6767
WHERE itemid = 226732 -- oxygen delivery device(s)
6868
)
6969
, stg AS
@@ -97,4 +97,4 @@ SELECT
9797
, MAX(CASE WHEN rn = 4 THEN o2_device ELSE NULL END) AS o2_delivery_device_4
9898
FROM stg
9999
GROUP BY subject_id, charttime
100-
;
100+
;

0 commit comments

Comments
 (0)