Repository navigation
fix: select lowest PaO2 in APS III oxygenation score - #2186
Open
chenyangsu wants to merge 1 commit into
Open
chenyangsu wants to merge 1 commit into
chenyangsu wants to merge 1 commit into
Conversation
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.
In MIMIC-IV and MIMIC-III
apsiii.sql, thepaCTE orders arterial blood gases withORDER BY bg.po2 DESCand joinspa.rn = 1, selecting the highest PaO2 instead of the lowest. On a stay with room-air PaO2 values of 45 and 95 mmHg,apsiiireturnspao2_aado2_score = 0rather than15per Knaus et al. (Chest 1991; 100(6):1619-1636, Table 3).Switched
ORDER BY bg.po2 DESCtoASCin both BigQuery sources, regenerated the Postgres and DuckDB copies withmimic_utils, and added a DuckDB regression test. Happy to drop the generated copies if you prefer the bot to update them.Testing:
pytest tests/test_apsiii.py tests/test_transpile.py tests/test_compare_concepts.py -q-> 340 passed (tests/test_apsiii.py: 2 failed onmain, 2 passed);sqlfluffonmimic-iv/concepts/score/apsiii.sql-> 0 violations.