Skip to content

fix: include wbc_max in SIRS WBC missing-data guard - #2146

Open
Chessing234 wants to merge 1 commit into
MIT-LCP:mainfrom
Chessing234:fix/sirs-wbc-max-null-guard
Open

fix: include wbc_max in SIRS WBC missing-data guard#2146
Chessing234 wants to merge 1 commit into
MIT-LCP:mainfrom
Chessing234:fix/sirs-wbc-max-null-guard

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • SIRS WBC scoring uses wbc_min, wbc_max, and bands_max, but the missing-data arm only checked COALESCE(wbc_min, bands_max).
  • When only wbc_max is present (and normal), the CASE fell through to NULL instead of 0.
  • Update BigQuery, Postgres, and DuckDB copies for MIMIC-III and MIMIC-IV.

Test plan

  • Row with NULL wbc_min/bands_max and present normal wbc_maxwbc_score = 0
  • All three NULL → wbc_score remains NULL
  • Elevated wbc_max / low wbc_min / high bands_max still score 1

Made with Cursor

@Chessing234
Chessing234 force-pushed the fix/sirs-wbc-max-null-guard branch from 37b38f6 to ff7517b Compare August 5, 2026 10:32
WBC scoring uses wbc_min, wbc_max, and bands_max, but the null arm only
checked coalesce(wbc_min, bands_max), so a present wbc_max alone yielded
NULL instead of 0. Align the guard across BigQuery, Postgres, and DuckDB.
@Chessing234
Chessing234 force-pushed the fix/sirs-wbc-max-null-guard branch from ff7517b to 4a1cd36 Compare August 9, 2026 13:39

@alistairewj alistairewj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is a no-op because wbc_min and wbc_max are always null/not-null together - please try to avoid PRs which "fix" surface level issues that do not actually appear in the data

@alistairewj

Copy link
Copy Markdown
Member

needs rebasing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants