Add INSPIRE dataset — task-contract predicates + INSPIRE-MEDS 0.1.0#320
Open
florian6973 wants to merge 4 commits into
Open
Add INSPIRE dataset — task-contract predicates + INSPIRE-MEDS 0.1.0#320florian6973 wants to merge 4 commits into
florian6973 wants to merge 4 commits into
Conversation
Rewrites the INSPIRE predicates so the shared MEDS-DEV tasks actually resolve
against a built INSPIRE cohort. Verified against a full INSPIRE v1.4.2 build
(100 shards, 3,230 codes; metadata/codes.parquet + value distributions).
The original predicates matched ZERO events and used non-contract names:
- LAB / WARD_VITAL codes had unit and name reversed. Codes are built as
"LAB//<item_name>//<unit>" / "WARD_VITAL//<item_name>//<unit>"
(INSPIRE_MEDS/configs/event_configs.yaml), not unit-first.
- Structural predicates used "^X//.*" regexes (copied from MIMIC-IV, whose
codes carry a "//" suffix); INSPIRE emits BARE scalar codes -> use exact codes.
- Predicate NAMES (creatinine_mgdl, sodium_meql, wbc_kul, platelets_kul,
map_mmhg) did not match the names the tasks reference (creatinine, sodium,
wbc, platelets, map, + abnormally_* thresholds), so no lab/vital task wired up.
Changes:
- Structural: exact HOSPITAL_ADMISSION / HOSPITAL_DISCHARGE / ICU_ADMISSION /
ICU_DISCHARGE.
- Renamed to the task-contract names and added the missing abnormally_*
threshold predicates (creatinine>1.3, sodium<135, bicarbonate<22,
hemoglobin<13, wbc>11, platelets<150, map<65). Thresholds copied unchanged
from MIMIC-IV — INSPIRE's native units are numerically equivalent
(mmol/L==mEq/L, /nL==K/uL). Each threshold uses a single plain-string code
(es-aces applies value_min/value_max only to plain codes), MAP as or(...) of
per-code thresholds (mirrors MIMIC-IV).
- Added bicarbonate (LAB//hco3//mmol/L) and hemoglobin (LAB//hb//g/dL), which
were absent; both exist in the built cohort.
- Dropped VITAL//pap_mbp//mmHg from MAP (pulmonary-artery, not systemic MAP).
This wires up all 8 shared tasks (abnormal_lab/{elevated_creatinine,hyponatremia,
metabolic_acidosis,anemia,leukocytosis,thrombocytopenia,hypotension}/first_24h and
mortality/in_icu/first_24h). Remaining step to advertise support: add INSPIRE to
each task's metadata.supported_datasets. INSPIRE has no ED encounters, so the
MIMIC ED_registration/ED_discharge predicates are intentionally omitted.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
INSPIRE-MEDS 0.1.0 (PyPI, 2026-07-17) adds reading of gzipped raw tables, so the current PhysioNet 1.4.x layout (operations.csv.gz, labs.csv.gz, ...) builds directly with no manual decompression. Drop-in: 0.1.0 keeps the same meds-transforms~=0.2.4 pin and an identical event_configs.yaml (code construction unchanged), so the predicates here are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Add INSPIRE dataset — task-contract predicates + INSPIRE-MEDS 0.1.0
Registers the INSPIRE (VitalDB / SNUH) dataset. This builds on the work in #308 (its registration commits are included and preserved) and adds two corrections so INSPIRE works end-to-end against the shared tasks and the current PhysioNet layout.
Contents
INSPIRE dataset registration —
README.md,dataset.yaml,refs.bib(from Add the INSPIRE dataset #308).predicates.yaml— rewritten to the MEDS-DEV task contract. The original predicates matched zero events and could not drive any shared task:LAB//<name>//<unit>, e.g.LAB//creatinine//mg/dL, not unit-first);^X//.*regexes (copied from MIMIC-IV, whose codes carry a//suffix), but INSPIRE emits bare scalar codes (HOSPITAL_ADMISSION,ICU_ADMISSION, …);creatinine_mgdl,map_mmhg, …) didn't match the names the tasks reference, and there were noabnormally_*thresholds.This version uses the task-contract names + adds the threshold predicates (creatinine>1.3, sodium<135, bicarbonate<22, hemoglobin<13, wbc>11, platelets<150; MAP<65), with units transferred from MIMIC-IV (INSPIRE's native units are numerically equivalent). Verified against a full INSPIRE 1.4.2 build (data vocab + value distributions): 7 of 8 shared tasks resolve through ACES with non-degenerate thresholds — all except any ED-based task (INSPIRE has no ED encounters, so
ED_registration/ED_dischargeare intentionally omitted).requirements.txt—INSPIRE-MEDS==0.1.0(was0.0.13). 0.1.0 adds native reading of gzipped raw tables, so the current PhysioNet 1.4.x layout (operations.csv.gz,labs.csv.gz, …) builds with no manual decompression. Drop-in: samemeds-transforms~=0.2.4pin and a byte-identicalevent_configs.yaml, so the predicates above are unaffected.Notes
INSPIREto each supported task'smetadata.supported_datasets.🤖 Generated with Claude Code