Permalink
Browse files

removed version and author from individual files, better to track in …

…github
  • Loading branch information...
1 parent 71b7a90 commit 98e30a408a3739dc6277f3db60ee9b52af3ff1eb @alistairewj alistairewj committed Sep 15, 2016
View
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Title: Top-level build file ## Title: Top-level build file
## Description: Automated import of data and SQL scripts ## Description: Automated import of data and SQL scripts
-## MIMIC version: MIMIC-III v1.4
-## Author: Jim Blundell 2016
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Parameters ## ## Parameters ##
@@ -107,4 +105,3 @@ clean:
@$(MAKE) -e -C severityscores 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 .PHONY: help mimic mimic-build mimic-download mimic-check mimic-gz mimic-build-gz mimic-check-gz extra etc comorbidity demographics sepsis severityscores
-
@@ -1,8 +1,6 @@
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
-- Title: Create the MIMIC-III tables -- Title: Create the MIMIC-III tables
-- Description: More detailed description explaining the purpose. -- Description: More detailed description explaining the purpose.
--- MIMIC version: MIMIC-III v1.3
--- Created by: paris nicolas
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
@@ -1,7 +1,5 @@
FROM postgres:latest FROM postgres:latest
-MAINTAINER Aaron J. Masino
-
# in the docker initialization, we do not build the data # in the docker initialization, we do not build the data
ENV BUILD_MIMIC 0 ENV BUILD_MIMIC 0
@@ -1,8 +1,6 @@
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
-- Title: Create the MIMIC-III tables -- Title: Create the MIMIC-III tables
-- Description: More detailed description explaining the purpose. -- Description: More detailed description explaining the purpose.
--- MIMIC version: MIMIC-III v1.3
--- Created by: paris nicolas
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
CREATE SCHEMA mimiciii; CREATE SCHEMA mimiciii;
@@ -1,8 +1,6 @@
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
-- Title: Load data into the MIMIC-III schema -- Title: Load data into the MIMIC-III schema
-- Description: More detailed description explaining the purpose. -- Description: More detailed description explaining the purpose.
--- MIMIC version: MIMIC-III v1.3
--- Created by: paris nicolas
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Title: Build file for comorbidity ## Title: Build file for comorbidity
## Description: Automated import of SQL scripts for comorbidity ## Description: Automated import of SQL scripts for comorbidity
-## MIMIC version: MIMIC-III v1.3
-## Author: Jim Blundell 2016
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Parameters ## ## Parameters ##
@@ -38,5 +36,3 @@ clean:
@echo '--- Building' $< '---' @echo '--- Building' $< '---'
@echo @echo
@$(PSQL) -f $< @$(PSQL) -f $<
-
-
@@ -1,8 +1,6 @@
--- ------------------------------------------------------------------ +-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean" -- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: comorbidity scoring -- Description: Drops all materialized views re: comorbidity scoring
--- MIMIC version: All +-- ------------------------------------------------------------------
--- Author: Jim Blundell 2016
--- ------------------------------------------------------------------
DROP MATERIALIZED VIEW IF EXISTS ELIXHAUSER_AHRQ CASCADE; DROP MATERIALIZED VIEW IF EXISTS ELIXHAUSER_AHRQ CASCADE;
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Title: Build file for demographics ## Title: Build file for demographics
## Description: Automated import of SQL scripts for demographics ## Description: Automated import of SQL scripts for demographics
-## MIMIC version: MIMIC-III v1.3
-## Author: Jim Blundell 2016
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Parameters ## ## Parameters ##
@@ -37,5 +35,3 @@ clean:
@echo '--- Building' $< '---' @echo '--- Building' $< '---'
@echo @echo
@$(PSQL) -f $< @$(PSQL) -f $<
-
-
@@ -1,10 +1,7 @@
--- ------------------------------------------------------------------ +-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean" -- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: demographics -- 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 icustay_detail CASCADE;
DROP MATERIALIZED VIEW IF EXISTS heightweight CASCADE; DROP MATERIALIZED VIEW IF EXISTS heightweight CASCADE;
-
View
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Title: Build file for etc and etc/firstday ## Title: Build file for etc and etc/firstday
## Description: Automated import of SQL scripts 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 ## ## Parameters ##
@@ -42,4 +40,3 @@ clean:
@echo '--- Building' $< '---' @echo '--- Building' $< '---'
@echo @echo
@$(PSQL) -f $< @$(PSQL) -f $<
-
View
@@ -1,9 +1,7 @@
--- ------------------------------------------------------------------ +-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean" -- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: misc clinical concepts -- 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 ECHODATA CASCADE;
DROP MATERIALIZED VIEW IF EXISTS rrt CASCADE; DROP MATERIALIZED VIEW IF EXISTS rrt CASCADE;
View
@@ -1,9 +1,7 @@
-## ------------------------------------------------------------------ +## ------------------------------------------------------------------
## Title: Build file for etc/firstday ## Title: Build file for etc/firstday
## Description: Automated import of SQL scripts for firstday ## Description: Automated import of SQL scripts for firstday
-## MIMIC version: MIMIC-III v1.3 +## ------------------------------------------------------------------
-## Author: Jim Blundell 2016
-## ------------------------------------------------------------------
## Parameters ## ## Parameters ##
# The top-level Makefile settings take precedence over this # The top-level Makefile settings take precedence over this
@@ -35,4 +33,3 @@ clean:
@echo '--- Building' $< '---' @echo '--- Building' $< '---'
@echo @echo
@$(PSQL) -f $< @$(PSQL) -f $<
-
@@ -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 -- The aim of this query is to pivot entries related to blood gases and
-- chemistry values which were found in LABEVENTS -- chemistry values which were found in LABEVENTS
View
@@ -1,9 +1,7 @@
--- ------------------------------------------------------------------ +-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean" -- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: first day concepts -- 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 bloodgasfirstdayarterial CASCADE;
DROP MATERIALIZED VIEW IF EXISTS bloodgasfirstday CASCADE; DROP MATERIALIZED VIEW IF EXISTS bloodgasfirstday CASCADE;
@@ -1,8 +1,5 @@
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
-- Purpose: Create a view of the urine output for each ICUSTAY_ID over the first 24 hours. -- 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 create materialized view uofirstday as
@@ -1,7 +1,5 @@
-- Determines if a patient is ventilated on the first day of their ICU stay. -- Determines if a patient is ventilated on the first day of their ICU stay.
-- Creates a table with the result. -- Creates a table with the result.
--- Contact: aewj@mit.edu
--- Copyright 2015, Alistair Johnson
CREATE MATERIALIZED VIEW ventfirstday AS CREATE MATERIALIZED VIEW ventfirstday AS
-- group together the flags based on icustay_id -- group together the flags based on icustay_id
@@ -112,7 +110,7 @@ select
, case , case
when ce.itemid = 648 and value = 'Intubated/trach' THEN 1 -- Speech = intubated when ce.itemid = 648 and value = 'Intubated/trach' THEN 1 -- Speech = intubated
else 0 end as SpeechIntubated else 0 end as SpeechIntubated
- +
from icustays ie from icustays ie
left join chartevents ce left join chartevents ce
on ie.icustay_id = ce.icustay_id and ce.value is not null on ie.icustay_id = ce.icustay_id and ce.value is not null
View
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Title: Build file for sepsis ## Title: Build file for sepsis
## Description: Automated import of SQL scripts for sepsis ## Description: Automated import of SQL scripts for sepsis
-## MIMIC version: MIMIC-III v1.3
-## Author: Jim Blundell 2016
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Parameters ## ## Parameters ##
@@ -39,5 +37,3 @@ clean:
@echo '--- Building' $< '---' @echo '--- Building' $< '---'
@echo @echo
@$(PSQL) -f $< @$(PSQL) -f $<
-
-
View
@@ -4,19 +4,17 @@
-- http://www.ncbi.nlm.nih.gov/pubmed/11445675 -- http://www.ncbi.nlm.nih.gov/pubmed/11445675
-- Case selection and definitions -- 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: -- hospitalizations with ICD-9-CM codes for both:
--- (a) a bacterial or fungal infectious process AND +-- (a) a bacterial or fungal infectious process AND
--- (b) a diagnosis of acute organ dysfunction (Appendix 2). +-- (b) a diagnosis of acute organ dysfunction (Appendix 2).
-
--- By Sharukh Lokhandwala and Tom Pollard 2015
-- Appendix 1: ICD9-codes (infection) -- Appendix 1: ICD9-codes (infection)
CREATE MATERIALIZED VIEW angus_sepsis as CREATE MATERIALIZED VIEW angus_sepsis as
WITH infection_group AS ( WITH infection_group AS (
SELECT subject_id, hadm_id, SELECT subject_id, hadm_id,
- CASE + CASE
WHEN substring(icd9_code,1,3) IN ('001','002','003','004','005','008', WHEN substring(icd9_code,1,3) IN ('001','002','003','004','005','008',
'009','010','011','012','013','014','015','016','017','018', '009','010','011','012','013','014','015','016','017','018',
'020','021','022','023','024','025','026','027','030','031', '020','021','022','023','024','025','026','027','030','031',
@@ -36,22 +34,22 @@ WITH infection_group AS (
-- Appendix 2: ICD9-codes (organ dysfunction) -- Appendix 2: ICD9-codes (organ dysfunction)
organ_diag_group as ( organ_diag_group as (
SELECT subject_id, hadm_id, SELECT subject_id, hadm_id,
- CASE + CASE
-- Acute Organ Dysfunction Diagnosis Codes -- Acute Organ Dysfunction Diagnosis Codes
WHEN substring(icd9_code,1,3) IN ('458','293','570','584') THEN 1 WHEN substring(icd9_code,1,3) IN ('458','293','570','584') THEN 1
WHEN substring(icd9_code,1,4) IN ('7855','3483','3481', 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, ELSE 0 END AS organ_dysfunction,
-- Explicit diagnosis of severe sepsis or septic shock -- Explicit diagnosis of severe sepsis or septic shock
- CASE + CASE
WHEN substring(icd9_code,1,5) IN ('99592','78552') THEN 1 WHEN substring(icd9_code,1,5) IN ('99592','78552') THEN 1
ELSE 0 END AS explicit_sepsis ELSE 0 END AS explicit_sepsis
FROM MIMICIII.DIAGNOSES_ICD), FROM MIMICIII.DIAGNOSES_ICD),
-- Mechanical ventilation -- Mechanical ventilation
organ_proc_group as ( organ_proc_group as (
SELECT subject_id, hadm_id, SELECT subject_id, hadm_id,
- CASE + CASE
WHEN substring(icd9_code,1,4) IN ('9670','9671','9672') THEN 1 WHEN substring(icd9_code,1,4) IN ('9670','9671','9672') THEN 1
ELSE 0 END AS mech_vent ELSE 0 END AS mech_vent
FROM MIMICIII.PROCEDURES_ICD), FROM MIMICIII.PROCEDURES_ICD),
@@ -60,11 +58,11 @@ WITH infection_group AS (
aggregate as ( aggregate as (
SELECT subject_id, hadm_id, SELECT subject_id, hadm_id,
CASE CASE
- WHEN hadm_id in (SELECT DISTINCT hadm_id + WHEN hadm_id in (SELECT DISTINCT hadm_id
FROM infection_group FROM infection_group
WHERE infection = 1) THEN 1 WHERE infection = 1) THEN 1
ELSE 0 END AS infection, ELSE 0 END AS infection,
- CASE + CASE
WHEN hadm_id in (SELECT DISTINCT hadm_id WHEN hadm_id in (SELECT DISTINCT hadm_id
FROM organ_diag_group FROM organ_diag_group
WHERE explicit_sepsis = 1) THEN 1 WHERE explicit_sepsis = 1) THEN 1
@@ -89,4 +87,3 @@ SELECT subject_id, hadm_id, infection,
WHEN infection = 1 AND mech_vent = 1 THEN 1 WHEN infection = 1 AND mech_vent = 1 THEN 1
ELSE 0 END AS Angus ELSE 0 END AS Angus
FROM aggregate; FROM aggregate;
-
View
@@ -1,8 +1,6 @@
--- ------------------------------------------------------------------ +-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean" -- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: sepsis -- Description: Drops all materialized views re: sepsis
--- MIMIC version: All +-- ------------------------------------------------------------------
--- Author: Jim Blundell 2016
--- ------------------------------------------------------------------
DROP MATERIALIZED VIEW IF EXISTS angus_sepsis CASCADE; DROP MATERIALIZED VIEW IF EXISTS angus_sepsis CASCADE;
View
@@ -1,8 +1,6 @@
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Title: Build file for severityscores ## Title: Build file for severityscores
## Description: Automated import of SQL scripts for severityscores ## Description: Automated import of SQL scripts for severityscores
-## MIMIC version: MIMIC-III v1.3
-## Author: Jim Blundell 2016
## ------------------------------------------------------------------ ## ------------------------------------------------------------------
## Parameters ## ## Parameters ##
@@ -38,4 +36,3 @@ clean:
@echo '--- Building' $< '---' @echo '--- Building' $< '---'
@echo @echo
@$(PSQL) -f $< @$(PSQL) -f $<
-
View
@@ -1,15 +1,9 @@
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
-- Title: Acute Physiology Score III (APS III) -- 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 query extracts the acute physiology score III.
-- This score is a measure of patient severity of illness. -- 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 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: -- Reference for APS III:
-- Knaus WA, Wagner DP, Draper EA, Zimmerman JE, Bergner M, Bastos PG, Sirio CA, Murphy DJ, Lotring T, Damiano A. -- Knaus WA, Wagner DP, Draper EA, Zimmerman JE, Bergner M, Bastos PG, Sirio CA, Murphy DJ, Lotring T, Damiano A.
@@ -35,6 +29,9 @@
-- 4) gcsfirstday - generated by gcs-first-day.sql -- 4) gcsfirstday - generated by gcs-first-day.sql
-- 5) labsfirstday - generated by labs-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: -- List of TODO:
-- The site of temperature is not incorporated. Axillary measurements should be increased by 1 degree. -- The site of temperature is not incorporated. Axillary measurements should be increased by 1 degree.
View
@@ -1,9 +1,7 @@
--- ------------------------------------------------------------------ +-- ------------------------------------------------------------------
-- Title: SQL clean script called by "make clean" -- Title: SQL clean script called by "make clean"
-- Description: Drops all materialized views re: severity scores -- 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 APSIII CASCADE;
DROP MATERIALIZED VIEW IF EXISTS LODS CASCADE; DROP MATERIALIZED VIEW IF EXISTS LODS CASCADE;
View
@@ -1,17 +1,9 @@
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
-- Title: Logistic Organ Dysfunction Score (LODS) -- 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 query extracts the logistic organ dysfunction system.
-- This score is a measure of organ failure in a patient. -- 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 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: -- Reference for LODS:
-- Le Gall, J. R., Klar, J., Lemeshow, S., Saulnier, F., Alberti, C., Artigas, A., & Teres, D. -- Le Gall, J. R., Klar, J., Lemeshow, S., Saulnier, F., Alberti, C., Artigas, A., & Teres, D.
@@ -34,6 +26,10 @@
-- 5) labsfirstday - generated by labs-first-day.sql -- 5) labsfirstday - generated by labs-first-day.sql
-- 5) bloodgasfirstdayarterial - generated by blood-gas-first-day-arterial.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 CREATE MATERIALIZED VIEW LODS as
-- extract CPAP from the "Oxygen Delivery Device" fields -- extract CPAP from the "Oxygen Delivery Device" fields
with cpap as with cpap as
View
@@ -1,12 +1,9 @@
-- ------------------------------------------------------------------ -- ------------------------------------------------------------------
-- Title: Modified Logistic organ dysfunction system (mLODS) -- 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 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 was used in the third international definition of sepsis: Sepsis-3.
-- This score is a measure of organ failure in a patient. -- This score is a measure of organ failure in a patient.
+-- ------------------------------------------------------------------
-- Reference for LODS: -- Reference for LODS:
-- Le Gall, J. R., Klar, J., Lemeshow, S., Saulnier, F., Alberti, C., Artigas, A., & Teres, D. -- Le Gall, J. R., Klar, J., Lemeshow, S., Saulnier, F., Alberti, C., Artigas, A., & Teres, D.
@@ -28,6 +25,10 @@
-- Variables *excluded*, that are used in the original LODS: -- Variables *excluded*, that are used in the original LODS:
-- prothrombin time (PT), blood urea nitrogen, urine output -- 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 CREATE MATERIALIZED VIEW MLODS as
-- extract CPAP from the "Oxygen Delivery Device" fields -- extract CPAP from the "Oxygen Delivery Device" fields
with cpap as with cpap as
Oops, something went wrong.

0 comments on commit 98e30a4

Please sign in to comment.