Internal transfers are counted as readmissions
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 1.7k
- Forks
- 803
- Merge médio
- 4d 18h
- PRs com merge (30d)
- 58
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de sunlabuiuc/PyHealth
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
sunlabuiuc/PyHealth#1357 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
sunlabuiuc/PyHealth#1346 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
sunlabuiuc/PyHealth#1297 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 22/100
sunlabuiuc/PyHealth#1295 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 42/100
sunlabuiuc/PyHealth#1294 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
Todas as issues de sunlabuiuc/PyHealth
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
-
[Bug]: Responses API 500s on assistant message with empty content listTalvez já em andamento @shadowmodder assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
vllm-project/vllm#64940 ·
Mantenedores costumam responder em até 1 dia
-
Limit should define bound_symbolsTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertalimits
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
agent-ready area: docs documentation good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Soneso/stellar-agent-wallet#524 ·
Mantenedores costumam responder em até 1 dia
-
Keybind quest outdatedAbertaStatus: Triage Type: Quest
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
GTNewHorizons/GT-New-Horizons-Modpack#27490 ·
Mantenedores costumam responder em até 1 dia