Skip to content

Commit 2be3d01

Browse files
authored
Fix D/C\'d string escaping in neuroblock_dose.sql source and converted files
1 parent bc6f5f7 commit 2be3d01

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎mimic-iii/concepts/durations/neuroblock_dose.sql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ with drugmv as
2828
, 1 as drug
2929

3030
-- the 'stopped' column indicates if a drug has been disconnected
31-
, max(case when stopped in ('Stopped','D/C''d') then 1 else 0 end) as drug_stopped
31+
, max(case when stopped in ('Stopped','D/C\'d') then 1 else 0 end) as drug_stopped
3232

3333
-- we only include continuous infusions, therefore expect a rate
3434
, max(case
@@ -68,7 +68,7 @@ with drugmv as
6868
, 1 as drug
6969

7070
-- the 'stopped' column indicates if a drug has been disconnected
71-
, max(case when stopped in ('Stopped','D/C''d') then 1 else 0 end) as drug_stopped
71+
, max(case when stopped in ('Stopped','D/C\'d') then 1 else 0 end) as drug_stopped
7272
, max(case when valuenum <= 10 then 0 else 1 end) as drug_null
7373

7474
-- educated guess!

‎mimic-iii/concepts_duckdb/durations/neuroblock_dose.sql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WITH drugmv AS (
1818
icustay_id,
1919
charttime,
2020
1 AS drug,
21-
MAX(CASE WHEN stopped IN ('Stopped', 'D/C' || 'd') THEN 1 ELSE 0 END) AS drug_stopped,
21+
MAX(CASE WHEN stopped IN ('Stopped', 'D/C''d') THEN 1 ELSE 0 END) AS drug_stopped,
2222
MAX(
2323
CASE
2424
WHEN itemid >= 40000 AND NOT amount IS NULL
@@ -55,7 +55,7 @@ WITH drugmv AS (
5555
icustay_id,
5656
charttime,
5757
1 AS drug,
58-
MAX(CASE WHEN stopped IN ('Stopped', 'D/C' || 'd') THEN 1 ELSE 0 END) AS drug_stopped,
58+
MAX(CASE WHEN stopped IN ('Stopped', 'D/C''d') THEN 1 ELSE 0 END) AS drug_stopped,
5959
MAX(CASE WHEN valuenum <= 10 THEN 0 ELSE 1 END) AS drug_null,
6060
MAX(CASE WHEN valuenum <= 10 THEN valuenum ELSE NULL END) AS drug_rate,
6161
MAX(CASE WHEN valuenum > 10 THEN valuenum ELSE NULL END) AS drug_amount

‎mimic-iii/concepts_postgres/durations/neuroblock_dose.sql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ WITH drugmv AS (
2222
icustay_id,
2323
charttime, /* where clause below ensures all rows are instance of the drug */
2424
1 AS drug, /* the 'stopped' column indicates if a drug has been disconnected */
25-
MAX(CASE WHEN stopped IN ('Stopped', 'D/C' || 'd') THEN 1 ELSE 0 END) AS drug_stopped, /* we only include continuous infusions, therefore expect a rate */
25+
MAX(CASE WHEN stopped IN ('Stopped', 'D/C''d') THEN 1 ELSE 0 END) AS drug_stopped, /* we only include continuous infusions, therefore expect a rate */
2626
MAX(
2727
CASE
2828
WHEN itemid >= 40000 AND NOT amount IS NULL
@@ -60,7 +60,7 @@ WITH drugmv AS (
6060
icustay_id,
6161
charttime, /* where clause below ensures all rows are instance of the drug */
6262
1 AS drug, /* the 'stopped' column indicates if a drug has been disconnected */
63-
MAX(CASE WHEN stopped IN ('Stopped', 'D/C' || 'd') THEN 1 ELSE 0 END) AS drug_stopped,
63+
MAX(CASE WHEN stopped IN ('Stopped', 'D/C''d') THEN 1 ELSE 0 END) AS drug_stopped,
6464
MAX(CASE WHEN valuenum <= 10 THEN 0 ELSE 1 END) AS drug_null, /* educated guess! */
6565
MAX(CASE WHEN valuenum <= 10 THEN valuenum ELSE NULL END) AS drug_rate,
6666
MAX(CASE WHEN valuenum > 10 THEN valuenum ELSE NULL END) AS drug_amount

0 commit comments

Comments
 (0)