<< All versions

Skill v1.0.0

currentAutomated scan100/100
hannesill/m4/urine-output-rate
──Details
PublishedOctober 26, 2026 at 01:22 AM
Content Hashsha256:25a585762ca741c4...
Git SHA5f6688a2a98e
──Files
Files (1 file, 4.6 KB)
SKILL.md4.6 KBactive
SKILL.md · 111 lines · 4.6 KB

version: "1.0.0" name: urine-output-rate description: Calculate rolling urine output rates (mL/kg/hr) over 6/12/24-hour windows for ICU patients. Use for KDIGO AKI staging (urine output criterion) or SOFA renal component. tier: validated category: clinical


Urine Output Rate

Calculates weight-normalized urine output rates over rolling 6, 12, and 24-hour windows. These rates are used for KDIGO AKI staging (oliguria criterion: UO < 0.5 mL/kg/hr for >= 6 hours) and the SOFA renal component.

M4Bench Use

In M4Bench, target concept tables listed in the task configuration are removed or unavailable in the agent database. Use this skill as procedural guidance and derive the requested output from available source or intermediate tables; do not rely on a precomputed target table or bundled SQL script.

When to Use This Skill

  • KDIGO AKI staging (urine output criterion)
  • SOFA renal component computation
  • Fluid balance studies
  • Oliguria detection and monitoring
  • Renal function assessment in critically ill patients

Computation Methodology

1. Urine Output Aggregation

Aggregate raw output events per (stay_id, charttime) from mimiciv_icu.outputevents.

Urine output itemids (MIMIC-IV):

  • 226559, 226560, 226561, 226584, 226563, 226564, 226565, 226567, 226557, 226558, 227488, 227489

Sign convention: Itemid 227488 (GU irrigant return) has inverted sign — positive values are multiplied by -1.

2. ICU Time Boundaries

ICU stay boundaries are derived from heart rate charting (itemid 220045) rather than icustays.intime/outtime:

For each ICU stay, use the earliest and latest linked heart-rate charting times as the observation boundary. Include heart-rate charting events linked to the stay and occurring within one month before the recorded ICU intime and one month after the recorded ICU outtime.

3. Time Delta Computation

LAG function computes time since the previous UO measurement:

  • First measurement: Minutes from intime_hr to first charttime
  • Subsequent: Minutes from previous charttime to current charttime

4. Rolling Window Aggregation

Self-join computes rolling sums. For each UO measurement at time T, include all prior measurements within the window:

WindowInclude measurements whereHour cutoff
6-hourDATE_DIFF(hours) <= 5<= 5h
12-hourDATE_DIFF(hours) <= 11<= 11h
24-hourAll in self-join rangeNo filter

The self-join condition bounds the outer range: io.charttime <= iosum.charttime + INTERVAL '23' HOUR.

Both urineoutput (mL) and tm_since_last_uo (minutes → hours) are summed within each window.

5. Weight Normalization

Patient weight comes from charted weight intervals, joined with temporal overlap: Use the charted weight interval that covers the urine-output measurement time. The measurement time must be after the weight interval start and at or before the weight interval end, and the selected weight must be positive.

6. Minimum Coverage Rules

Rates are only computed when sufficient observation time exists:

Rate ColumnMinimum uo_tm Required
uo_mlkghr_6hruo_tm_6hr >= 6 hours
uo_mlkghr_12hruo_tm_12hr >= 12 hours
uo_mlkghr_24hruo_tm_24hr >= 24 hours

Formula: rate = urineoutput_Xhr / weight / uo_tm_Xhr

7. Rounding

  • Rate columns (uo_mlkghr_*): ROUND to 4 decimal places
  • Time columns (uo_tm_*): ROUND to 2 decimal places

Critical Implementation Notes

  1. Self-join, not window function: The rolling window uses a self-join (not ROWS BETWEEN), because observations are irregularly spaced in time.
  1. Hour cutoffs are off-by-one: The 6hr window uses <= 5 hours, 12hr uses <= 11 hours. This is because the current measurement's own tm_since_last_uo is included in the sum, adding up to the full window.
  1. Missing weight: If no weight is available, all rate columns are NULL (not zero).
  1. Time units: DATE_DIFF uses microseconds for precision: divide by 60000000 for minutes, 3600000000 for hours.
  1. Output cardinality: Multiple rows per stay (one per UO charting event). Key is (stay_id, charttime).

Source Tables

  • mimiciv_icu.outputevents — Raw UO events (for raw mode)
  • mimiciv_icu.chartevents — HR for ICU boundaries and charted weight
  • mimiciv_icu.icustays — ICU stay identifiers

References

  • KDIGO Clinical Practice Guideline for Acute Kidney Injury. Kidney Int Suppl. 2012;2(1):1-138.
  • Kellum JA et al. "Classifying AKI by Urine Output versus Serum Creatinine Level." JASN. 2015;26(9):2231-2238.
All versions