Skip to content

Commit

Permalink
removed version and author from individual files, better to track in …
Browse files Browse the repository at this point in the history
…github
  • Loading branch information
alistairewj committed Sep 15, 2016
1 parent 71b7a90 commit 98e30a4
Show file tree
Hide file tree
Showing 31 changed files with 78 additions and 155 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------
## Title: Top-level build file
## Description: Automated import of data and SQL scripts
## MIMIC version: MIMIC-III v1.4
## Author: Jim Blundell 2016
## ------------------------------------------------------------------

## Parameters ##
Expand Down Expand Up @@ -107,4 +105,3 @@ clean:
@$(MAKE) -e -C severityscores clean

.PHONY: help mimic mimic-build mimic-download mimic-check mimic-gz mimic-build-gz mimic-check-gz extra etc comorbidity demographics sepsis severityscores

2 changes: 0 additions & 2 deletions buildmimic/apache-drill/drill_create_data.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-- ------------------------------------------------------------------
-- Title: Create the MIMIC-III tables
-- Description: More detailed description explaining the purpose.
-- MIMIC version: MIMIC-III v1.3
-- Created by: paris nicolas
-- ------------------------------------------------------------------


Expand Down
2 changes: 0 additions & 2 deletions buildmimic/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM postgres:latest

MAINTAINER Aaron J. Masino

# in the docker initialization, we do not build the data
ENV BUILD_MIMIC 0

Expand Down
2 changes: 0 additions & 2 deletions buildmimic/monetdb/monetdb_create_tables.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-- ------------------------------------------------------------------
-- Title: Create the MIMIC-III tables
-- Description: More detailed description explaining the purpose.
-- MIMIC version: MIMIC-III v1.3
-- Created by: paris nicolas
-- ------------------------------------------------------------------

CREATE SCHEMA mimiciii;
Expand Down
2 changes: 0 additions & 2 deletions buildmimic/monetdb/monetdb_load_data.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-- ------------------------------------------------------------------
-- Title: Load data into the MIMIC-III schema
-- Description: More detailed description explaining the purpose.
-- MIMIC version: MIMIC-III v1.3
-- Created by: paris nicolas
-- ------------------------------------------------------------------


Expand Down
4 changes: 0 additions & 4 deletions comorbidity/postgres/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------
## Title: Build file for comorbidity
## Description: Automated import of SQL scripts for comorbidity
## MIMIC version: MIMIC-III v1.3
## Author: Jim Blundell 2016
## ------------------------------------------------------------------

## Parameters ##
Expand Down Expand Up @@ -38,5 +36,3 @@ clean:
@echo '--- Building' $< '---'
@echo
@$(PSQL) -f $<


6 changes: 2 additions & 4 deletions comorbidity/postgres/clean.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: comorbidity scoring
-- MIMIC version: All
-- Author: Jim Blundell 2016
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------

DROP MATERIALIZED VIEW IF EXISTS ELIXHAUSER_AHRQ CASCADE;
4 changes: 0 additions & 4 deletions demographics/postgres/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------
## Title: Build file for demographics
## Description: Automated import of SQL scripts for demographics
## MIMIC version: MIMIC-III v1.3
## Author: Jim Blundell 2016
## ------------------------------------------------------------------

## Parameters ##
Expand Down Expand Up @@ -37,5 +35,3 @@ clean:
@echo '--- Building' $< '---'
@echo
@$(PSQL) -f $<


7 changes: 2 additions & 5 deletions demographics/postgres/clean.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: demographics
-- MIMIC version: All
-- Author: Jim Blundell 2016
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------

DROP MATERIALIZED VIEW IF EXISTS icustay_detail CASCADE;
DROP MATERIALIZED VIEW IF EXISTS heightweight CASCADE;

3 changes: 0 additions & 3 deletions etc/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------
## Title: Build file for etc and etc/firstday
## Description: Automated import of SQL scripts for etc and etc/firstday
## MIMIC version: MIMIC-III v1.3
## Author: Jim Blundell 2016
## ------------------------------------------------------------------

