hannesill/m4/hfrs
Claude Code and agent skill by hannesill/m4
- community
Checking that the SKILL.md file is still in the repository.
Calculate Hospital Frailty Risk Score (HFRS) for ICU patients using ICD diagnosis codes. Use for frailty assessment, risk stratification, or outcome prediction in older patients. Supports both ICD-9-CM and ICD-10-CM codes for MIMIC-IV compatibility.
Install
npx vskill@latest install hannesill/m4/hfrsSKILL.md
Hospital Frailty Risk Score (HFRS)
Calculate HFRS from ICD diagnosis codes. Based on Gilbert et al. (2018) Lancet methodology with 109 weighted ICD-10 codes.
When to Use This Skill
- Assessing frailty in ICU or hospitalized patients
- Risk stratification for older adults
- Predicting 30-day mortality, prolonged length of stay, or readmission
- Research requiring a validated frailty metric from administrative data
Methodology
Per the original publication, HFRS is calculated using diagnoses from:
- The current (index) admission
- All emergency admissions in the preceding 2 years
Each unique ICD code is counted only once, even if it appears in multiple admissions.
Risk Categories
| Score | Category | 30-day Mortality OR | |
|---|---|---|---|
| < 5 | Low | Reference | |
| 5-15 | Intermediate | 1.65 (1.62-1.68) | |
| > 15 | High | 1.71 (1.68-1.75) |
Critical Implementation Notes
- ICD-9 mappings are NOT part of the original publication. They have been added for MIMIC-IV compatibility, which contains both ICD-9 and ICD-10 coded admissions. Use ICD-9 mappings with appropriate caution.
- Emergency admission types in MIMIC-IV: The SQL implementation considers
EMERGENCY,URGENT, andEW EMER.as emergency admissions.
- Code matching uses 3-character prefix for ICD-10 (e.g.,
F05matchesF05.0,F05.1). ICD-9 uses variable-length matching.
Top Contributing Codes
| ICD-10 | Points | Description | |
|---|---|---|---|
| F00 | 7.1 | Dementia in Alzheimer's | |
| G81 | 4.4 | Hemiplegia | |
| G30 | 4.0 | Alzheimer's disease | |
| I69 | 3.7 | Sequelae of CVD | |
| R29 | 3.6 | Tendency to fall | |
| F05 | 3.2 | Delirium | |
| N39 | 3.2 | UTI/incontinence | |
| W19 | 3.2 | Unspecified fall |
Full 109-code list: references/hfrs_icd_codes.csv
Example Queries
Calculate HFRS for all admissions
Python: ad-hoc calculation
References
- Gilbert T, et al. "Development and validation of a Hospital Frailty Risk Score focusing on older people in acute care settings using electronic hospital records: an observational study." Lancet. 2018;391:1775-82.
Security
- Security scanPassed, 95 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/hfrs/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/hfrs)