Fix KDIGO AKI Stage 3 SCr criterion to use a +0.3 increase instead of hardcoded 3.7#2006
Closed
Chessing234 wants to merge 1 commit into
Closed
Fix KDIGO AKI Stage 3 SCr criterion to use a +0.3 increase instead of hardcoded 3.7#2006Chessing234 wants to merge 1 commit into
Chessing234 wants to merge 1 commit into
Conversation
… hardcoded 3.7 The Stage 3 branch for patients reaching SCr >= 4.0 mg/dL is supposed to require an acute increase of >= 0.3 within 48h (or >= 1.5x baseline). The condition was written as creat_low_past_48hr <= 3.7, which only equals a 0.3 increase when creat is exactly 4.0. For any creatinine above 4.0 (e.g. creat = 5.0 with a 48h low of 3.8) the real increase can be well above 0.3 yet still be missed, so genuine Stage 3 AKI is not flagged. Replace the hardcoded 3.7 with creat >= creat_low_past_48hr + 0.3. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
In
kdigo_stages.sql, the creatinine-based AKI Stage 3 branch for patients reaching SCr >= 4.0 mg/dL is meant to require an acute increase of >= 0.3 within 48 hours (or >= 1.5x baseline), per the KDIGO 2012 AKI guideline (p.21). It is implemented as:Root cause
The hardcoded
creat_low_past_48hr <= 3.7only encodes a 0.3 increase whencreatis exactly 4.0 (4.0 − 3.7 = 0.3). For any creatinine above 4.0 the test no longer matches the intended threshold. For example,creat = 5.0with a 48h low of3.8is a real increase of 1.2 mg/dL — clearly Stage 3 — yet3.8 <= 3.7is false and the 1.5x-baseline arm may also fail, so the patient is not flagged.Fix
Replace the hardcoded
3.7with the actual >= 0.3 increase condition, matching the comment directly above it:This is the change confirmed by the maintainer in #1357. Applied to both the MIMIC-IV and MIMIC-III BigQuery source files (the reporter noted both are affected). The
concepts_postgres/concepts_duckdbcopies are auto-generated from these sources and should be regenerated via the conversion scripts.Fixes #1357