## Parameters ##
Expand Down Expand Up @@ -42,4 +40,3 @@ clean:
@echo '--- Building' $< '---'
@echo
@$(PSQL) -f $<

6 changes: 2 additions & 4 deletions etc/clean.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: misc clinical concepts
-- MIMIC version: All
-- Author: Jim Blundell 2016
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------

DROP MATERIALIZED VIEW IF EXISTS ECHODATA CASCADE;
DROP MATERIALIZED VIEW IF EXISTS rrt CASCADE;
Expand Down
7 changes: 2 additions & 5 deletions etc/firstday/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
## ------------------------------------------------------------------
## ------------------------------------------------------------------
## Title: Build file for etc/firstday
## Description: Automated import of SQL scripts for firstday
## MIMIC version: MIMIC-III v1.3
## Author: Jim Blundell 2016
## ------------------------------------------------------------------
## ------------------------------------------------------------------

## Parameters ##
# The top-level Makefile settings take precedence over this
Expand Down Expand Up @@ -35,4 +33,3 @@ clean:
@echo '--- Building' $< '---'
@echo
@$(PSQL) -f $<

2 changes: 0 additions & 2 deletions etc/firstday/blood-gas-first-day.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
-- This query is designed for MIMIC-III v1.3

-- The aim of this query is to pivot entries related to blood gases and
-- chemistry values which were found in LABEVENTS

Expand Down
6 changes: 2 additions & 4 deletions etc/firstday/clean.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: first day concepts
-- MIMIC version: All
-- Author: Jim Blundell 2016
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------

DROP MATERIALIZED VIEW IF EXISTS bloodgasfirstdayarterial CASCADE;
DROP MATERIALIZED VIEW IF EXISTS bloodgasfirstday CASCADE;
Expand Down
3 changes: 0 additions & 3 deletions etc/firstday/urine-output-first-day.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
-- ------------------------------------------------------------------
-- Purpose: Create a view of the urine output for each ICUSTAY_ID over the first 24 hours.
-- Tested on MIMIC-III v1.2
-- Written by: Alistair E. W. Johnson
-- References: TBA.
-- ------------------------------------------------------------------

create materialized view uofirstday as
Expand Down
4 changes: 1 addition & 3 deletions etc/firstday/ventilation-first-day.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
-- Determines if a patient is ventilated on the first day of their ICU stay.
-- Creates a table with the result.
-- Contact: [email protected]
-- Copyright 2015, Alistair Johnson

CREATE MATERIALIZED VIEW ventfirstday AS
-- group together the flags based on icustay_id
Expand Down Expand Up @@ -112,7 +110,7 @@ select
, case
when ce.itemid = 648 and value = 'Intubated/trach' THEN 1 -- Speech = intubated
else 0 end as SpeechIntubated

from icustays ie
left join chartevents ce
on ie.icustay_id = ce.icustay_id and ce.value is not null
Expand Down
4 changes: 0 additions & 4 deletions sepsis/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------
## Title: Build file for sepsis
## Description: Automated import of SQL scripts for sepsis
## MIMIC version: MIMIC-III v1.3
## Author: Jim Blundell 2016
## ------------------------------------------------------------------

## Parameters ##
Expand Down Expand Up @@ -39,5 +37,3 @@ clean:
@echo '--- Building' $< '---'
@echo
@$(PSQL) -f $<


23 changes: 10 additions & 13 deletions sepsis/angus.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
-- http://www.ncbi.nlm.nih.gov/pubmed/11445675

-- Case selection and definitions
-- To identify cases with severe sepsis, we selected all acute care
-- To identify cases with severe sepsis, we selected all acute care
-- hospitalizations with ICD-9-CM codes for both:
-- (a) a bacterial or fungal infectious process AND
-- (b) a diagnosis of acute organ dysfunction (Appendix 2).

-- By Sharukh Lokhandwala and Tom Pollard 2015
-- (a) a bacterial or fungal infectious process AND
-- (b) a diagnosis of acute organ dysfunction (Appendix 2).

-- Appendix 1: ICD9-codes (infection)
CREATE MATERIALIZED VIEW angus_sepsis as

WITH infection_group AS (
SELECT subject_id, hadm_id,
CASE
CASE
WHEN substring(icd9_code,1,3) IN ('001','002','003','004','005','008',
'009','010','011','012','013','014','015','016','017','018',
'020','021','022','023','024','025','026','027','030','031',
Expand All @@ -36,22 +34,22 @@ WITH infection_group AS (
-- Appendix 2: ICD9-codes (organ dysfunction)
organ_diag_group as (
SELECT subject_id, hadm_id,
CASE
CASE
-- Acute Organ Dysfunction Diagnosis Codes
WHEN substring(icd9_code,1,3) IN ('458','293','570','584') THEN 1
WHEN substring(icd9_code,1,4) IN ('7855','3483','3481',
'2874','2875','2869','2866','5734') THEN 1
'2874','2875','2869','2866','5734') THEN 1
ELSE 0 END AS organ_dysfunction,
-- Explicit diagnosis of severe sepsis or septic shock
CASE
CASE
WHEN substring(icd9_code,1,5) IN ('99592','78552') THEN 1
ELSE 0 END AS explicit_sepsis
FROM MIMICIII.DIAGNOSES_ICD),

-- Mechanical ventilation
organ_proc_group as (
SELECT subject_id, hadm_id,
CASE
CASE
WHEN substring(icd9_code,1,4) IN ('9670','9671','9672') THEN 1
ELSE 0 END AS mech_vent
FROM MIMICIII.PROCEDURES_ICD),
Expand All @@ -60,11 +58,11 @@ WITH infection_group AS (
aggregate as (
SELECT subject_id, hadm_id,
CASE
WHEN hadm_id in (SELECT DISTINCT hadm_id
WHEN hadm_id in (SELECT DISTINCT hadm_id
FROM infection_group
WHERE infection = 1) THEN 1
ELSE 0 END AS infection,
CASE
CASE
WHEN hadm_id in (SELECT DISTINCT hadm_id
FROM organ_diag_group
WHERE explicit_sepsis = 1) THEN 1
Expand All @@ -89,4 +87,3 @@ SELECT subject_id, hadm_id, infection,
WHEN infection = 1 AND mech_vent = 1 THEN 1
ELSE 0 END AS Angus
FROM aggregate;

6 changes: 2 additions & 4 deletions sepsis/clean.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: sepsis
-- MIMIC version: All
-- Author: Jim Blundell 2016
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------

DROP MATERIALIZED VIEW IF EXISTS angus_sepsis CASCADE;
3 changes: 0 additions & 3 deletions severityscores/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------
## Title: Build file for severityscores
## Description: Automated import of SQL scripts for severityscores
## MIMIC version: MIMIC-III v1.3
## Author: Jim Blundell 2016
## ------------------------------------------------------------------

## Parameters ##
Expand Down Expand Up @@ -38,4 +36,3 @@ clean:
@echo '--- Building' $< '---'
@echo
@$(PSQL) -f $<

11 changes: 4 additions & 7 deletions severityscores/apsiii.sql
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
-- ------------------------------------------------------------------
-- Title: Acute Physiology Score III (APS III)
-- MIMIC version: MIMIC-III v1.4
-- Originally written by: Alistair Johnson
-- Contact: aewj [at] mit [dot] edu
-- ------------------------------------------------------------------

-- This query extracts the acute physiology score III.
-- This score is a measure of patient severity of illness.
-- The score is calculated on the first day of each ICU patients' stay.
-- The score is calculated for *all* ICU patients, with the assumption that the user will subselect appropriate ICUSTAY_IDs.
-- For example, the score is calculated for neonates, but it is likely inappropriate to actually use the score values for these patients.
-- ------------------------------------------------------------------

-- Reference for APS III:
-- Knaus WA, Wagner DP, Draper EA, Zimmerman JE, Bergner M, Bastos PG, Sirio CA, Murphy DJ, Lotring T, Damiano A.
Expand All @@ -35,6 +29,9 @@
-- 4) gcsfirstday - generated by gcs-first-day.sql
-- 5) labsfirstday - generated by labs-first-day.sql

-- Note:
-- The score is calculated for *all* ICU patients, with the assumption that the user will subselect appropriate ICUSTAY_IDs.
-- For example, the score is calculated for neonates, but it is likely inappropriate to actually use the score values for these patients.

-- List of TODO:
-- The site of temperature is not incorporated. Axillary measurements should be increased by 1 degree.
Expand Down
6 changes: 2 additions & 4 deletions severityscores/clean.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: severity scores
-- MIMIC version: All
-- Author: Jim Blundell 2016
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------

DROP MATERIALIZED VIEW IF EXISTS APSIII CASCADE;
DROP MATERIALIZED VIEW IF EXISTS LODS CASCADE;
Expand Down
14 changes: 5 additions & 9 deletions severityscores/lods.sql
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
-- ------------------------------------------------------------------
-- Title: Logistic Organ Dysfunction Score (LODS)
-- MIMIC version: MIMIC-III v1.4
-- Originally written as sofa.sql by: Alistair Johnson
-- Edited as lods.sql by: Josh Gieringer
-- Contact: aewj [at] mit [dot] edu
-- Contact: joshua [dot] gieringer [at] digitalreasoning [dot] com
-- ------------------------------------------------------------------

-- This query extracts the logistic organ dysfunction system.
-- This score is a measure of organ failure in a patient.
-- The score is calculated on the first day of each ICU patients' stay.
-- The score is calculated for *all* ICU patients, with the assumption that the user will subselect appropriate ICUSTAY_IDs.
-- For example, the score is calculated for neonates, but it is likely inappropriate to actually use the score values for these patients.
-- ------------------------------------------------------------------

-- Reference for LODS:
-- Le Gall, J. R., Klar, J., Lemeshow, S., Saulnier, F., Alberti, C., Artigas, A., & Teres, D.
Expand All @@ -34,6 +26,10 @@
-- 5) labsfirstday - generated by labs-first-day.sql
-- 5) bloodgasfirstdayarterial - generated by blood-gas-first-day-arterial.sql

-- Note:
-- The score is calculated for *all* ICU patients, with the assumption that the user will subselect appropriate ICUSTAY_IDs.
-- For example, the score is calculated for neonates, but it is likely inappropriate to actually use the score values for these patients.

CREATE MATERIALIZED VIEW LODS as
-- extract CPAP from the "Oxygen Delivery Device" fields
with cpap as
Expand Down
9 changes: 5 additions & 4 deletions severityscores/mlods.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
-- ------------------------------------------------------------------
-- Title: Modified Logistic organ dysfunction system (mLODS)
-- Originally written by: Alistair Johnson
-- Contact: aewj [at] mit [dot] edu
-- ------------------------------------------------------------------

-- This query extracts a modified version of the logistic organ dysfunction system.
-- This score was used in the third international definition of sepsis: Sepsis-3.
-- This score is a measure of organ failure in a patient.
-- ------------------------------------------------------------------

-- Reference for LODS:
-- Le Gall, J. R., Klar, J., Lemeshow, S., Saulnier, F., Alberti, C., Artigas, A., & Teres, D.
Expand All @@ -28,6 +25,10 @@
-- Variables *excluded*, that are used in the original LODS:
-- prothrombin time (PT), blood urea nitrogen, urine output

-- Note:
-- The score is calculated for *all* ICU patients, with the assumption that the user will subselect appropriate ICUSTAY_IDs.
-- For example, the score is calculated for neonates, but it is likely inappropriate to actually use the score values for these patients.

CREATE MATERIALIZED VIEW MLODS as
-- extract CPAP from the "Oxygen Delivery Device" fields
with cpap as
Expand Down
Loading

0 comments on commit 98e30a4

Please sign in to comment.