hfrs

Calculate Hospital Frailty Risk Score from ICD codes with two-year admission history.

40|17|Updated Oct 27, 2025
One-click install
npx skills add https://github.com/hannesill/m4 --skill hfrs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hfrs
Source: https://github.com/hannesill/m4/tree/main/src/m4/skills/clinical/hfrs
Command: npx skills add https://github.com/hannesill/m4 --skill hfrs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables clinicians and data scientists to compute the Hospital Frailty Risk Score (HFRS) from ICD diagnosis codes, enabling frailty assessment and risk stratification using current and prior admissions.

Core Features & Use Cases

  • ICD-based frailty scoring: derives HFRS from ICD-10 and ICD-9 mappings, enabling compatibility with datasets like MIMIC-IV.
  • Two-year history integration: incorporates the index admission plus emergency admissions in the preceding two years to reflect frailty status.
  • Output and reuse: returns a numeric score, risk category, and the list of contributing codes, with Python and SQL examples for reproducible analysis.

Quick Start

Provide a list of ICD-coded diagnoses for a patient and run the calculation to obtain the HFRS score.

Frequently Asked Questions about hfrs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate the Hospital Frailty Risk Score from ICD codes?

To calculate the Hospital Frailty Risk Score (HFRS), you provide a list of ICD-10 or ICD-9 diagnosis codes from a patient's current and prior two-year emergency admissions to compute a weighted numeric score and risk category.

Does the HFRS frailty score calculation work with MIMIC-IV datasets?

Yes, the HFRS calculation is explicitly designed for ICU and acute care datasets like MIMIC-IV, supporting both ICD-9-CM and ICD-10-CM diagnosis code mappings to assess patient frailty.

How do I compute frailty risk scores using Python or SQL?

You can compute frailty risk scores using provided Python and SQL examples that take ICD-coded diagnoses as input, map the codes to weights, deduplicate them, and return a numeric score with matched codes.

What ICD code history is needed to assess frailty using the HFRS?

Assessing frailty using the HFRS requires ICD diagnosis codes from the index admission plus emergency admissions from the preceding two years to accurately reflect the patient's frailty status.

What outputs are returned when calculating the Hospital Frailty Risk Score?

Calculating the Hospital Frailty Risk Score returns a deterministic numeric score, a categorical risk level, and the specific list of contributing ICD codes matched during the computation.