Chtholly17 commited on
Commit
7c3f33f
·
verified ·
1 Parent(s): ee190a9

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. README.md +286 -223
  2. data/ehr_bench/database/patient_10020435.db +0 -0
  3. data/ehr_bench/database/patient_10030351.db +0 -0
  4. data/ehr_bench/database/patient_10242272.db +0 -0
  5. data/ehr_bench/database/patient_10422514.db +0 -0
  6. data/ehr_bench/database/patient_10662076.db +0 -0
  7. data/ehr_bench/database/patient_10964841.db +0 -0
  8. data/ehr_bench/database/patient_11036842.db +0 -0
  9. data/ehr_bench/database/patient_11280175.db +0 -0
  10. data/ehr_bench/database/patient_11294136.db +0 -0
  11. data/ehr_bench/database/patient_11871866.db +0 -0
  12. data/ehr_bench/database/patient_12031986.db +0 -0
  13. data/ehr_bench/database/patient_12224937.db +0 -0
  14. data/ehr_bench/database/patient_12267502.db +0 -0
  15. data/ehr_bench/database/patient_12561976.db +0 -0
  16. data/ehr_bench/database/patient_13018384.db +0 -0
  17. data/ehr_bench/database/patient_13226434.db +0 -0
  18. data/ehr_bench/database/patient_13328445.db +0 -0
  19. data/ehr_bench/database/patient_13891488.db +0 -0
  20. data/ehr_bench/database/patient_13894320.db +0 -0
  21. data/ehr_bench/database/patient_14248472.db +0 -0
  22. data/ehr_bench/database/patient_14289335.db +0 -0
  23. data/ehr_bench/database/patient_14303624.db +0 -0
  24. data/ehr_bench/database/patient_14520269.db +0 -0
  25. data/ehr_bench/database/patient_14593559.db +0 -0
  26. data/ehr_bench/database/patient_14609898.db +0 -0
  27. data/ehr_bench/database/patient_14695800.db +0 -0
  28. data/ehr_bench/database/patient_14862845.db +0 -0
  29. data/ehr_bench/database/patient_14939811.db +0 -0
  30. data/ehr_bench/database/patient_15373376.db +0 -0
  31. data/ehr_bench/database/patient_15548906.db +0 -0
  32. data/ehr_bench/database/patient_15737898.db +0 -0
  33. data/ehr_bench/database/patient_15772513.db +0 -0
  34. data/ehr_bench/database/patient_15928635.db +0 -0
  35. data/ehr_bench/database/patient_16246807.db +0 -0
  36. data/ehr_bench/database/patient_17333198.db +0 -0
  37. data/ehr_bench/database/patient_17618004.db +0 -0
  38. data/ehr_bench/database/patient_17677136.db +0 -0
  39. data/ehr_bench/database/patient_17736601.db +0 -0
  40. data/ehr_bench/database/patient_17776468.db +0 -0
  41. data/ehr_bench/database/patient_17791031.db +0 -0
  42. data/ehr_bench/database/patient_17938709.db +0 -0
  43. data/ehr_bench/database/patient_18050457.db +0 -0
  44. data/ehr_bench/database/patient_18106293.db +0 -0
  45. data/ehr_bench/database/patient_18264239.db +0 -0
  46. data/ehr_bench/database/patient_18295608.db +0 -0
  47. data/ehr_bench/database/patient_18358187.db +0 -0
  48. data/ehr_bench/table_description/link_information.json +10 -0
  49. data/ehr_bench/table_description/shorten_description.json +51 -0
  50. data/ehr_bench/table_description/table_description.json +0 -0
README.md CHANGED
@@ -13,270 +13,333 @@ size_categories:
13
  - 1K<n<10K
14
  configs:
15
  - config_name: ehr_bench
16
- data_files: "ehr_bench/all_inputs.jsonl"
17
  - config_name: mm_bench
18
- data_files: "mm_bench/all_inputs.jsonl"
19
  ---
20
 
21
  # ClinSeek-Bench
22
 
23
- Inputs (questions, patient context, gold labels) for the **ClinSeek** clinical-reasoning evaluation reported in
24
- `UCSC-VLAA/ClinSeek-Evaluation-Results` under `hierarchical/`.
 
25
 
26
- This dataset contains **the exact data points evaluated** every `qid` in this dataset has matching scored outputs in *both*
27
- `hierarchical/agentic/` and `hierarchical/oneshot/` of the results dataset. The two modes share an identical question set, so
28
- the same data point can be evaluated under either an **agentic** rollout (multi-turn tool use) or a **one-shot** rollout
29
- (single LLM call), producing two scores per data point per model.
 
30
 
31
- ## Contents
 
 
 
 
32
 
33
- | Split | # data points | Modality | Source |
34
- |---|---:|---|---|
35
- | `ehr_bench` | **1,800** | text-only | MIMIC-IV electronic health records |
36
- | `mm_bench` | **989** | multimodal (text + chest X-ray) | MIMIC-CXR images linked to MIMIC-IV / EHR-XQA-style questions |
37
- | **Total** | **2,789** | | |
38
 
39
- `mm_bench` here is restricted to **image-grounded** questions only. The text-only multimodal queries (`L2.ehr_query`, n = 1,704
40
- in the upstream `combined_test_set.jsonl`) were **excluded** because they are EHR-only and not part of the multimodal
41
- evaluation track.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  ## Directory layout
44
 
45
  ```
46
  ClinSeek-Bench/
47
- ├── README.md # this file
48
- ├── manifest.jsonl # qid → taxonomy + result-path templates
49
-
50
- ── ehr_bench/
51
- │ ├── all_inputs.jsonl # flat: 1,800 rows, all ehr_bench inputs
52
- │ └── L1.text_only/
53
- ├── L2.decision_making/ # 27 leaves × 40 rows = 1,080 rows
54
- ── L3.<sub-family>/
55
- └── L4.<task>/
56
- └── inputs.jsonl
57
- ── L2.risk_prediction/ # 18 leaves × 40 rows = 720 rows
58
- ── L3.<sub-family>/
59
- └── L4.<task>/
60
- └── inputs.jsonl
61
-
62
- ── mm_bench/
63
- ├── all_inputs.jsonl # flat: 989 rows, all multimodal inputs
64
- └── L1.multimodal/
65
- ── L2.cxr_vqa/ # 619 rows: presence / enumeration / change
66
- │ └── L3.<sub-family>/L4.<task>/inputs.jsonl
67
- ├── L2.risk_prediction_mm/ # 250 rows: 24-h + full-stay mortality
68
- └── L3.<sub-family>/L4.<task>/inputs.jsonl
69
- └── L2.phenotyping_mm/ # 120 rows: CCS phenotype classification
70
- └── L3.<sub-family>/L4.<task>/inputs.jsonl
71
  ```
72
 
73
- The `L1 / L2 / L3 / L4` tags are an evaluation taxonomy:
74
- - **L1** — modality (`text_only` or `multimodal`)
75
- - **L2** task family (e.g. `decision_making`, `risk_prediction`, `cxr_vqa`)
76
- - **L3** — sub-family (e.g. `Diagnosis_coding`, `ICU_Mortality`, `cxr_vqa_presence`)
77
- - **L4** — concrete task (e.g. `diagnoses_ccs`, `ICU_Mortality_3day`, `cxr_finding_presence`)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
- The taxonomy is identical to the one used by the result repository, so the `(bench, L1, L2, L3, L4)` tuple acts as a stable
80
- join key across input ↔ result.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
- ## Schema
 
 
 
 
83
 
84
- ### `ehr_bench/**/inputs.jsonl`
85
 
86
- Each row is one EHR-Bench data point.
87
 
88
  ```jsonc
89
- {
90
- "idx": 0, // original index in upstream ehr_bench_*.jsonl
91
- "qid": "ehr_bench_decision_making_0", // stable id; matches result rows.jsonl
92
- "instruction": "Given the sequence of events ...", // task instruction
93
- "input": "## Patient Demographics ...", // patient context (markdown of structured EHR)
94
- "output": "OBSERVATION ADMIT", // gold answer (string for single-label tasks)
95
- "candidates": ["...", "..."], // discrete answer choices (when applicable)
96
- "task_info": {
97
- "target_key": "admission_type",
98
- "metric": "em",
99
- "task_type": "decision_making",
100
- "task": "admissions",
101
- "event": "admissions",
102
- "target": "[\"OBSERVATION ADMIT\"]",
103
- "label": ["OBSERVATION ADMIT"] // gold answer as list (canonical form)
104
- },
105
- "taxonomy": { // added by us — routing key
106
- "bench": "ehr_bench",
107
- "L1": "L1.text_only",
108
- "L2": "L2.decision_making",
109
- "L3": "L3.Transfers_Services_Admissions",
110
- "L4": "L4.admissions"
111
  }
112
- }
113
  ```
114
 
115
- ### `mm_bench/**/inputs.jsonl`
116
-
117
- Each row is one multimodal data point with one or more linked CXR images.
118
 
