hannesill/m4/urine-output-rate

Claude Code and agent skill by hannesill/m4

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

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.

Install

npx vskill@latest install hannesill/m4/urine-output-rate

SKILL.md

The same SKILL.md was published earlier as 28sungmin/m4-add-skills/urine-output-rate.

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.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hannesill/m4/urine-output-rate/badge)](https://verified-skill.com/skills/hannesill/m4/urine-output-rate)

Something wrong with this skill or its page? Tell us.