Internal transfers are counted as readmissions
メンテナーはふだん 3 日以内に返信
評価
調査の方向性
The issue provides a reproducer using admissions.csv.gz and points to the prior exclusion clause removed in PR #815; start by tracing the readmission-label logic and reviewing PR #815 and the open PR #1275. Compare how admissions less than an hour apart are labeled with the intended treatment of internal transfers. Done means the behavior is addressed or its intended configuration is clarified, with tests covering the relevant case.
索引モデルが issue の本文から書いたものです。
説明
Hi, first of all thank you for your repo; it has been useful for my research and very easy to use.
I have found an issue wherein internal transfers are counted as readmissions rather than treated as part of the same visit; which I think is surprising and probably not what most people want to model.
Reproduce (needs only admissions.csv.gz)
import polars as pl
pl.Config.set_fmt_str_lengths(60) # print full admission_location strings
adm = (
pl.read_csv("data/mimiciv/3.1/hosp/admissions.csv.gz", try_parse_dates=True)
.sort("subject_id", "admittime")
.with_columns(
next_admit=pl.col("admittime").shift(-1).over("subject_id"),
next_loc=pl.col("admission_location").shift(-1).over("subject_id")
)
.filter(pl.col("next_admit").is_not_null())
)
gap = pl.col("next_admit") - pl.col("dischtime")
pos = adm.filter(gap < pl.duration(days=30)) # the task's label rule
split = pos.filter(gap < pl.duration(hours=1))
print("total 30-day readmissions:", len(pos)) # 110k
print("readmissions within 1hr: ", len(split)) # 10k (~9%)
# second admisison_location
print(split["next_loc"].value_counts(sort=True).head(5))
# ┌────────────────────────────────────────┬───────┐
# │ next_loc ┆ count │
# │ --- ┆ --- │
# │ str ┆ u32 │
# ╞════════════════════════════════════════╪═══════╡
# │ INTERNAL TRANSFER TO OR FROM PSYCH ┆ 5609 │
# │ PHYSICIAN REFERRAL ┆ 1844 │
# │ EMERGENCY ROOM ┆ 1451 │
# │ TRANSFER FROM SKILLED NURSING FACILITY ┆ 535 │
# │ WALK-IN/SELF REFERRAL ┆ 103 │
# └────────────────────────────────────────┴───────┘
Possibly related to https://patch-diff.githubusercontent.com/raw/sunlabuiuc/PyHealth/pull/815.diff
which removed a clause excluding admissions within 3hrs of a prev. admission.
- if time_diff_hour <= 3:
- continue
A possible fix could be to merge admissions occuring within some time period and adding that as a configuration option and to emit some warning suggesting user's configure that value. I would imagine waiting for a major version change to change the default behaviour would be a good idea.
Environment: PyHealth 2.0.2, MIMIC-IV 3.1.
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 803
- 平均マージ
- 5日 16時間
- マージ済み PR(30日)
- 58
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sunlabuiuc/PyHealth のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
sunlabuiuc/PyHealth#1346 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
sunlabuiuc/PyHealth#1297 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
sunlabuiuc/PyHealth#1295 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
sunlabuiuc/PyHealth#1294 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
PyHealth 2.0: several modules still target the 1.x dataset API対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
sunlabuiuc/PyHealth#1201 · コメント 3 件 ·
メンテナーはふだん 3 日以内に返信
sunlabuiuc/PyHealth の issue をすべて見る
似ている issue
-
area/profiles comp/cli P3 type/feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NousResearch/hermes-agent#146372 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistencies対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
GeoSeries scale and skew tests fail with pytest 9.2.0対応中かも @jiayuasu が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
admission-deferred priority: medium status: ready work-class: scoped
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
melodic-software/claude-code-plugins#10887 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信