119
  ```jsonc
120
  {
121
- "qid": "medmod_radiology_test_56445431", // stable id; matches result rows.jsonl
122
- "question": "<task_instruction>...<question>...", // self-contained prompt text
123
- "image_paths": ["mimic-cxr/2.0.0/files/p17/p17795062/s56445431/<dicom>.jpg"],
124
- "subject_id": 17795062,
125
- "study_ids": [56445431],
126
- "dicom_ids": ["a69ab575-cc7ec66c-..."],
127
- "stay_id": 39825171,
128
  "hadm_id": 22792685,
 
129
  "prediction_time": "2177-07-25 22:04:23",
130
- "label": [{"name": "Cardiomegaly"}, {"name": "Support Devices"}], // gold answer
131
- "task": "medmod_radiology",
132
- "db_path_hint": "database/patient_17795062.db",
133
- "source_benchmark": "medmod",
 
 
 
 
 
134
  "source_split": "test",
135
- "task_family": "qa",
136
- "answer_type": "list",
137
- "taxonomy": {
138
- "bench": "mm_bench",
139
- "L1": "L1.multimodal",
140
- "L2": "L2.cxr_vqa",
141
- "L3": "L3.cxr_vqa_presence",
142
- "L4": "L4.cxr_finding_presence"
143
- }
144
- }
145
- ```
146
-
147
- > **Images are not bundled with this dataset.** The `image_paths` follow the upstream
148
- > [MIMIC-CXR JPG](https://physionet.org/content/mimic-cxr-jpg/) layout. To reproduce the multimodal evaluation, download
149
- > MIMIC-CXR-JPG from PhysioNet (it requires credentialed access) and resolve `image_paths` against your local mirror.
150
-
151
- ### `manifest.jsonl`
152
-
153
- A flat join key for the whole dataset. One row per data point:
154
-
155
- ```jsonc
156
- {
157
- "qid": "ehr_bench_decision_making_0",
158
- "bench": "ehr_bench",
159
- "L1": "L1.text_only",
160
- "L2": "L2.decision_making",
161
- "L3": "L3.Transfers_Services_Admissions",
162
- "L4": "L4.admissions",
163
- "inputs_path": "ehr_bench/L1.text_only/L2.decision_making/L3.Transfers_Services_Admissions/L4.admissions/inputs.jsonl",
164
- "result_path_template": "hierarchical/{mode}/ehr_bench/{model}/L1.text_only/L2.decision_making/L3.Transfers_Services_Admissions/L4.admissions/rows.jsonl"
165
  }
166
  ```
167
 
168
- `{mode} {agentic, oneshot}` and `{model}` is one of the model slugs evaluated in the result dataset
169
- (e.g. `claude_opus_4_6`, `kimi_k2_5`, `qwen3_5_35b_a3b`, …). The format inside that `rows.jsonl` is:
 
 
170
 
171
- ```jsonc
172
- { "qid": "...", "f1": 1.0, "precision": 1.0, "recall": 1.0,
173
- "gold": ["..."], "pred": ["..."], "bench": "ehr_bench" }
174
- ```
175
 
176
- ## Same data point under two modes
177
-
178
- Every `qid` here appears **once in `agentic/` and once in `oneshot/`** in the result dataset. To pull both rollouts of one
179
- data point under one model, use the `result_path_template` from `manifest.jsonl` and substitute `{mode}` twice:
180
 
181
  ```python
182
- import json
183
-
184
- # Pick one data point.
185
- with open("manifest.jsonl") as f:
186
- rec = json.loads(next(f)) # qid = ehr_bench_decision_making_0
187
-
188
- # Load its question + gold from the inputs side (this dataset).
189
- with open(rec["inputs_path"]) as f:
190
- qrow = next(r for l in f if (r := json.loads(l))["qid"] == rec["qid"])
191
-
192
- # Load both modes from the result dataset (UCSC-VLAA/ClinSeek-Evaluation-Results).
193
- def load_score(model, mode):
194
- path = rec["result_path_template"].format(mode=mode, model=model)
195
- with open(path) as f:
196
- return next(r for l in f if (r := json.loads(l))["qid"] == rec["qid"])
197
-
198
- agentic = load_score("claude_opus_4_6", "agentic")
199
- oneshot = load_score("claude_opus_4_6", "oneshot")
200
- print(qrow["instruction"], "→ gold:", agentic["gold"])
 
 
 
 
201
  print("agentic F1:", agentic["f1"], "| oneshot F1:", oneshot["f1"])
202
  ```
203
 
204
- The two scores are directly comparable: same prompt, same gold, different agent stack.
205
-
206
- ## Tasks (L4 leaf table)
207
-
208
- | bench | L1 (modality) | L2 (family) | L3 (sub-family) | L4 (task) | N |
209
- |---|---|---|---|---|---|
210
- | ehr_bench | L1.text_only | L2.decision_making | L3.Diagnosis_coding | L4.diagnoses_ccs | 40 |
211
- | ehr_bench | L1.text_only | L2.decision_making | L3.Diagnosis_coding | L4.diagnoses_icd | 40 |
212
- | ehr_bench | L1.text_only | L2.decision_making | L3.Diagnosis_coding | L4.diagnosis | 40 |
213
- | ehr_bench | L1.text_only | L2.decision_making | L3.Diagnosis_coding | L4.diagnosis_ccs | 40 |
214
- | ehr_bench | L1.text_only | L2.decision_making | L3.ICU_Events | L4.chartevents | 40 |
215
- | ehr_bench | L1.text_only | L2.decision_making | L3.ICU_Events | L4.datetimeevents | 40 |
216
- | ehr_bench | L1.text_only | L2.decision_making | L3.ICU_Events | L4.ingredientevents | 40 |
217
- | ehr_bench | L1.text_only | L2.decision_making | L3.ICU_Events | L4.inputevents | 40 |
218
- | ehr_bench | L1.text_only | L2.decision_making | L3.ICU_Events | L4.outputevents | 40 |
219
- | ehr_bench | L1.text_only | L2.decision_making | L3.Lab_Microbiology_orders | L4.labevents | 40 |
220
- | ehr_bench | L1.text_only | L2.decision_making | L3.Lab_Microbiology_orders | L4.microbiologyevents | 40 |
221
- | ehr_bench | L1.text_only | L2.decision_making | L3.Medication_suggestion | L4.emar | 40 |
222
- | ehr_bench | L1.text_only | L2.decision_making | L3.Medication_suggestion | L4.medrecon | 40 |
223
- | ehr_bench | L1.text_only | L2.decision_making | L3.Medication_suggestion | L4.medrecon_atc | 40 |
224
- | ehr_bench | L1.text_only | L2.decision_making | L3.Medication_suggestion | L4.prescriptions | 40 |
225
- | ehr_bench | L1.text_only | L2.decision_making | L3.Medication_suggestion | L4.prescriptions_atc | 40 |
226
- | ehr_bench | L1.text_only | L2.decision_making | L3.Medication_suggestion | L4.pyxis | 40 |
227
- | ehr_bench | L1.text_only | L2.decision_making | L3.Next_Event | L4.next_event | 40 |
228
- | ehr_bench | L1.text_only | L2.decision_making | L3.Outpatient_Records | L4.omr | 40 |
229
- | ehr_bench | L1.text_only | L2.decision_making | L3.Procedure_coding | L4.procedureevents | 40 |
230
- | ehr_bench | L1.text_only | L2.decision_making | L3.Procedure_coding | L4.procedures_ccs | 40 |
231
- | ehr_bench | L1.text_only | L2.decision_making | L3.Procedure_coding | L4.procedures_icd | 40 |
232
- | ehr_bench | L1.text_only | L2.decision_making | L3.Provider_Orders | L4.poe | 40 |
233
- | ehr_bench | L1.text_only | L2.decision_making | L3.Radiology_Orders | L4.radiology | 40 |
234
- | ehr_bench | L1.text_only | L2.decision_making | L3.Transfers_Services_Admissions | L4.admissions | 40 |
235
- | ehr_bench | L1.text_only | L2.decision_making | L3.Transfers_Services_Admissions | L4.services | 40 |
236
- | ehr_bench | L1.text_only | L2.decision_making | L3.Transfers_Services_Admissions | L4.transfers | 40 |
237
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ED_Critical_Outcomes | L4.ED_Critical_Outcomes | 40 |
238
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ED_Hospitalization | L4.ED_Hospitalization | 40 |
239
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ED_ICU_Transfer_12h | L4.ED_ICU_Tranfer_12hour | 40 |
240
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ED_Reattendance_3day | L4.ED_Reattendance_3day | 40 |
241
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ICU_Mortality | L4.ICU_Mortality_14day | 40 |
242
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ICU_Mortality | L4.ICU_Mortality_1day | 40 |
243
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ICU_Mortality | L4.ICU_Mortality_2day | 40 |
244
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ICU_Mortality | L4.ICU_Mortality_3day | 40 |
245
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ICU_Mortality | L4.ICU_Mortality_7day | 40 |
246
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ICU_Readmission | L4.ICU_Readmission | 40 |
247
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ICU_StayLength | L4.ICU_Stay_14day | 40 |
248
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.ICU_StayLength | L4.ICU_Stay_7day | 40 |
249
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.LengthOfStay | L4.LengthOfStay_3day | 40 |
250
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.LengthOfStay | L4.LengthOfStay_7day | 40 |
251
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.Mortality_Hospital | L4.ED_Inpatient_Mortality | 40 |
252
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.Mortality_Hospital | L4.Inpatient_Mortality | 40 |
253
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.Readmission_Hospital | L4.Readmission_30day | 40 |
254
- | ehr_bench | L1.text_only | L2.risk_prediction | L3.Readmission_Hospital | L4.Readmission_60day | 40 |
255
- | mm_bench | L1.multimodal | L2.cxr_vqa | L3.cxr_vqa_change | L4.cxr_change_comparison | 222 |
256
- | mm_bench | L1.multimodal | L2.cxr_vqa | L3.cxr_vqa_enumeration | L4.cxr_finding_enumeration | 220 |
257
- | mm_bench | L1.multimodal | L2.cxr_vqa | L3.cxr_vqa_presence | L4.cxr_finding_presence | 177 |
258
- | mm_bench | L1.multimodal | L2.phenotyping_mm | L3.Phenotype_ccs_mm | L4.phenotype_ccs | 120 |
259
- | mm_bench | L1.multimodal | L2.risk_prediction_mm | L3.Mortality_mm_full_stay | L4.inpatient_mortality_mm | 125 |
260
- | mm_bench | L1.multimodal | L2.risk_prediction_mm | L3.Mortality_mm_short_term | L4.mortality_24h | 125 |
261
-
262
- Subtotals: `ehr_bench` 45 leaves × 40 = 1,800 · `mm_bench` 989 across 6 leaves · grand total **2,789**.
263
-
264
- ## Source data and provenance
265
-
266
- - **`ehr_bench`** is sub-sampled from the EHR-Bench benchmark of MIMIC-IV-derived clinical-decision and risk-prediction
267
- tasks. The original 21,221 rows (13,500 decision_making + 7,721 risk_prediction) live under
268
- `data/EHR-Bench/ehr_bench_decision_making.jsonl` and `data/EHR-Bench/ehr_bench_risk_prediction.jsonl` upstream;
269
- the 1,800 rows here are the exact subset that was scored. The `qid` suffix equals the original `idx` in the upstream files.
270
- - **`mm_bench`** is sub-sampled from a combined multimodal test set (EHR-XQA-style CXR VQA +
271
- CXR-conditioned mortality / phenotyping). The upstream file is
272
- `data/EHR_multimodal_bench_tests/combined_test_set.jsonl` (2,703 rows), of which 989 are image-grounded; the remaining
273
- 1,704 text-only rows are excluded from this dataset.
274
-
275
- ## Pairing with results
276
-
277
- The full evaluation outputs (per-row `f1 / precision / recall`, predictions, gold, `summary.json` aggregations at every
278
- taxonomy level) live in **`UCSC-VLAA/ClinSeek-Evaluation-Results`** under `hierarchical/{agentic,oneshot}/{bench}/{model}/`.
279
- The directory tree there mirrors the one here, replacing each `inputs.jsonl` with a `rows.jsonl` of scored predictions.
280
 
281
  ## License & access
282
 
 
13
  - 1K<n<10K
14
  configs:
15
  - config_name: ehr_bench
16
+ data_files: "inputs/ehr_bench.json"
17
  - config_name: mm_bench
18
+ data_files: "inputs/mm_bench.jsonl"
19
  ---
20
 
21
  # ClinSeek-Bench
22
 
23
+ The exact evaluation set used for the ClinSeek hierarchical benchmark
24
+ (`UCSC-VLAA/ClinSeek-Evaluation-Results`, under `hierarchical/`). This
25
+ repository ships **everything** needed to reproduce a run end to end:
26
 
27
+ - the original benchmark inputs (questions, gold labels, patient pointers);
28
+ - per-patient SQLite databases for every `subject_id` referenced;
29
+ - the linked chest X-ray images and radiology reports for the multimodal
30
+ split;
31
+ - table-description metadata used by the EHR MCP server.
32
 
33
+ | Split | # data points | Modality | Total assets |
34
+ |--------------|--------------:|--------------------------------|---------------------|
35
+ | `ehr_bench` | **1,800** | text-only | 1,563 patient DBs |
36
+ | `mm_bench` | **989** | text + chest X-ray (image) | 560 patient DBs · 827 CXR JPGs · 356 radiology reports |
37
+ | **Total** | **2,789** | | |
38
 
39
+ `mm_bench` here is restricted to **image-grounded** questions only text-only EHR-query questions from the upstream
40
+ multimodal test set are excluded because they are not part of the multimodal evaluation track.
 
 
 
41
 
42
+ ## Two evaluation modes, one question set
43
+
44
+ Each data point is evaluated under **two** modes that share an identical question set:
45
+
46
+ | Mode | Driver | Patient EHR delivered as | Notes |
47
+ |-----------|---------------------------------|--------------------------------|-----------------------------------------------------------------------|
48
+ | `agentic` | `deploy_agent.py` / `deploy_agent_mm.py` | **fetched at runtime** via an EHR MCP server (`ehr.load_ehr` + SQL/lookup tools) | Multi-turn tool use; agent decides what to look up. |
49
+ | `oneshot` | `deploy_reasoning_model.py` / `deploy_reasoning_model_mm.py` | **inlined** in the prompt (pre-rendered EHR slice) | Single LLM call; everything the model needs is in the prompt. |
50
+
51
+ The same `qid` produces one row in
52
+ `UCSC-VLAA/ClinSeek-Evaluation-Results/hierarchical/agentic/<bench>/<model>/.../rows.jsonl`
53
+ **and** one row in
54
+ `UCSC-VLAA/ClinSeek-Evaluation-Results/hierarchical/oneshot/<bench>/<model>/.../rows.jsonl`,
55
+ so the two scores are directly comparable.
56
+
57
+ ## How each mode reads the inputs
58
+
59
+ ### `ehr_bench`
60
+
61
+ Both modes consume the same file: **`inputs/ehr_bench.json`** — a JSON list of 1,800 records. Each record carries fields
62
+ for both modes:
63
+
64
+ | Mode | Fields the driver actually reads | Prompt the model sees |
65
+ |-----------|----------------------------------|-----------------------|
66
+ | `agentic` | `instruction`, `prediction_time`, `subject_id`, `candidates` | A small instruction wrapper that names the patient and lists candidate answers. **No patient EHR is inlined.** The agent must call `ehr.load_ehr(subject_id, prediction_time)` against the MCP server (which opens `data/ehr_bench/database/patient_<subject_id>.db`) and then issue further `ehr.*` tool calls. |
67
+ | `oneshot` | `question` | A fully self-contained prompt (instruction + entire patient timeline rendered as Markdown) plus `<candidate_answers>` block. **No external lookup needed.** |
68
+
69
+ Why two prompt forms? `question` is a long pre-rendered timeline (avg ≈10 KB, max ≈90 KB) — appropriate for one-shot
70
+ inference but redundant in agentic mode where the agent should retrieve only what it needs.
71
+
72
+ ```python
73
+ import json
74
+
75
+ # Load the shared input file.
76
+ rows = json.load(open("inputs/ehr_bench.json"))
77
+ row = next(r for r in rows if r["qid"] == "ehr_bench_decision_making_0")
78
+
79
+ # --- agentic input (build the agent prompt + open the patient DB) -----------
80
+ agentic_prompt_template = """The current time is {prediction_time}.
81
+ The patient subject_id is {subject_id}.
82
+ {instruction}
83
+ <candidate_answers>
84
+ {candidates}
85
+ </candidate_answers>"""
86
+ agentic_prompt = agentic_prompt_template.format(
87
+ prediction_time=row["prediction_time"],
88
+ subject_id=row["subject_id"],
89
+ instruction=row["instruction"],
90
+ candidates=json.dumps(row["candidates"]),
91
+ )
92
+ patient_db = f"data/ehr_bench/database/patient_{row['subject_id']}.db" # the agent's MCP server opens this
93
+
94
+ # --- oneshot input (single LLM call, prompt is fully self-contained) --------
95
+ oneshot_prompt = row["question"] # 1 kB → 90 kB, depending on the patient
96
+ ```
97
+
98
+ The exact agentic prompt template is `EHR_Bench_Prompt` in
99
+ [`openresearcher_ehr/data_utils.py:135`](https://github.com/Letian2003/DeepMed/blob/deepresearch/openresearcher_ehr/data_utils.py)
100
+ (function `generate_ehr_bench_prompt`). The exact oneshot wrapper is
101
+ [`build_user_content` in `deploy_reasoning_model.py:70`](https://github.com/Letian2003/DeepMed/blob/deepresearch/openresearcher_ehr/deploy_reasoning_model.py)
102
+ (it appends a short `<answer>...</answer>` extraction trailer to `row["question"]`).
103
+
104
+ ### `mm_bench`
105
+
106
+ Both modes consume the same file: **`inputs/mm_bench.jsonl`** — a JSONL of 989 records. Each record carries fields for
107
+ both modes:
108
+
109
+ | Mode | Fields the driver actually reads | Prompt the model sees |
110
+ |-----------|----------------------------------|-----------------------|
111
+ | `agentic` | `question`, `image_paths`, `report_paths`, `subject_id`, `source_benchmark` | The bare task instruction (`question`, ≈540 chars). Patient EHR is fetched at runtime via EHR MCP (`ehr.load_ehr(subject_id, prediction_time)` against `data/mm_bench/<source>/database/patient_<subject_id>.db`); CXR images are attached to the user turn as image blocks; radiology reports may be inlined via tool calls. |
112
+ | `oneshot` | `input_text` (preferred) or `question` (fallback), `image_paths` | A pre-rendered prompt (`input_text`, avg ≈24 KB, max ≈64 KB) that already contains `<patient_info>` + `<cxr_info>` + sliced `<ehr_context>` (top-N rows from each table) + `<image_inputs>` listing. CXR images are inlined into the user turn as base64 image blocks. **No DB lookup needed.** |
113
+
114
+ ```python
115
+ import json
116
+
117
+ # Load the shared input file.
118
+ mm = [json.loads(l) for l in open("inputs/mm_bench.jsonl")]
119
+ row = next(r for r in mm if r["qid"] == "medmod_radiology_test_56445431")
120
+
121
+ # Pick the right bench root for assets and the per-patient DB.
122
+ bench_root = f"data/mm_bench/{ 'ehrxqa' if row['source_benchmark']=='ehrxqa' else 'medmod' }"
123
+ patient_db = f"{bench_root}/database/patient_{row['subject_id']}.db"
124
+
125
+ # Resolve image_paths against bench_root (paths keep an upstream prefix that
126
+ # we strip — see openresearcher_ehr/deploy_reasoning_model_mm.py:78).
127
+ def resolve(p):
128
+ first, sep, rest = p.partition("/")
129
+ if sep and (first.endswith("OriginalLinked_v1") or first.endswith("AgentBench_v3")):
130
+ p = rest
131
+ return f"{bench_root}/{p}"
132
+
133
+ image_files = [resolve(p) for p in (row.get("image_paths") or [])]
134
+
135
+ # --- agentic input ----------------------------------------------------------
136
+ agentic_prompt = row["question"] # ≈ 540 chars
137
+ agentic_assets = {"images": image_files, "patient_db": patient_db}
138
+
139
+ # --- oneshot input (preferred form) -----------------------------------------
140
+ oneshot_prompt = row.get("input_text") or row["question"] # ≈ 24 kB
141
+ oneshot_assets = {"images": image_files} # no DB needed
142
+ ```
143
+
144
+ `row["input_text"]` is the model-ready oneshot rendering; if it is missing or empty, fall back to `row["question"]`.
145
+ The actual logic is `build_text_payload` in
146
+ [`deploy_reasoning_model_mm.py:150`](https://github.com/Letian2003/DeepMed/blob/deepresearch/openresearcher_ehr/deploy_reasoning_model_mm.py).
147
 
148
  ## Directory layout
149
 
150
  ```
151
  ClinSeek-Bench/
152
+ ├── README.md # this file
153
+ ├── inputs/
154
+ ├── ehr_bench.json # 1,800 records (text-only EHR-Bench)
155
+ │ └── mm_bench.jsonl # 989 records (multimodal MM-Bench, image-grounded)
156
+ ── data/
157
+ ── ehr_bench/
158
+ ├── database/
159
+ ── candidate_table.db # vocabulary / candidate-answer table
160
+ └── patient_<subject_id>.db # 1,563 per-patient SQLite DBs (≈2.0 GB)
161
+ └── table_description/ # JSON metadata used by the EHR MCP server
162
+ ── link_information.json
163
+ ── shorten_description.json
164
+ └── table_description.json
165
+ └── mm_bench/
166
+ ├── ehrxqa/ # rows where source_benchmark == "ehrxqa" (497 rows)
167
+ │ ├── database/ # 165 per-patient SQLite DBs
168
+ ├── mimic-cxr/2.0.0/files/... # linked CXR JPGs + report .txt
169
+ └── table_description/
170
+ ── medmod/ # rows where source_benchmark == "medmod" (492 rows)
171
+ ── database/ # 395 per-patient SQLite DBs
172
+ ├── mimic-cxr/2.0.0/files/... # linked CXR JPGs
173
+ └── table_description/
 
 
174
  ```
175
 
176
+ ## Running an evaluation against this repo
177
+
178
+ After cloning, point each driver at the matching `--data` and `--bench-root` (or `--ehr_path`) inside this folder.
179
+
180
+ ### EHR-Bench
181
+
182
+ ```bash
183
+ # 0. Start the EHR MCP server on the ehr_bench root (agentic mode only)
184
+ python src/run_mcp_server.py \
185
+ --mode http --host 127.0.0.1 --port 5103 \
186
+ --data_path /path/to/ClinSeek-Bench/data/ehr_bench
187
+ # This server exposes ehr.load_ehr / ehr.run_sql_query / ehr.* tools backed
188
+ # by the patient_*.db files in data/ehr_bench/database/.
189
+
190
+ # 1a. Agentic — multi-turn tool use; reads instruction/subject_id/candidates,
191
+ # fetches EHR via the MCP server above.
192
+ python openresearcher_ehr/deploy_agent.py \
193
+ --data_path /path/to/ClinSeek-Bench/inputs/ehr_bench.json \
194
+ --output_dir ./out_agentic_ehr \
195
+ --mcp_url http://127.0.0.1:5103/mcp \
196
+ --model <model-name>
197
+
198
+ # 1b. One-shot — single LLM call; reads `question` (which already inlines the
199
+ # patient timeline). No MCP server needed.
200
+ python openresearcher_ehr/deploy_reasoning_model.py \
201
+ --data /path/to/ClinSeek-Bench/inputs/ehr_bench.json \
202
+ --output-dir ./out_oneshot_ehr \
203
+ --model <model-name>
204
+ ```
205
 
206
+ ### MM-Bench
207
+
208
+ ```bash
209
+ # 0. Start the MM EHR MCP server on each multimodal sub-root (agentic only).
210
+ # The driver accepts multiple --bench-root paths so a single server isn't
211
+ # required, but the simplest setup is one MCP server per source split.
212
+ python src/run_mcp_server.py --port 5113 --data_path /path/to/ClinSeek-Bench/data/mm_bench/ehrxqa &
213
+ python src/run_mcp_server.py --port 5114 --data_path /path/to/ClinSeek-Bench/data/mm_bench/medmod &
214
+
215
+ # 1a. Agentic — reads `question` + image_paths + subject_id; image MCP +
216
+ # EHR MCP servers handle assets and DB.
217
+ python openresearcher_ehr/deploy_agent_mm.py \
218
+ --data /path/to/ClinSeek-Bench/inputs/mm_bench.jsonl \
219
+ --output_dir ./out_agentic_mm \
220
+ --bench_root /path/to/ClinSeek-Bench/data/mm_bench/ehrxqa \
221
+ /path/to/ClinSeek-Bench/data/mm_bench/medmod \
222
+ --image_mcp_url http://127.0.0.1:5203/mcp \
223
+ --enable_ehr --ehrxqa_mcp_url http://127.0.0.1:5113/mcp \
224
+ --medmod_mcp_url http://127.0.0.1:5114/mcp \
225
+ --model <model-name>
226
+
227
+ # 1b. One-shot — reads `input_text` (already has EHR inlined) + image_paths.
228
+ # No MCP server needed; just resolve the images.
229
+ python openresearcher_ehr/deploy_reasoning_model_mm.py \
230
+ --data /path/to/ClinSeek-Bench/inputs/mm_bench.jsonl \
231
+ --output-dir ./out_oneshot_mm \
232
+ --bench-root /path/to/ClinSeek-Bench/data/mm_bench/ehrxqa \
233
+ /path/to/ClinSeek-Bench/data/mm_bench/medmod \
234
+ --model <model-name>
235
+ ```
236
 
237
+ The drivers above live in this repo:
238
+ - <https://github.com/Letian2003/DeepMed/blob/deepresearch/openresearcher_ehr/deploy_agent.py>
239
+ - <https://github.com/Letian2003/DeepMed/blob/deepresearch/openresearcher_ehr/deploy_reasoning_model.py>
240
+ - <https://github.com/Letian2003/DeepMed/blob/deepresearch/openresearcher_ehr/deploy_agent_mm.py>
241
+ - <https://github.com/Letian2003/DeepMed/blob/deepresearch/openresearcher_ehr/deploy_reasoning_model_mm.py>
242
 
243
+ ## Schema reference
244
 
245
+ ### `inputs/ehr_bench.json`
246
 
247
  ```jsonc
248
+ [
249
+ {
250
+ "qid": "ehr_bench_risk_prediction_329", // stable id; matches results rows.jsonl
251
+ "subject_id": 12345678, // patient DB lookup key
252
+ "hadm_id": 23456789,
253
+ "prediction_time": "2183-08-13 01:15:18", // cutoff time the patient EHR is sliced at
254
+ "latest_event_time": "2183-08-13 01:15:17",
255
+ "task": "ED_Critical_Outcomes", // L4-style task tag
256
+ "task_type": "decision_making" | "risk_prediction",
257
+ "label": "yes" | ["..."], // gold answer
258
+ "question": "<task_instruction>...full timeline...</question>", // ONESHOT prompt
259
+ "instruction": "Given the sequence of events ...", // AGENTIC prompt
260
+ "input": "## Patient Demographics ...", // structured EHR (also fed into `question`)
261
+ "output": "OBSERVATION ADMIT", // gold (string form)
262
+ "candidates": ["...", "..."], // discrete answer options
263
+ "task_info": { "...": "..." }, // metric / target / split info
264
+ "source_idx": 0,
265
+ "source_file": "ehr_bench_risk_prediction.jsonl"
 
 
 
 
266
  }
267
+ ]
268
  ```
269
 
270
+ ### `inputs/mm_bench.jsonl`
 
 
271
 
272
  ```jsonc
273
  {
274
+ "qid": "medmod_radiology_test_56445431", // stable id
275
+ "subject_id": 17795062, // patient DB lookup key
 
 
 
 
 
276
  "hadm_id": 22792685,
277
+ "stay_id": 39825171,
278
  "prediction_time": "2177-07-25 22:04:23",
279
+ "task": "medmod_radiology", // task tag
280
+ "answer_type": "list" | "label",
281
+ "modalities": ["cxr_image", "cxr_table"], // which assets are referenced
282
+ "ground_truth": [{"name": "Cardiomegaly"}, ...], // gold answer
283
+ "question": "<task_instruction>...question only, no EHR...</question>", // AGENTIC prompt
284
+ "input_text": "<task_instruction>...<ehr_context>...inlined CSV slices...<image_inputs>", // ONESHOT prompt
285
+ "image_paths": ["MedModOriginalLinked_v1/mimic-cxr/2.0.0/files/p17/p17795062/s56445431/<dicom>.jpg"],
286
+ "report_paths": [], // optional radiology report .txt
287
+ "source_benchmark": "medmod" | "ehrxqa", // → which bench root to resolve assets against
288
  "source_split": "test",
289
+ "source_index": 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  }
291
  ```
292
 
293
+ > **Path note.** `image_paths` and `report_paths` keep an upstream layout prefix (`MedModOriginalLinked_v1/...` or
294
+ > `EHRXQAOriginalLinked_v1/...`). The drivers strip the first segment and re-resolve under each bench root, so the
295
+ > physical files in this repo live at `data/mm_bench/<source>/mimic-cxr/2.0.0/...`. If you write your own loader,
296
+ > mirror that strip-prefix-then-join logic.
297
 
298
+ ## Pairing with the result repository
 
 
 
299
 
300
+ Per-row scored predictions live in **`UCSC-VLAA/ClinSeek-Evaluation-Results`** under
301
+ `hierarchical/{agentic,oneshot}/{bench}/{model}/L1.<modality>/L2.<family>/L3.<sub>/L4.<task>/rows.jsonl`. To pull both
302
+ modes for the same data point under one model:
 
303
 
304
  ```python
305
+ import json, os
306
+
307
+ INPUTS = "inputs/ehr_bench.json" # or inputs/mm_bench.jsonl (read line-by-line)
308
+ RESULTS_REPO = "/path/to/ClinSeek-Evaluation-Results"
309
+
310
+ with open(INPUTS) as f:
311
+ rows = json.load(f)
312
+ row = rows[0] # any data point
313
+ qid = row["qid"]
314
+
315
+ def load_score(model, mode, bench):
316
+ base = f"{RESULTS_REPO}/hierarchical/{mode}/{bench}/{model}"
317
+ for dirpath, _, files in os.walk(base):
318
+ if "rows.jsonl" in files:
319
+ with open(os.path.join(dirpath, "rows.jsonl")) as f:
320
+ for line in f:
321
+ r = json.loads(line)
322
+ if r["qid"] == qid:
323
+ return r
324
+ return None
325
+
326
+ agentic = load_score("claude_opus_4_6", "agentic", "ehr_bench")
327
+ oneshot = load_score("claude_opus_4_6", "oneshot", "ehr_bench")
328
  print("agentic F1:", agentic["f1"], "| oneshot F1:", oneshot["f1"])
329
  ```
330
 
331
+ ## Provenance
332
+
333
+ - **`ehr_bench`** is the 40-rows-per-task balanced subset of EHR-Bench. The full upstream files are
334
+ `data/EHR-Bench/ehr_bench_decision_making.jsonl` (13,500 rows) +
335
+ `data/EHR-Bench/ehr_bench_risk_prediction.jsonl` (7,721 rows)
336
+ `ehr_bench_sampled_40_per_task.json` (1,800 rows = 27 decision_making leaves × 40 + 18 risk_prediction leaves × 40).
337
+ - **`mm_bench`** is the image-grounded subset of the combined multimodal test set
338
+ (`combined_test_set.jsonl` / `model_ready_combined_test_set.jsonl`, 2,703 rows total). The 1,704 text-only
339
+ EHR-query rows are excluded; the 989 rows kept here are the rows scored under `mm_bench` in the result repository.
340
+ - **EHR-Bench DBs** are sourced from the upstream EHR-Bench release (MIMIC-IV-derived per-patient snapshots).
341
+ - **MM-Bench DBs / images / reports** are sourced from `EHRXQAAgentBench_v3` (EHR-XQA test rows) and
342
+ `MedModAgentBench_v3` (MedMod test rows) both are MIMIC-IV / MIMIC-CXR-JPG derivatives.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
 
344
  ## License & access
345
 
data/ehr_bench/database/patient_10020435.db ADDED
Binary file (65.5 kB). View file
 
data/ehr_bench/database/patient_10030351.db ADDED
Binary file (86 kB). View file
 
data/ehr_bench/database/patient_10242272.db ADDED
Binary file (90.1 kB). View file
 
data/ehr_bench/database/patient_10422514.db ADDED
Binary file (65.5 kB). View file
 
data/ehr_bench/database/patient_10662076.db ADDED
Binary file (69.6 kB). View file
 
data/ehr_bench/database/patient_10964841.db ADDED
Binary file (90.1 kB). View file
 
data/ehr_bench/database/patient_11036842.db ADDED
Binary file (81.9 kB). View file
 
data/ehr_bench/database/patient_11280175.db ADDED
Binary file (90.1 kB). View file
 
data/ehr_bench/database/patient_11294136.db ADDED
Binary file (81.9 kB). View file
 
data/ehr_bench/database/patient_11871866.db ADDED
Binary file (90.1 kB). View file
 
data/ehr_bench/database/patient_12031986.db ADDED
Binary file (61.4 kB). View file
 
data/ehr_bench/database/patient_12224937.db ADDED
Binary file (61.4 kB). View file
 
data/ehr_bench/database/patient_12267502.db ADDED
Binary file (98.3 kB). View file
 
data/ehr_bench/database/patient_12561976.db ADDED
Binary file (65.5 kB). View file
 
data/ehr_bench/database/patient_13018384.db ADDED
Binary file (98.3 kB). View file
 
data/ehr_bench/database/patient_13226434.db ADDED
Binary file (94.2 kB). View file
 
data/ehr_bench/database/patient_13328445.db ADDED
Binary file (94.2 kB). View file
 
data/ehr_bench/database/patient_13891488.db ADDED
Binary file (86 kB). View file
 
data/ehr_bench/database/patient_13894320.db ADDED
Binary file (69.6 kB). View file
 
data/ehr_bench/database/patient_14248472.db ADDED
Binary file (65.5 kB). View file
 
data/ehr_bench/database/patient_14289335.db ADDED
Binary file (53.2 kB). View file
 
data/ehr_bench/database/patient_14303624.db ADDED
Binary file (65.5 kB). View file
 
data/ehr_bench/database/patient_14520269.db ADDED
Binary file (73.7 kB). View file
 
data/ehr_bench/database/patient_14593559.db ADDED
Binary file (98.3 kB). View file
 
data/ehr_bench/database/patient_14609898.db ADDED
Binary file (69.6 kB). View file
 
data/ehr_bench/database/patient_14695800.db ADDED
Binary file (94.2 kB). View file
 
data/ehr_bench/database/patient_14862845.db ADDED
Binary file (73.7 kB). View file
 
data/ehr_bench/database/patient_14939811.db ADDED
Binary file (94.2 kB). View file
 
data/ehr_bench/database/patient_15373376.db ADDED
Binary file (90.1 kB). View file
 
data/ehr_bench/database/patient_15548906.db ADDED
Binary file (81.9 kB). View file
 
data/ehr_bench/database/patient_15737898.db ADDED
Binary file (73.7 kB). View file
 
data/ehr_bench/database/patient_15772513.db ADDED
Binary file (90.1 kB). View file
 
data/ehr_bench/database/patient_15928635.db ADDED
Binary file (61.4 kB). View file
 
data/ehr_bench/database/patient_16246807.db ADDED
Binary file (81.9 kB). View file
 
data/ehr_bench/database/patient_17333198.db ADDED
Binary file (73.7 kB). View file
 
data/ehr_bench/database/patient_17618004.db ADDED
Binary file (69.6 kB). View file
 
data/ehr_bench/database/patient_17677136.db ADDED
Binary file (98.3 kB). View file
 
data/ehr_bench/database/patient_17736601.db ADDED
Binary file (65.5 kB). View file
 
data/ehr_bench/database/patient_17776468.db ADDED
Binary file (53.2 kB). View file
 
data/ehr_bench/database/patient_17791031.db ADDED
Binary file (77.8 kB). View file
 
data/ehr_bench/database/patient_17938709.db ADDED
Binary file (98.3 kB). View file
 
data/ehr_bench/database/patient_18050457.db ADDED
Binary file (98.3 kB). View file
 
data/ehr_bench/database/patient_18106293.db ADDED
Binary file (61.4 kB). View file
 
data/ehr_bench/database/patient_18264239.db ADDED
Binary file (69.6 kB). View file
 
data/ehr_bench/database/patient_18295608.db ADDED
Binary file (65.5 kB). View file
 
data/ehr_bench/database/patient_18358187.db ADDED
Binary file (98.3 kB). View file
 
data/ehr_bench/table_description/link_information.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {"table_name": "diagnoses_icd", "link_table": "d_icd_diagnoses", "link_column": ["icd_code", "icd_version"]}
2
+ {"table_name": "procedures_icd", "link_table": "d_icd_procedures", "link_column": ["icd_code", "icd_version"]}
3
+ {"table_name": "prescriptions", "link_table": "d_atc_prescriptions", "link_column": ["ndc"]}
4
+ {"table_name": "microbiologyevents", "link_table": "d_microbiologyevents", "link_column": ["spec_itemid"]}
5
+ {"table_name": "labevents", "link_table": "d_labitems", "link_column": ["itemid"]}
6
+ {"table_name": "chartevents", "link_table": "d_items", "link_column": ["itemid"]}
7
+ {"table_name": "datetimeevents", "link_table": "d_items", "link_column": ["itemid"]}
8
+ {"table_name": "inputevents", "link_table": "d_items", "link_column": ["itemid"]}
9
+ {"table_name": "outputevents", "link_table": "d_items", "link_column": ["itemid"]}
10
+ {"table_name": "procedureevents", "link_table": "d_items", "link_column": ["itemid"]}
data/ehr_bench/table_description/shorten_description.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"file_name": "omr", "description": "Stores outpatient measurements like blood pressure, weight, height, and BMI from the electronic health record.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "chartdate", "description": "Date of the observation."}, {"column_name": "seq_num", "description": "Orders multiple same-day results of the same type."}, {"column_name": "result_name", "description": "Name of the recorded observation."}, {"column_name": "result_value", "description": "Value of the observation."}], "class": "hosp", "link": []}
2
+ {"file_name": "provider", "description": "Lists all unique provider_id values used in the database.", "columns": [{"column_name": "provider_id", "description": "Unique, randomly generated provider identifier (e.g., P003AB)."}], "class": "hosp", "link": []}
3
+ {"file_name": "admissions", "description": "Contains details for each hospital admission, including timing, demographics, admission source, and discharge info. Each admission has a unique hadm_id.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier; links to PATIENTS table. Patients may have multiple admissions."}, {"column_name": "hadm_id", "description": "Unique identifier for each hospital admission (2000000–2999999)."}, {"column_name": "admittime", "description": "Date and time of hospital admission."}, {"column_name": "dischtime", "description": "Date and time of hospital discharge."}, {"column_name": "deathtime", "description": "Date and time of in-hospital death, if applicable."}, {"column_name": "admission_type", "description": "Classifies admission urgency (e.g., elective, urgent, emergency)."}, {"column_name": "admit_provider_id", "description": "Anonymous ID for admitting provider; consistent across database."}, {"column_name": "admission_location", "description": "Location of patient before hospital admission."}, {"column_name": "discharge_location", "description": "Patient's destination after hospital discharge."}, {"column_name": "insurance", "description": "Patient's insurance for this admission."}, {"column_name": "language", "description": "Patient's language for this admission."}, {"column_name": "marital_status", "description": "Patient's marital status for this admission."}, {"column_name": "ethicity", "description": "Patient's ethnicity for this admission."}, {"column_name": "edregtime", "description": "Date and time of emergency department registration."}, {"column_name": "edouttime", "description": "Date and time of emergency department discharge."}, {"column_name": "hospital_expire_flag", "description": "Indicates in-hospital death: 1 = died, 0 = survived."}, {"column_name": "text", "description": "Narrative summary of admission reason."}], "class": "hosp", "link": [{"link_table": "patients", "link_column": "subject_id"}]}
4
+ {"file_name": "d_hcpcs", "description": "Provides definitions for hospital billing codes, mainly CPT codes, used in hcpcsevents. Some definitions may be missing due to licensing.", "columns": [{"column_name": "code", "description": "Unique five-character event code."}, {"column_name": "category", "description": "General code classification."}, {"column_name": "long_description", "description": "Full code description."}, {"column_name": "short_description", "description": "Abbreviated code description."}], "class": "hosp", "link": [{"link_table": "hcpcsevents", "link_column": "code"}]}
5
+ {"file_name": "d_icd_diagnoses", "description": "Lists ICD-9 and ICD-10 diagnosis codes used for patient billing.", "columns": [{"column_name": "icd_code", "description": "ICD diagnosis code."}, {"column_name": "icd_version", "description": "ICD version: 9 or 10. ICD-9 codes are numeric (sometimes with E or V), ICD-10 codes start with a letter."}, {"column_name": "long_title", "description": "Full description of the ICD code."}], "class": "hosp", "link": [{"link_table": "diagnoses_icd", "link_column": "icd_code"}]}
6
+ {"file_name": "d_ccs_diagnoses", "description": "Lists ICD-9 and ICD-10 diagnosis codes in CCS Level used for patient billing.", "columns": [{"column_name": "icd_code", "description": "ICD diagnosis code."}, {"column_name": "icd_version", "description": "ICD version: 9 or 10. ICD-9 codes are numeric (sometimes with E or V), ICD-10 codes start with a letter."}, {"column_name": "long_title", "description": "Full description of the ICD code in CCS Level."}], "class": "hosp", "link": [{"link_table": "diagnoses_icd", "link_column": "icd_code"}]}
7
+ {"file_name": "d_icd_procedures", "description": "Defines ICD procedure codes used for billing and identifying performed procedures.", "columns": [{"column_name": "icd_code", "description": "ICD procedure code."}, {"column_name": "icd_version", "description": "ICD version: 9 (ICD-9) or 10 (ICD-10); decimals are optional."}, {"column_name": "long_title", "description": "Brief definition of the procedure code."}], "class": "hosp", "link": [{"link_table": "procedures_icd", "link_column": "icd_code"}]}
8
+ {"file_name": "d_ccs_procedures", "description": "Defines ICD procedure codes in CCS Level used for billing and identifying performed procedures.", "columns": [{"column_name": "icd_code", "description": "ICD procedure code."}, {"column_name": "icd_version", "description": "ICD version: 9 (ICD-9) or 10 (ICD-10); decimals are optional."}, {"column_name": "long_title", "description": "Brief definition of the procedure code in CCS Level."}], "class": "hosp", "link": [{"link_table": "procedures_icd", "link_column": "icd_code"}]}
9
+ {"file_name": "d_atc_prescriptions", "description": "Contains unique drug names prescribed to patients, used as candidate values for medication selection.", "columns": [{"column_name": "ndc_code", "description": "National Drug Code for medication."}, {"column_name": "long_drug_name", "description": "Complete drug name."}, {"column_name": "atc_name", "description": "Drug name for Anatomical Therapeutic Chemical classification system."}], "class": "hosp", "link": []}
10
+ {"file_name": "d_labitems", "description": "Defines all lab measurement itemids used in MIMIC. Links lab events to item details, including fluid, category, and label. Most items map to LOINC codes for interoperability.", "columns": [{"column_name": "itemid", "description": "Unique ID for each lab concept; links to labevents."}, {"column_name": "label", "description": "Name of the lab concept for the itemid."}, {"column_name": "fluid", "description": "Type of fluid measured, such as blood or urine."}, {"column_name": "category", "description": "General type of measurement, e.g., ABG."}], "class": "hosp", "link": [{"link_table": "labevents", "link_column": "itemid"}]}
11
+ {"file_name": "diagnoses_icd", "description": "Lists all ICD-9 and ICD-10 diagnoses billed to patients during hospital stays, assigned at discharge based on clinical notes.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "seq_num", "description": "Diagnosis priority or ranking."}, {"column_name": "icd_code", "description": "ICD diagnosis code."}, {"column_name": "icd_version", "description": "ICD version: 9 (ICD-9) or 10 (ICD-10)."}, {"column_name": "charttime", "description": "Time diagnosis was charted."}], "class": "hosp", "link": [{"link_table": "d_icd_diagnoses", "link_column": "idc_code"}]}
12
+ {"file_name": "drgcodes", "description": "Diagnosis Related Groups (DRGs) classify hospital stays for billing and indicate the main reason for admission.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "drg_type", "description": "DRG coding system used."}, {"column_name": "drg_code", "description": "DRG code."}, {"column_name": "description", "description": "DRG code description."}, {"column_name": "drg_severity", "description": "Severity of illness per DRG."}, {"column_name": "drg_mortality", "description": "Mortality risk per DRG."}], "class": "hosp", "link": []}
13
+ {"file_name": "emar", "description": "Records medication administrations to patients, entered by bedside staff using barcode scanning.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "emar_id", "description": "Unique eMAR order ID, combining subject_id and emar_seq."}, {"column_name": "emar_seq", "description": "Sequential number for each eMAR order per patient."}, {"column_name": "poe_id", "description": "Links to related orders in poe and prescriptions."}, {"column_name": "pharmacy_id", "description": "Links to pharmacy information."}, {"column_name": "enter_provider_id", "description": "Anonymous ID for the provider who entered the record."}, {"column_name": "charttime", "description": "Time medication was given."}, {"column_name": "medication", "description": "Name of administered medication."}, {"column_name": "event_txt", "description": "Type of administration event (e.g., Administered, Delayed, Not Given)."}, {"column_name": "scheduletime", "description": "Scheduled administration time, if available."}, {"column_name": "storetime", "description": "Time administration was documented."}], "class": "hosp", "link": [{"link_table": "emar_detail", "link_column": "emar_id"}, {"link_table": "pharmacy", "link_column": "pharmacy_id"}, {"link_table": "prescriptions", "link_column": "pharmacy_id"}, {"link_table": "poe", "link_column": "poe_id"}]}
14
+ {"file_name": "emar_detail", "description": "Contains details of each medication administration in EMAR, including related pharmacy order, dose due, and dose given.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "emar_id", "description": "Unique eMAR order ID, combining subject_id and emar_seq."}, {"column_name": "emar_seq", "description": "Sequential number for each eMAR order per patient."}, {"column_name": "parent_field_ordinal", "description": "Indicates multiple administrations for one eMAR event; NULL for main dose, numbered for each formulary dose."}, {"column_name": "administration_type", "description": "Type of administration, e.g., IV Bolus, IV Infusion, Transdermal Patch."}, {"column_name": "pharmacy_id", "description": "Links eMAR order to pharmacy table; may vary within same emar_id."}, {"column_name": "Remaining columns", "description": "Additional details on formulary dose delivery."}], "class": "hosp", "link": [{"link_table": "emar", "link_column": "emar_id"}, {"link_table": "pharmacy", "link_column": "pharmacy_id"}]}
15
+ {"file_name": "hpcsevents", "description": "Hospital billed events with CPT codes.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "chartdate", "description": "Date of the coded event."}, {"column_name": "hcpcs_cd", "description": "Five-character event code; link to d_hcpcs for details."}, {"column_name": "seq_num", "description": "Order of HCPCS codes for the hospitalization."}, {"column_name": "short_description", "description": "Brief description of the hcpcs_cd."}], "class": "hosp", "link": [{"link_table": "d_hcpcs", "link_column": "hcpcs_cd"}]}
16
+ {"file_name": "labevents", "description": "Stores all lab test results for a patient, including hematology, blood gases, chemistry, and rare tests.", "columns": [{"column_name": "labevent_id", "description": "Unique row identifier."}, {"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "specimen_id", "description": "Unique ID for the specimen used for the lab test."}, {"column_name": "itemid", "description": "Unique lab test concept identifier."}, {"column_name": "order_provider_id", "description": "Anonymous ID for the provider who ordered the test."}, {"column_name": "charttime", "description": "Time the lab test was charted or specimen collected."}, {"column_name": "storetime", "description": "Time the result became available in the system."}, {"column_name": "value", "description": "Lab test result, as entered."}, {"column_name": "valuenum", "description": "Lab test result as a numeric value."}, {"column_name": "valueuom", "description": "Unit of measurement for the result."}, {"column_name": "ref_range_lower", "description": "Lower normal reference range for the test."}, {"column_name": "ref_range_upper", "description": "Upper normal reference range for the test."}, {"column_name": "flag", "description": "Indicates if the result is abnormal."}, {"column_name": "priority", "description": "Test priority: routine or stat."}, {"column_name": "comment", "description": "Deidentified comments about the lab test."}], "class": "hosp", "link": [{"link_table": "d_labitems", "link_column": "itemid"}]}
17
+ {"file_name": "microbiologyevents", "description": "Records microbiology tests, specimen details, organisms found, and antibiotic sensitivities for each patient sample.", "columns": [{"column_name": "microevent", "description": "Unique row identifier."}, {"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "micro_specimen_id", "description": "Unique ID for the tested specimen; groups results from the same sample."}, {"column_name": "order_provider_id", "description": "Anonymous ID for the provider ordering the test."}, {"column_name": "charttime", "description": "Date and time the observation was charted."}, {"column_name": "chartdate", "description": "Date the observation was charted (if time not available)."}, {"column_name": "spec_itemid", "description": "ID for the specimen type (e.g., blood, urine)."}, {"column_name": "spec_type_desc", "description": "Description of the specimen type."}, {"column_name": "test_seq", "description": "Sequence number for multiple samples from the same specimen."}, {"column_name": "storedate", "description": "Date the result was available."}, {"column_name": "storetime", "description": "Date and time the result was available."}, {"column_name": "test_itemid", "description": "ID for the test performed."}, {"column_name": "test_name", "description": "Name of the test performed."}, {"column_name": "org_itemid", "description": "ID for the organism grown, if any."}, {"column_name": "org_name", "description": "Name of the organism grown, if any."}, {"column_name": "isolate_num", "description": "Isolate number for antibiotic testing."}, {"column_name": "ab_itemid", "description": "ID for the antibiotic tested."}, {"column_name": "ab_name", "description": "Name of the antibiotic tested."}, {"column_name": "dilution_text", "description": "Text value for antibiotic dilution."}, {"column_name": "dilution_comparison", "description": "Comparison operator for dilution value."}, {"column_name": "dilution_value", "description": "Numeric value for antibiotic dilution."}, {"column_name": "interpretation", "description": "Antibiotic sensitivity result: S (sensitive), R (resistant), I (intermediate), P (pending)."}, {"column_name": "comments", "description": "Deidentified comments about the microbiology measurement."}], "class": "hosp", "link": []}
18
+ {"file_name": "patients", "description": "Stores patient information that does not change over time.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier; primary key."}, {"column_name": "gender", "description": "Patient's genotypical sex."}, {"column_name": "anchor_age", "description": "Patient's age in the anchor_year; set to 91 if over 89."}, {"column_name": "anchor_year", "description": "Shifted year used for patient data."}, {"column_name": "anchor_year_group", "description": "Year range when anchor_year occurred."}, {"column_name": "dod", "description": "De-identified date of death from hospital and state records; deaths over one year post-discharge are censored."}], "class": "hosp", "link": []}
19
+ {"file_name": "pharmacy", "description": "Contains details of filled prescriptions, including drug name, dose, frequency, route, and duration.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "pharmacy_id", "description": "Unique pharmacy record ID; links to orders and medication administration."}, {"column_name": "poe_id", "description": "Foreign key linking to provider order in prescriptions."}, {"column_name": "starttime", "description": "Medication start time."}, {"column_name": "stoptime", "description": "Medication stop time."}, {"column_name": "medication", "description": "Medication name."}, {"column_name": "proc_type", "description": "Order type (e.g., IV Piggyback, Unit Dose)."}, {"column_name": "status", "description": "Prescription status: active, inactive, or discontinued."}, {"column_name": "entertime", "description": "Time prescription was entered."}, {"column_name": "verifiedtime", "description": "Time prescription was verified."}, {"column_name": "route", "description": "Route of administration."}, {"column_name": "frequency", "description": "How often medication is given (e.g., Q6H = every 6 hours)."}, {"column_name": "disp_sched", "description": "Scheduled administration times (e.g., 08, 20)."}, {"column_name": "infusion_type", "description": "Infusion type code (e.g., B, C, N, N1, O, R)."}, {"column_name": "sliding_scale", "description": "Indicates sliding scale dosing (Y/N)."}, {"column_name": "lockout_interval", "description": "Wait time before next dose, often for PCA."}, {"column_name": "basal_rate", "description": "Medication rate over 24 hours."}, {"column_name": "one_hr_max", "description": "Maximum dose per hour."}, {"column_name": "doses_per_24_hrs", "description": "Expected doses in 24 hours."}, {"column_name": "duration", "description": "Numeric duration of dose (see duration_interval for units)."}, {"column_name": "duration_interval", "description": "Unit for duration (e.g., Doses, Weeks)."}, {"column_name": "expiration_value", "description": "Time until drug expires (numeric value)."}, {"column_name": "expiration_unit", "description": "Unit for expiration (e.g., days, hours)."}, {"column_name": "expirationdate", "description": "Drug expiration date."}, {"column_name": "dispensation", "description": "Medication dispensation source."}, {"column_name": "fill_quantity", "description": "Proportion of formulary to fill."}], "class": "hosp", "link": [{"link_table": "poe", "link_column": "poe_id"}, {"link_table": "prescriptions", "link_column": "pharmacy_id"}, {"link_table": "emar", "link_column": "pharmacy_id"}]}
20
+ {"file_name": "poe", "description": "Provider order entry records all hospital orders entered by care providers.", "columns": [{"column_name": "poe_id", "description": "Unique order ID, combining subject_id and poe_seq."}, {"column_name": "poe_seq", "description": "Sequential number for ordering POE entries."}, {"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique ID for each hospital admission."}, {"column_name": "ordertime", "description": "Date and time the order was placed."}, {"column_name": "order_type", "description": "Category of provider order (e.g., Lab, Medications, Radiology)."}, {"column_name": "order_subtype", "description": "Specific detail of the order, interpreted with order_type."}, {"column_name": "transaction_type", "description": "Action performed (e.g., New, Change, D/C)."}, {"column_name": "discontinue_of_poe_id", "description": "Links to the order discontinued by this entry."}, {"column_name": "discontinued_by_poe_id", "description": "Links to the order that discontinued this entry."}, {"column_name": "order_provider_id", "description": "Anonymous ID for the provider who placed the order."}, {"column_name": "order_status", "description": "Indicates if the order is Active or Inactive."}], "class": "hosp", "link": [{"link_table": "poe_detail", "link_column": "poe_id"}]}
21
+ {"file_name": "poe_detail", "description": "Provides detailed POE order data using an Entity-Attribute-Value (EAV) model for flexible attribute storage.", "columns": [{"column_name": "poe_id", "description": "Unique order ID, combining subject_id and poe_seq (format: subject_id-poe_seq)."}, {"column_name": "poe_seq", "description": "Sequential integer to order POE entries chronologically."}, {"column_name": "subject_id", "description": "Unique patient identifier; links all rows for the same patient."}, {"column_name": "field_name", "description": "Name of the specific POE order attribute described in the row."}, {"column_name": "field_value", "description": "Value for the given POE order and field_name."}], "class": "hosp", "link": [{"link_table": "poe", "link_column": "poe_id"}]}
22
+ {"file_name": "prescriptions", "description": "Contains prescribed medications, including drug names, codes (GSN, NDC), strength, dose, and administration route.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "pharmacy_id", "description": "Links to pharmacy and emar tables."}, {"column_name": "poe_id", "description": "Links prescription to poe order."}, {"column_name": "poe_seq", "description": "Links prescription to poe order."}, {"column_name": "order_provider_id", "description": "Anonymous provider identifier for order initiator."}, {"column_name": "starttime", "description": "Medication start time."}, {"column_name": "stoptime", "description": "Medication stop time."}, {"column_name": "drug_type", "description": "Prescription component: MAIN, BASE, or ADDITIVE."}, {"column_name": "drug", "description": "Free-text medication name."}, {"column_name": "formulary_drug_cd", "description": "Hospital formulary drug code."}, {"column_name": "gsn", "description": "Generic Sequence Number for medication."}, {"column_name": "ndc", "description": "National Drug Code for medication."}, {"column_name": "prod_strength", "description": "Free-text medication strength."}, {"column_name": "form_rx", "description": "Form in which dose is delivered."}, {"column_name": "dose_val_rx", "description": "Prescribed dose amount."}, {"column_name": "dose_unit_rx", "description": "Dose unit of measurement."}, {"column_name": "form_val_disp", "description": "Amount in one formulary dose."}, {"column_name": "form_unit_disp", "description": "Unit for formulary dose."}, {"column_name": "doses_per_24_hrs", "description": "Number of doses per 24 hours."}, {"column_name": "route", "description": "Medication administration route."}], "class": "hosp", "link": [{"link_table": "pharmacy", "link_column": "pharmacy_id"}, {"link_table": "emar", "link_column": "pharmacy_id"}]}
23
+ {"file_name": "procedures_icd", "description": "Records all hospital-billed procedures for patients using ICD-9 and ICD-10 codes.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "seq_num", "description": "Procedure priority within the hospital stay."}, {"column_name": "chartdate", "description": "Date of the procedure."}, {"column_name": "icd_code", "description": "ICD procedure code."}, {"column_name": "icd_version", "description": "ICD version: 9 (ICD-9) or 10 (ICD-10)."}], "class": "hosp", "link": [{"link_table": "d_icd_procedures", "link_column": "icd_code"}]}
24
+ {"file_name": "services", "description": "Lists the hospital service a patient was admitted under, using service abbreviations and descriptions.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "transfertime", "description": "Time patient transferred to curr_service."}, {"column_name": "prev_service", "description": "Previous service assigned to patient."}, {"column_name": "curr_service", "description": "Current service assigned to patient."}], "appendices": [{"abbreviations": "CMED", "description": "Cardiac Medical - non-surgical cardiac care"}, {"abbreviations": "CSURG", "description": "Cardiac Surgery - surgical cardiac care"}, {"abbreviations": "DENT", "description": "Dental - dental or jaw care"}, {"abbreviations": "ENT", "description": "Ear, nose, and throat conditions"}, {"abbreviations": "EYE", "description": "Eye diseases and subspecialties"}, {"abbreviations": "GU", "description": "Genitourinary - reproductive or urinary care"}, {"abbreviations": "GYN", "description": "Gynecological - female reproductive or breast care"}, {"abbreviations": "MED", "description": "Medical - general internal medicine"}, {"abbreviations": "NB", "description": "Newborn - infants born in hospital"}, {"abbreviations": "NBB", "description": "Newborn baby - infants born in hospital"}, {"abbreviations": "NMED", "description": "Neurologic Medical - non-surgical brain care"}, {"abbreviations": "NSURG", "description": "Neurologic Surgical - brain surgery"}, {"abbreviations": "OBS", "description": "Obstetrics - childbirth and maternal care"}, {"abbreviations": "ORTHO", "description": "Orthopaedic - musculoskeletal surgery"}, {"abbreviations": "OMED", "description": "Oncologic Medical - non-surgical cancer care"}, {"abbreviations": "PSURG", "description": "Plastic - reconstructive or cosmetic surgery"}, {"abbreviations": "PSYCH", "description": "Psychiatric - mental health care"}, {"abbreviations": "SURG", "description": "Surgical - general surgery"}, {"abbreviations": "TRAUM", "description": "Trauma - injury from external harm"}, {"abbreviations": "TSURG", "description": "Thoracic Surgical - chest surgery"}, {"abbreviations": "VSURG", "description": "Vascular Surgical - circulatory system surgery"}], "class": "hosp", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}]}
25
+ {"file_name": "transfers", "description": "Tracks patient locations during hospital stays.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "transfer_id", "description": "Unique ID for each patient location."}, {"column_name": "eventtype", "description": "Type of transfer event: 'ed', 'admit', 'transfer', or 'discharge'."}, {"column_name": "careunit", "description": "Type of unit or ward where patient is located."}, {"column_name": "intime", "description": "Date and time patient entered the care unit."}, {"column_name": "outtime", "description": "Date and time patient left the care unit."}], "class": "hosp", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}]}
26
+ {"file_name": "caregiver", "description": "Lists all unique ICU caregiver IDs (caregiver_id) in the database.", "columns": [{"column_name": "caregiver_id", "description": "Unique ID for each ICU caregiver."}], "class": "icu", "link": []}
27
+ {"file_name": "d_items", "description": "Defines itemid concepts used in ICU event tables.", "columns": [{"column_name": "itemid", "description": "Unique identifier for each item."}, {"column_name": "label", "description": "Name of the concept for the itemid."}, {"column_name": "abbreviation", "description": "Common abbreviation for the label (Metavision only)."}, {"column_name": "linksto", "description": "Name of the event table containing this itemid."}, {"column_name": "category", "description": "Type of data the itemid represents (e.g., ABG, IV Medication)."}, {"column_name": "unitname", "description": "Unit of measurement for the itemid, if available."}, {"column_name": "param_type", "description": "Data type recorded: date, number, or text."}, {"column_name": "lownormalvalue", "description": "Lower reference range for the measurement."}, {"column_name": "highnormalvalue", "description": "Upper reference range for the measurement."}], "class": "icu", "link": [{"link_table": "chartevents", "link_column": "itemid"}, {"link_table": "datetimeevents", "link_column": "itemid"}, {"link_table": "inputevents", "link_column": "itemid"}, {"link_table": "outputevents", "link_column": "itemid"}, {"link_table": "procedureevents", "link_column": "itemid"}]}
28
+ {"file_name": "chartevents", "description": "chartevents stores all patient charted data during ICU stays, including vital signs, ventilator settings, lab values, and other clinical observations.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission identifier."}, {"column_name": "stay_id", "description": "Unique ICU stay identifier."}, {"column_name": "caregiver_id", "description": "Unique identifier for the documenting caregiver."}, {"column_name": "charttime", "description": "Time the observation was made."}, {"column_name": "storetime", "description": "Time the observation was entered or validated."}, {"column_name": "itemid", "description": "Identifier for the measurement type (e.g., heart rate)."}, {"column_name": "value", "description": "Measured value for the itemid; may be text or numeric."}, {"column_name": "valuenum", "description": "Numeric value for the itemid, if applicable."}, {"column_name": "valueuom", "description": "Unit of measurement for the value."}, {"column_name": "warning", "description": "Indicates if a warning was documented for this observation."}], "class": "icu", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}, {"link_table": "icustays", "link_column": "stay_id"}, {"link_table": "d_items", "link_column": "itemid"}]}
29
+ {"file_name": "datetimeevents", "description": "Stores all patient date/time events in the ICU, such as procedure dates. Dates are shifted for privacy, but time intervals remain accurate.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "stay_id", "description": "Unique ICU stay ID."}, {"column_name": "caregiver_id", "description": "Unique caregiver identifier."}, {"column_name": "charttime", "description": "Time the observation was made."}, {"column_name": "storetime", "description": "Time the observation was entered or validated."}, {"column_name": "itemid", "description": "ID for the measurement type."}, {"column_name": "value", "description": "Measured value for the itemid; may be text or numeric."}, {"column_name": "valuenum", "description": "Numeric value for the itemid, if applicable."}, {"column_name": "valueuom", "description": "Unit of measurement for value."}, {"column_name": "warning", "description": "Indicates if a warning was documented."}], "class": "icu", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}, {"link_table": "icustays", "link_column": "stay_id"}, {"link_table": "d_items", "link_column": "itemid"}]}
30
+ {"file_name": "icustays", "description": "Records ICU stays with admission and discharge times.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "stay_id", "description": "Unique ICU stay ID."}, {"column_name": "FIRST_CAREUNIT", "description": "First ICU type during the stay, from TRANSFERS."}, {"column_name": "LAST_CAREUNIT", "description": "Last ICU type during the stay, from TRANSFERS."}, {"column_name": "INTIME", "description": "ICU admission date and time."}, {"column_name": "OUTTIME", "description": "ICU discharge date and time."}, {"column_name": "LOS", "description": "ICU length of stay in fractional days."}], "class": "icu", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}]}
31
+ {"file_name": "Ingredientevents", "description": "Records ingredients given by continuous or intermittent administration, including nutrition and fluids.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "stay_id", "description": "Unique ICU stay ID."}, {"column_name": "caregiver_id", "description": "Unique caregiver identifier."}, {"column_name": "starttime", "description": "Event start time."}, {"column_name": "endtime", "description": "Event end time."}, {"column_name": "storetime", "description": "Time observation was entered or validated."}, {"column_name": "itemid", "description": "ID for the administered ingredient (e.g., norepinephrine)."}, {"column_name": "amount", "description": "Amount of substance given."}, {"column_name": "amountuom", "description": "Unit of amount given."}, {"column_name": "rate", "description": "Rate of administration."}, {"column_name": "rateuom", "description": "Unit of administration rate."}, {"column_name": "orderid", "description": "Links items in the same solution order."}, {"column_name": "linkorderid", "description": "Links related orders across changes."}, {"column_name": "statusdescription", "description": "Reason for ending delivery (e.g., Changed, Paused, FinishedRunning, Stopped, Rewritten, Flushed)."}, {"column_name": "originalamount", "description": "Initial amount in the bag at starttime."}, {"column_name": "originalrate", "description": "Planned rate entered by provider."}], "class": "icu", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}, {"link_table": "icustays", "link_column": "stay_id"}, {"link_table": "d_items", "link_column": "itemid"}]}
32
+ {"file_name": "inputevents", "description": "Records continuous infusions and intermittent drug administrations, including timing, components, and changes in delivery.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "stay_id", "description": "Unique ICU stay ID."}, {"column_name": "caregiver_id", "description": "Unique caregiver identifier."}, {"column_name": "starttime", "description": "Event start time."}, {"column_name": "endtime", "description": "Event end time."}, {"column_name": "storetime", "description": "Time observation was entered or validated."}, {"column_name": "itemid", "description": "ID for the administered drug or substance."}, {"column_name": "amount", "description": "Amount given to the patient."}, {"column_name": "amountuom", "description": "Unit of amount given."}, {"column_name": "rate", "description": "Rate of administration."}, {"column_name": "rateuom", "description": "Unit of administration rate."}, {"column_name": "orderid", "description": "Links items in the same solution order."}, {"column_name": "linkorderid", "description": "Links related orders across changes."}, {"column_name": "statusdescription", "description": "Reason for ending delivery (e.g., changed, paused, finished, stopped, rewritten, flushed)."}, {"column_name": "ordercategoryname", "description": "Order category (type of administration)."}, {"column_name": "secondaryordercategoryname", "description": "Secondary order category."}, {"column_name": "ordercomponenttypedescription", "description": "Role of substance in solution (main, additive, mixed)."}, {"column_name": "ordercategorydescription", "description": "Description of order category."}, {"column_name": "patientweight", "description": "Patient weight in kilograms."}, {"column_name": "totalamount", "description": "Total fluid amount in the infusion bag."}, {"column_name": "totalamountuom", "description": "Unit of total fluid amount."}, {"column_name": "isopenbag", "description": "Indicates if order used an open bag."}, {"column_name": "continueinnextdept", "description": "Indicates if order continued after transfer."}, {"column_name": "originalamount", "description": "Drug amount in bag at starttime."}, {"column_name": "originalrate", "description": "Planned rate entered by provider."}], "class": "icu", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}, {"link_table": "icustays", "link_column": "stay_id"}, {"link_table": "d_items", "link_column": "itemid"}]}
33
+ {"file_name": "outputevents", "description": "Records patient outputs such as urine and drainage.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "stay_id", "description": "Unique ICU stay ID."}, {"column_name": "caregiver_id", "description": "ID for the documenting caregiver."}, {"column_name": "charttime", "description": "Time of the output event."}, {"column_name": "storetime", "description": "Time the observation was entered or validated."}, {"column_name": "itemid", "description": "ID for the type of measurement."}, {"column_name": "value", "description": "Amount of substance at charttime."}, {"column_name": "valueuom", "description": "Unit of measurement for value."}], "class": "icu", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}, {"link_table": "icustas", "link_column": "stay_id"}, {"link_table": "d_items", "link_column": "itemid"}]}
34
+ {"file_name": "procedureevents", "description": "Records procedures during ICU stay, including those done outside the ICU.", "columns": [{"column_name": "subject_id", "description": "Unique patient ID."}, {"column_name": "hadm_id", "description": "Unique hospital admission ID."}, {"column_name": "stay_id", "description": "Unique ICU stay ID."}, {"column_name": "caregiver_id", "description": "Unique caregiver ID documenting the event."}, {"column_name": "starttime", "description": "Procedure start time."}, {"column_name": "endtime", "description": "Procedure end time."}, {"column_name": "storetime", "description": "Time event was recorded."}, {"column_name": "itemid", "description": "ID for procedure type; links to d_items."}, {"column_name": "value", "description": "Duration of procedure, if applicable."}, {"column_name": "valueuom", "description": "Unit for value (e.g., min, hour, day, or None for instantaneous procedures)."}, {"column_name": "location", "description": "Body site of procedure."}, {"column_name": "locationcategory", "description": "Category of body site."}, {"column_name": "orderid", "description": "Links procedure to physician order; repeated procedures may share orderid."}, {"column_name": "linkorderid", "description": "Links to original order if procedure repeated; otherwise matches orderid."}, {"column_name": "ordercategoryname", "description": "Order category name."}, {"column_name": "ordercategorydescription", "description": "Order category description."}, {"column_name": "patientweight", "description": "Patient weight in kg."}, {"column_name": "isopenbag", "description": "Indicates if order used an open bag."}, {"column_name": "continueinnextdept", "description": "Indicates if order continued after transfer."}, {"column_name": "statusdescription", "description": "Final status of procedure (e.g., Paused, FinishedRunning, Stopped)."}, {"column_name": "originalamount", "description": "Field present but meaning unclear."}, {"column_name": "originalrate", "description": "Field present but meaning unclear; value is 0 or 1."}], "class": "icu", "link": [{"link_table": "patients", "link_column": "subject_id"}, {"link_table": "admissions", "link_column": "hadm_id"}, {"link_table": "icustays", "link_column": "stay_id"}, {"link_table": "d_items", "link_column": "itemid"}]}
35
+ {"file_name": "diagnosis", "description": "Lists billed diagnoses assigned after emergency department discharge.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "stay_id", "description": "Unique identifier for an emergency department stay."}, {"column_name": "charttime", "description": "Time diagnosis was recorded."}, {"column_name": "seq_num", "description": "Diagnosis priority; 1 is usually primary."}, {"column_name": "icd_code", "description": "Diagnosis code from ICD system."}, {"column_name": "icd_version", "description": "ICD version used: 9 (ICD-9) or 10 (ICD-10)."}, {"column_name": "icd_title", "description": "Diagnosis description."}], "class": "ed", "link": [{"link_table": "edstays", "link_column": "stay_id"}]}
36
+ {"file_name": "edstays", "description": "Tracks emergency department visits with entry and exit times.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Hospital admission ID if admitted after ED stay; NULL if not admitted."}, {"column_name": "stay_id", "description": "Unique ID for each ED stay."}, {"column_name": "intime", "description": "ED admission datetime."}, {"column_name": "outtime", "description": "ED discharge datetime."}, {"column_name": "gender", "description": "Patient's administrative gender."}, {"column_name": "race", "description": "Patient's self-reported race, grouped into categories."}, {"column_name": "arrival_transport", "description": "How the patient arrived at the ED (e.g., WALK IN, AMBULANCE)."}, {"column_name": "disposition", "description": "How the patient left the ED (e.g., HOME, ADMITTED, EXPIRED)."}], "class": "ed", "link": []}
37
+ {"file_name": "medrecon", "description": "Records medications patients report taking at ED admission for medication reconciliation.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "stay_id", "description": "Unique identifier for an ED stay."}, {"column_name": "charttime", "description": "Time medication reconciliation was recorded."}, {"column_name": "name", "description": "Medication name."}, {"column_name": "gsn", "description": "Generic Sequence Number for the medication."}, {"column_name": "ndc", "description": "National Drug Code for the medication."}, {"column_name": "etc_rn", "description": "Sequence number for each Enhanced Therapeutic Class group."}, {"column_name": "etccode", "description": "Code for the Enhanced Therapeutic Class group."}, {"column_name": "etcdescription", "description": "Description of the Enhanced Therapeutic Class group."}], "class": "ed", "link": [{"link_table": "edstays", "link_column": "stay_id"}]}
38
+ {"file_name": "pyxis", "description": "Contains medication dispensation records from the Pyxis system.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "stay_id", "description": "Unique ID for an emergency department stay."}, {"column_name": "charttime", "description": "Time medication was charted."}, {"column_name": "med_rn", "description": "Row number grouping single dispensations."}, {"column_name": "name", "description": "Medicine name."}, {"column_name": "gsn", "description": "Generic Sequence Number code for the medicine."}, {"column_name": "gsn_rn", "description": "Row number distinguishing GSN groupings."}], "class": "ed", "link": [{"link_table": "edstays", "link_column": "stay_id"}]}
39
+ {"file_name": "triage", "description": "Contains initial triage data for emergency department patients, including assessment, vital signs, and assigned acuity level.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "stay_id", "description": "Unique identifier for an emergency department stay."}, {"column_name": "temperature", "description": "Patient temperature in Fahrenheit; some may be in Celsius."}, {"column_name": "heartrate", "description": "Heart rate in beats per minute."}, {"column_name": "resprate", "description": "Respiratory rate in breaths per minute."}, {"column_name": "o2sat", "description": "Peripheral oxygen saturation percentage."}, {"column_name": "sbp", "description": "Systolic blood pressure in mmHg."}, {"column_name": "dbp", "description": "Diastolic blood pressure in mmHg."}, {"column_name": "pain", "description": "Self-reported pain level (0-10)."}, {"column_name": "acuity", "description": "Emergency Severity Index (ESI) triage level (1=highest, 5=lowest)."}, {"column_name": "acuity", "description": "ESI triage level assigned by nurse: 1 (critical, immediate care), 2 (high risk), 3 (needs ≥2 resources, stable), 4 (needs 1 resource), 5 (no resources needed)."}, {"column_name": "chiefcomplaint", "description": "Deidentified free-text chief complaint."}], "class": "ed", "link": [{"link_table": "edstays", "link_column": "stay_id"}]}
40
+ {"file_name": "vitalsign", "description": "Stores routine vital signs recorded every 1-4 hours for emergency department patients.", "columns": [{"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "stay_id", "description": "Unique identifier for an emergency department stay."}, {"column_name": "charttime", "description": "Time vital signs were recorded."}, {"column_name": "temperature", "description": "Patient temperature in Fahrenheit; some may be in Celsius."}, {"column_name": "heartrate", "description": "Heart rate in beats per minute."}, {"column_name": "resprate", "description": "Respiratory rate in breaths per minute."}, {"column_name": "o2sat", "description": "Oxygen saturation percentage."}, {"column_name": "sbp", "description": "Systolic blood pressure in mmHg."}, {"column_name": "dbp", "description": "Diastolic blood pressure in mmHg."}, {"column_name": "rhythm", "description": "Heart rhythm."}, {"column_name": "pain", "description": "Self-reported pain level (0-10), may include free-text."}], "class": "ed", "link": [{"link_table": "edstays", "link_column": "stay_id"}]}
41
+ {"file_name": "discharge", "description": "Contains discharge summaries detailing hospital admission, hospital course, and discharge instructions.", "columns": [{"column_name": "note_id", "description": "Unique note ID combining subject_id, note_type, and note_seq."}, {"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique hospitalization identifier."}, {"column_name": "note_type", "description": "Type of note: 'DS' for discharge summary, 'AD' for addendum."}, {"column_name": "note_seq", "description": "Sequential number for ordering notes within note_type."}, {"column_name": "charttime", "description": "Time when the note was charted."}, {"column_name": "storetime", "description": "Time when the note was stored in the database."}], "class": "note", "link": [{"link_table": "discharge_detail", "link_column": "note_id"}]}
42
+ {"file_name": "discharge_detail", "description": "Stores extra details for discharge notes, linked by note_id.", "columns": [{"column_name": "note_id", "description": "Unique note ID, formatted as subject_id-note_type-note_seq."}, {"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "field_name", "description": "Name of the note detail, such as author."}, {"column_name": "field_value", "description": "Value for the given field_name, e.g., the author's name."}], "class": "note", "link": [{"link_table": "discharge", "link_column": "note_id"}]}
43
+ {"file_name": "radiology", "description": "Contains free-text radiology reports from various imaging modalities, following semi-structured templates.", "columns": [{"column_name": "note_id", "description": "Unique note identifier combining subject_id, note_type, and note_seq."}, {"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "hadm_id", "description": "Unique identifier for each hospital admission."}, {"column_name": "note_type", "description": "Type of note: 'RR' for report, 'AR' for addendum."}, {"column_name": "note_seq", "description": "Sequential number ordering notes within each note_type."}, {"column_name": "charttime", "description": "Time when the note was charted."}, {"column_name": "storetime", "description": "Time when the note was stored in the database."}], "class": "note", "link": [{"link_table": "radiology_detail", "link_column": "note_id"}]}
44
+ {"file_name": "radiology_detail", "description": "Extra details for radiology notes, linked by note_id.", "columns": [{"column_name": "note_id", "description": "Unique note ID: subject_id-note_type-note_seq."}, {"column_name": "subject_id", "description": "Unique patient identifier."}, {"column_name": "field_name", "description": "Name of the note detail (e.g., addendum_note_id, cpt_code)."}, {"column_name": "field_value", "description": "Value for the specified field_name."}], "class": "note", "link": [{"link_table": "radiology", "link_column": "note_id"}]}
45
+ {"file_name": "diagnoses_ccs_candidates", "description": "Lists ICD-9 and ICD-10 diagnosis codes in CCS Level used for patient billing.", "columns": [{"column_name": "icd_code", "description": "ICD diagnosis code."}, {"column_name": "icd_version", "description": "ICD version: 9 or 10. ICD-9 codes are numeric (sometimes with E or V), ICD-10 codes start with a letter."}, {"column_name": "candidate", "description": "Full description of the ICD code in CCS Level."}], "class": "hosp", "link": []}
46
+ {"file_name": "procedures_ccs_candidates", "description": "Defines ICD procedure codes in CCS Level used for billing and identifying performed procedures.", "columns": [{"column_name": "icd_code", "description": "ICD procedure code."}, {"column_name": "icd_version", "description": "ICD version: 9 (ICD-9) or 10 (ICD-10); decimals are optional."}, {"column_name": "long_title", "description": "Brief definition of the procedure code in CCS Level."}], "class": "hosp", "link": []}
47
+ {"file_name": "labevents_candidates", "description": "Defines all lab measurement itemids used in MIMIC. Links lab events to item details, including fluid, category, and label. Most items map to LOINC codes for interoperability.", "columns": [{"column_name": "itemid", "description": "Unique ID for each lab concept; links to labevents."}, {"column_name": "label", "description": "Name of the lab concept for the itemid."}, {"column_name": "fluid", "description": "Type of fluid measured, such as blood or urine."}, {"column_name": "category", "description": "General type of measurement, e.g., ABG."}], "class": "hosp", "link": []}
48
+ {"file_name": "prescriptions_atc_candidates", "description": "Contains unique drug names prescribed to patients, used as candidate values for medication selection.", "columns": [{"column_name": "ndc_code", "description": "National Drug Code for medication."}, {"column_name": "long_drug_name", "description": "Complete drug name."}, {"column_name": "candidate", "description": "As candidate column for choosing the correct value. Drug name for Anatomical Therapeutic Chemical classification system."}], "class": "hosp", "link": []}
49
+ {"file_name": "radiology_candidates", "description": "Contains unique radiology exam names extracted from radiology_detail, used as candidate values for exam selection.", "columns": [{"column_name": "candidate", "description": "As candidate column for choosing the correct value."}], "class": "hosp", "link": []}
50
+ {"file_name": "transfers_candidates", "description": "Contains unique careunit names from patient transfer events, used as candidate values for careunit selection.", "columns": [{"column_name": "candidate", "description": "As candidate column for choosing the correct value."}], "class": "hosp", "link": []}
51
+ {"file_name": "microbiologyevents_candidates", "description": "Contains unique microbiology test names, used as candidate values for microbiological event selection.", "columns": [{"column_name": "candidate", "description": "As candidate column for choosing the correct value."}], "class": "hosp", "link": []}
data/ehr_bench/table_description/table_description.json ADDED
The diff for this file is too large to render. See raw diff