Skip to content

fix: compare APS III equidistant arms to min not max - #2137

Open
Chessing234 wants to merge 3 commits into
MIT-LCP:mainfrom
Chessing234:fix/apsiii-equidistant-max-min
Open

fix: compare APS III equidistant arms to min not max#2137
Chessing234 wants to merge 3 commits into
MIT-LCP:mainfrom
Chessing234:fix/apsiii-equidistant-max-min

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • APS III “worst value” ties for resp rate, hematocrit, WBC, sodium, albumin, and glucose compared ABS(max − mid) = ABS(max − mid) instead of max vs min.
  • Align those arms with heart rate / MBP / temperature (and Knaus APS III furthest-from-normal selection). Updated MIMIC-III and MIMIC-IV BigQuery, Postgres, and DuckDB copies.

Test plan

  • No remaining ABS(*_max*) = ABS(*_max*) in any apsiii.sql
  • Equidistant example: glucose min=60, max=200 → still picks larger component score
  • sqlfluff / transpile CI on changed concepts

Made with Cursor

Chessing234 and others added 3 commits July 29, 2026 22:03
Worst-value ties incorrectly used ABS(max-mid)=ABS(max-mid).
Match heart rate / MBP / temp arms: compare max vs min.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace backslash-escaped D/C'd with LIKE so sqlglot can transpile
the BigQuery concept to postgres/duckdb.

Co-authored-by: Cursor <cursoragent@cursor.com>
Lint already ran; fork tokens cannot create check runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant