apsiii-score
Calculate APACHE III (Acute Physiology Score III) for ICU patients in MIMIC-IV. Use for mortality prediction, severity stratification, case-mix adjustment, or risk-adjusted outcome comparisons.
Best use case
apsiii-score is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Calculate APACHE III (Acute Physiology Score III) for ICU patients in MIMIC-IV. Use for mortality prediction, severity stratification, case-mix adjustment, or risk-adjusted outcome comparisons.
Teams using apsiii-score should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/apsiii-score/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How apsiii-score Compares
| Feature / Agent | apsiii-score | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Calculate APACHE III (Acute Physiology Score III) for ICU patients in MIMIC-IV. Use for mortality prediction, severity stratification, case-mix adjustment, or risk-adjusted outcome comparisons.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# APACHE III (APS III) Score Calculation
The Acute Physiology Score III (APS III) is the physiological component of APACHE III. It measures patient severity of illness on the first day of ICU stay and provides hospital mortality probability estimates.
## When to Use This Skill
- Hospital mortality prediction
- Severity stratification and risk adjustment
- Case-mix adjustment for benchmarking
- Comparing outcomes across ICUs or time periods
- Research cohort severity matching
## Score Components
The APS III uses the **worst values** from the first 24 hours of ICU stay:
### Vital Signs
- Heart rate (normal reference: 75 bpm)
- Mean blood pressure (normal reference: 90 mmHg)
- Temperature (normal reference: 38C)
- Respiratory rate (normal reference: 19 breaths/min)
### Laboratory Values
- Hematocrit (normal reference: 45.5%)
- WBC (normal reference: 11.5 x10^9/L)
- Creatinine (normal reference: 1.0 mg/dL)
- BUN (scored from 0, higher is worse)
- Sodium (normal reference: 145.5 mEq/L)
- Albumin (normal reference: 3.5 g/dL)
- Bilirubin (scored from 0, higher is worse)
- Glucose (normal reference: 130 mg/dL)
### Blood Gas
- PaO2 (for non-ventilated patients with FiO2 < 50%)
- A-aDO2 (for ventilated patients with FiO2 >= 50%)
- pH and PaCO2 interaction scoring
### Other
- GCS (complex interaction between eye, verbal, motor components)
- Urine output (24-hour total)
- Mechanical ventilation status
- Acute renal failure flag
## Pre-computed Table
```sql
SELECT
subject_id,
hadm_id,
stay_id,
apsiii,
apsiii_prob, -- Predicted hospital mortality probability
hr_score,
mbp_score,
temp_score,
resp_rate_score,
pao2_aado2_score,
hematocrit_score,
wbc_score,
creatinine_score,
uo_score,
bun_score,
sodium_score,
albumin_score,
bilirubin_score,
glucose_score,
acidbase_score,
gcs_score
FROM mimiciv_derived.apsiii;
```
## Critical Implementation Notes
1. **Worst Value Definition**: "Worst" means furthest from a predefined normal reference value, not simply min or max. For example:
- Heart rate worst = MAX(|HR - 75|)
- If equally distant from normal, use the higher score
2. **Acute Renal Failure (ARF) Modifier**: ARF is defined as:
- Creatinine >= 1.5 mg/dL AND
- Urine output < 410 mL/day AND
- No chronic kidney disease (CKD stages 4-6)
3. **Ventilation Interaction**:
- For ventilated patients with FiO2 >= 50%: use A-aDO2
- For non-ventilated patients with FiO2 < 50%: use PaO2
- Only arterial blood gas specimens are used
4. **pH/PaCO2 Interaction**: The acid-base score requires both pH and PaCO2 together - different combinations yield different scores.
5. **GCS Scoring**: Complex interaction matrix between eye, verbal, and motor scores. Sedated/intubated patients default to normal (score 0).
6. **Temperature**: Axillary measurements should theoretically be increased by 1 degree, but this is not implemented.
7. **Mortality Probability**: Calculated using logistic regression:
```
apsiii_prob = 1 / (1 + exp(-(-4.4360 + 0.04726 * apsiii)))
```
## Example: Get Severity Distribution
```sql
SELECT
CASE
WHEN apsiii < 30 THEN 'Low (<30)'
WHEN apsiii < 60 THEN 'Moderate (30-59)'
WHEN apsiii < 90 THEN 'High (60-89)'
ELSE 'Very High (>=90)'
END AS severity_category,
COUNT(*) AS n_patients,
ROUND(AVG(apsiii_prob), 3) AS avg_predicted_mortality
FROM mimiciv_derived.apsiii
GROUP BY 1
ORDER BY 1;
```
## Example: Compare Predicted vs Actual Mortality
```sql
SELECT
ROUND(apsiii_prob, 1) AS predicted_mortality_decile,
COUNT(*) AS n_patients,
SUM(adm.hospital_expire_flag) AS actual_deaths,
ROUND(AVG(adm.hospital_expire_flag), 3) AS observed_mortality
FROM mimiciv_derived.apsiii a
INNER JOIN mimiciv_hosp.admissions adm
ON a.hadm_id = adm.hadm_id
GROUP BY 1
ORDER BY 1;
```
## References
- Knaus WA et al. "The APACHE III prognostic system: Risk prediction of hospital mortality for critically ill hospitalized adults." Chest. 1991;100(6):1619-1636.
- Johnson AEW. "Mortality prediction and acuity assessment in critical care." University of Oxford. 2015. (Calibration equation source)Related Skills
kimmo-agent-friendly-score
Score developer tools and SaaS products for AI agent compatibility. Use when evaluating how well a devtool works with AI coding assistants, or when optimizing a product for the agent era.
agent-scorer
Generate semantic + keyword match score. Compares resume content against job description to calculate a fit score and identify gaps.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
large-data-with-dask
Specific optimization strategies for Python scripts working with larger-than-memory datasets via Dask.
langsmith-fetch
Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Use when debugging agent behavior, investigating errors, analyzing tool calls, checking memory operations, or examining agent performance. Automatically fetches recent traces and analyzes execution patterns. Requires langsmith-fetch CLI installed.
langchain-tool-calling
How chat models call tools - includes bind_tools, tool choice strategies, parallel tool calling, and tool message handling
langchain-notes
LangChain 框架学习笔记 - 快速查找概念、代码示例和最佳实践。包含 Core components、Middleware、Advanced usage、Multi-agent patterns、RAG retrieval、Long-term memory 等主题。当用户询问 LangChain、Agent、RAG、向量存储、工具使用、记忆系统时使用此 Skill。
langchain-js
Builds LLM-powered applications with LangChain.js for chat, agents, and RAG. Use when creating AI applications with chains, memory, tools, and retrieval-augmented generation in JavaScript.
langchain-agents
Expert guidance for building LangChain agents with proper tool binding, memory, and configuration. Use when creating agents, configuring models, or setting up tool integrations in LangConfig.
lang-python
Python 3.13+ development specialist covering FastAPI, Django, async patterns, data science, testing with pytest, and modern Python features. Use when developing Python APIs, web applications, data pipelines, or writing tests.
kramme:agents-md
This skill should be used when the user asks to "update AGENTS.md", "add to AGENTS.md", "maintain agent docs", or needs to add guidelines to agent instructions. Guides discovery of local skills and enforces structured, keyword-based documentation style.
kontent-ai-automation
Automate Kontent AI tasks via Rube MCP (Composio). Always search tools first for current schemas.