Skip to content

Commit

Permalink
Merge pull request #1476 from ZhipengHe/main
Browse files Browse the repository at this point in the history
Update row counts in validate scripts for mimic-iv-ed v2.2
  • Loading branch information
alistairewj authored Feb 4, 2023
2 parents 005b531 + 6908fa3 commit 570ef01
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
14 changes: 7 additions & 7 deletions mimic-iv-ed/buildmimic/mysql/validate.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Validate the MIMIC-IV-ED tables built correctly by checking against known row counts.
-- This check uses the MIMIC-IV-ED Demo, which is a subset of MIMIC-IV-ED.
-- Tested against MIMIC-IV-ED v2.2.
SELECT
CASE
WHEN exp.row_count = obs.row_count
Expand All @@ -10,12 +10,12 @@ SELECT
, obs.row_count AS obs
, exp.tbl as table_name
FROM (
SELECT 'edstays' AS tbl, 447712 AS row_count UNION ALL
SELECT 'diagnosis' AS tbl, 946692 AS row_count UNION ALL
SELECT 'medrecon' AS tbl, 3143791 AS row_count UNION ALL
SELECT 'pyxis' AS tbl, 1670590 AS row_count UNION ALL
SELECT 'triage' AS tbl, 447712 AS row_count UNION ALL
SELECT 'vitalsign' AS tbl, 1646976 AS row_count
SELECT 'edstays' AS tbl, 425087 AS row_count UNION ALL
SELECT 'diagnosis' AS tbl, 899050 AS row_count UNION ALL
SELECT 'medrecon' AS tbl, 2987342 AS row_count UNION ALL
SELECT 'pyxis' AS tbl, 1586053 AS row_count UNION ALL
SELECT 'triage' AS tbl, 425087 AS row_count UNION ALL
SELECT 'vitalsign' AS tbl, 1564610 AS row_count
) exp
INNER JOIN (
SELECT 'edstays' AS tbl, COUNT(*) AS row_count FROM edstays UNION ALL
Expand Down
15 changes: 8 additions & 7 deletions mimic-iv-ed/buildmimic/postgres/validate.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
-- Validate the MIMIC-IV tables built correctly by checking against known row counts.
-- Validate the MIMIC-IV-ED tables built correctly by checking against known row counts.
-- Tested against MIMIC-IV-ED v2.2.
WITH expected AS
(
SELECT 'edstays' AS tbl, 447712 AS row_count UNION ALL
SELECT 'diagnosis' AS tbl, 946692 AS row_count UNION ALL
SELECT 'medrecon' AS tbl, 3143791 AS row_count UNION ALL
SELECT 'pyxis' AS tbl, 1670590 AS row_count UNION ALL
SELECT 'triage' AS tbl, 447712 AS row_count UNION ALL
SELECT 'vitalsign' AS tbl, 1646976 AS row_count
SELECT 'edstays' AS tbl, 425087 AS row_count UNION ALL
SELECT 'diagnosis' AS tbl, 899050 AS row_count UNION ALL
SELECT 'medrecon' AS tbl, 2987342 AS row_count UNION ALL
SELECT 'pyxis' AS tbl, 1586053 AS row_count UNION ALL
SELECT 'triage' AS tbl, 425087 AS row_count UNION ALL
SELECT 'vitalsign' AS tbl, 1564610 AS row_count
)
, observed as
(
Expand Down

0 comments on commit 570ef01

Please # to comment.