hannesill/m4/first-icu-stay
Claude Code and agent skill by hannesill/m4
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Identify first ICU stays and first hospital admissions for cohort selection. Use to exclude readmissions, create independent observations, or build adult patient cohorts.
Install
npx vskill@latest install hannesill/m4/first-icu-staySKILL.md
First ICU Stay Selection
Identifies first ICU stays and hospital admissions for cohort construction. Critical for avoiding correlated observations and inflated sample sizes from readmissions.
When to Use This Skill
- Creating research cohorts with independent observations
- Excluding readmissions that may have different characteristics
- Selecting incident (first-time) ICU patients
- Matching cohorts by admission characteristics
Pre-computed Table
Key Columns Explained
Hospital-Level
hospstay_seq: Order of hospital admission for this patient (1 = first ever)first_hosp_stay: TRUE if this is the patient's first hospital admission
ICU-Level (Within Hospitalization)
icustay_seq: Order of ICU stays within this hospitalization (1 = first ICU stay)first_icu_stay: TRUE if this is the first ICU stay of the current hospitalization
Age Calculation
Age is calculated as:
Important: MIMIC-IV shifts ages for patients > 89 years old at any admission. These patients have anchor_age = 91 and ages are not exact.
Common Cohort Selection Patterns
First ICU Stay Only (Most Common)
First-Ever ICU Stay (Strictest)
Adult Patients Only
Exclude Very Short Stays
Critical Implementation Notes
- Multiple ICU Stays: One hospitalization can have multiple ICU stays.
first_icu_stayidentifies the first ICU stay within each hospitalization.
- Patient-Level vs Stay-Level: Choose the right level of independence:
first_hosp_stay = TRUE AND first_icu_stay = TRUE: Most independentfirst_icu_stay = TRUE: Independent within each hospitalization- All stays: May have correlated outcomes
- Age Shifting: Ages > 89 are shifted to protect privacy. Anchor age is 91, actual age is approximated.
- Mortality Flags:
hospital_expire_flag: Died during this hospitalizationdod: Date of death (may be after discharge)
- LOS Calculations:
los_hospital: Days from admission to dischargelos_icu: Days from ICU admission to ICU discharge
Example: Standard Adult Cohort
Example: Readmission Analysis
Example: Age Distribution
Related Exclusion Criteria
Common additional exclusions for research cohorts:
- Comfort care / DNR orders if your local dataset includes a validated code-status concept
- Organ donors
- Very short stays (< 4-24 hours)
- Missing key data elements
- Specific diagnoses (trauma, cardiac surgery, etc.)
References
- Johnson AEW et al. "MIMIC-IV, a freely accessible electronic health record dataset." Scientific Data. 2023.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/m4/skills/clinical/first-icu-stay/SKILL.md
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
[](https://verified-skill.com/skills/hannesill/m4/first-icu-stay)