hhs-hcc-risk-adjustment 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +11 -0
- package/README.md +227 -0
- package/bin/install.js +82 -0
- package/commands/hhs-hcc-lookup.md +23 -0
- package/commands/hhs-hcc-score.md +41 -0
- package/commands/hhs-hcc-transfer.md +61 -0
- package/package.json +28 -0
- package/skills/hhs-hcc-risk-adjustment/SKILL.md +145 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2018/adult_model_factors.csv +202 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2018/child_model_factors.csv +154 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2018/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2019/adult_model_factors.csv +200 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2019/child_model_factors.csv +154 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2019/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2020/adult_model_factors.csv +173 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2020/child_model_factors.csv +154 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2020/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2021/adult_model_factors.csv +203 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2021/child_model_factors.csv +160 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2021/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2022/adult_model_factors.csv +203 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2022/child_model_factors.csv +160 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2022/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2023/adult_model_factors.csv +218 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2023/child_model_factors.csv +175 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2023/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2024/adult_model_factors.csv +213 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2024/child_model_factors.csv +175 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2024/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2025/adult_model_factors.csv +212 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2025/child_model_factors.csv +174 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2025/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2026/adult_model_factors.csv +214 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2026/child_model_factors.csv +176 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2026/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2027/adult_model_factors.csv +195 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2027/child_model_factors.csv +155 -0
- package/skills/hhs-hcc-risk-adjustment/data/BY2027/infant_model_factors.csv +28 -0
- package/skills/hhs-hcc-risk-adjustment/data/csr_adjustment_factors.csv +97 -0
- package/skills/hhs-hcc-risk-adjustment/data/hcc_labels.csv +211 -0
- package/skills/hhs-hcc-risk-adjustment/data/statewide_ra_factors.csv +1010 -0
- package/skills/hhs-hcc-risk-adjustment/references/adult-model.md +170 -0
- package/skills/hhs-hcc-risk-adjustment/references/cc-hcc-hierarchies.md +93 -0
- package/skills/hhs-hcc-risk-adjustment/references/child-model.md +105 -0
- package/skills/hhs-hcc-risk-adjustment/references/claim-qualification.md +134 -0
- package/skills/hhs-hcc-risk-adjustment/references/coefficient-data.md +94 -0
- package/skills/hhs-hcc-risk-adjustment/references/csr-adjustments.md +77 -0
- package/skills/hhs-hcc-risk-adjustment/references/dx-mapping.csv +11569 -0
- package/skills/hhs-hcc-risk-adjustment/references/hcpcs-rxc.csv +87 -0
- package/skills/hhs-hcc-risk-adjustment/references/infant-model.md +100 -0
- package/skills/hhs-hcc-risk-adjustment/references/model-overview.md +96 -0
- package/skills/hhs-hcc-risk-adjustment/references/ndc-rxc.csv +15135 -0
- package/skills/hhs-hcc-risk-adjustment/references/risk-transfer-formula.md +160 -0
- package/skills/hhs-hcc-risk-adjustment/references/rxc-interactions.md +102 -0
- package/skills/hhs-hcc-risk-adjustment/references/service-code-reference.csv +21110 -0
- package/skills/hhs-hcc-risk-adjustment/references/year-changes.md +100 -0
- package/skills/hhs-hcc-risk-adjustment/scripts/__pycache__/load_coefficients.cpython-313.pyc +0 -0
- package/skills/hhs-hcc-risk-adjustment/scripts/__pycache__/load_coefficients.cpython-314.pyc +0 -0
- package/skills/hhs-hcc-risk-adjustment/scripts/load_coefficients.py +88 -0
- package/skills/hhs-hcc-risk-adjustment/scripts/lookup.py +45 -0
- package/skills/hhs-hcc-risk-adjustment/scripts/risk_transfer.py +106 -0
- package/skills/hhs-hcc-risk-adjustment/scripts/score_enrollee.py +313 -0
- package/skills/hhs-hcc-risk-adjustment/workflows/calculate-score.md +82 -0
- package/skills/hhs-hcc-risk-adjustment/workflows/compare-years.md +76 -0
- package/skills/hhs-hcc-risk-adjustment/workflows/explain-model.md +60 -0
- package/skills/hhs-hcc-risk-adjustment/workflows/lookup-coefficient.md +50 -0
- package/skills/hhs-hcc-risk-adjustment/workflows/risk-transfer.md +86 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hhs-hcc-risk-adjustment",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Domain expertise and computational tools for the HHS-HCC commercial risk adjustment model (ACA Individual & Small Group, BY2018–BY2027)",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Wesley Sanders",
|
|
7
|
+
"url": "https://evensun.com"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": ["risk-adjustment", "hhs-hcc", "aca", "cms", "health-insurance"]
|
|
11
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# HHS-HCC Risk Adjustment — Claude Code Plugin
|
|
2
|
+
|
|
3
|
+
A [Claude Code](https://claude.ai/code) plugin that gives Claude deep expertise in the **HHS-HCC commercial risk adjustment model** — the CMS model used to calculate risk scores and transfer payments for ACA Individual and Small Group plans. Covers the current V07 model (BY2021–BY2027) and the earlier V05 model (BY2018–BY2020), with bundled coefficient data for all ten benefit years.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What you can ask Claude
|
|
8
|
+
|
|
9
|
+
Once the plugin is installed, you can ask Claude questions like:
|
|
10
|
+
|
|
11
|
+
- *"What is the BY2025 Silver coefficient for HHS_HCC042?"*
|
|
12
|
+
- *"Score a 45-year-old female on a Silver CSR-1 plan with HCC042 and HCC156 flagged."*
|
|
13
|
+
- *"What changed in the severity model between BY2022 and BY2023?"*
|
|
14
|
+
- *"Why isn't this diabetes diagnosis contributing to the risk score?"*
|
|
15
|
+
- *"If our plan has a PLRS of 1.8 and statewide PLRS is 1.5, what's our transfer?"*
|
|
16
|
+
- *"Walk me through how the infant maturity × severity grid works."*
|
|
17
|
+
- *"Which ICD-10 codes map to HCC018?"*
|
|
18
|
+
- *"What J-codes trigger RXC_09?"*
|
|
19
|
+
|
|
20
|
+
Claude answers using the bundled reference data and scripts, citing the correct CMS rules for the benefit year you specify.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Model coverage
|
|
25
|
+
|
|
26
|
+
| Sub-model | Who it covers | Key distinction |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| **Adult** | AGE_LAST ≥ 21 | HCC-additive; RXC interactions; severity/transplant counters; HCC_ED short-enrollment flag |
|
|
29
|
+
| **Child** | AGE_LAST 2–20 | HCC-additive; same group flags as Adult; different severity bucket schema (6_7 and 8PLUS) |
|
|
30
|
+
| **Infant** | AGE_LAST 0–1 | Maturity × severity interaction grid — does **not** score HCCs additively |
|
|
31
|
+
|
|
32
|
+
The model family depends on the benefit year: **V07** covers BY2021 and forward; **V05** covered BY2018–BY2020. Always confirm the benefit year before interpreting a coefficient — values change annually with the NBPP.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Slash commands
|
|
37
|
+
|
|
38
|
+
| Command | What it does |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `/hhs-hcc-score` | Guided intake → runs `score_enrollee.py` → explains the output clinically |
|
|
41
|
+
| `/hhs-hcc-lookup` | Look up any coefficient by variable name, year, and metal level |
|
|
42
|
+
| `/hhs-hcc-transfer` | Compute T(i) or find the Platinum inflection point; auto-populates statewide inputs by state+year |
|
|
43
|
+
|
|
44
|
+
Or just ask Claude a question directly — the plugin activates automatically based on context.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Scripts
|
|
49
|
+
|
|
50
|
+
Pure Python 3.10+, stdlib only — no dependencies to install. Scripts live in `skills/hhs-hcc-risk-adjustment/scripts/`.
|
|
51
|
+
|
|
52
|
+
### Score an enrollee
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
python3 skills/hhs-hcc-risk-adjustment/scripts/score_enrollee.py \
|
|
56
|
+
--age 45 --sex F --metal S --csr 1 --year 2025 \
|
|
57
|
+
--hcc HHS_HCC042 HHS_HCC156 --rxc RXC_09 --enrol-duration 12
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Sub-model: Adult
|
|
62
|
+
Metal: S (column Silver_Level)
|
|
63
|
+
BY: 2025
|
|
64
|
+
|
|
65
|
+
Variable ind coef contrib
|
|
66
|
+
----------------------------------------------------------------------
|
|
67
|
+
HHS_HCC042 1 10.9030 10.9030
|
|
68
|
+
HHS_HCC156 1 7.4610 7.4610
|
|
69
|
+
RXC_09 1 0.6330 0.6330
|
|
70
|
+
FAGE_LAST_45_49 1 0.2770 0.2770
|
|
71
|
+
----------------------------------------------------------------------
|
|
72
|
+
RAW SCORE 19.2740
|
|
73
|
+
CSR factor (CSR_INDICATOR=1): 1.0000
|
|
74
|
+
CSR-ADJUSTED SCORE: 19.2740
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Key inputs:**
|
|
78
|
+
|
|
79
|
+
| Flag | Description |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `--age` | `AGE_LAST` — age on the last day of the benefit year |
|
|
82
|
+
| `--sex` | `M` or `F` |
|
|
83
|
+
| `--metal` | `P` / `G` / `S` / `B` / `C` (or full name) |
|
|
84
|
+
| `--csr` | `RA_CSR_Indicator` — CMS internal CSR code (1 = standard/no CSR; 3 = Silver state-subsidy; 4 = ZCS Platinum; etc.) |
|
|
85
|
+
| `--year` | Benefit year — selects the bundled coefficient set |
|
|
86
|
+
| `--hcc` | Space-separated HCCs **after** hierarchy and group collapsing |
|
|
87
|
+
| `--rxc` | Space-separated RXCs (Adult model only) |
|
|
88
|
+
| `--enrol-duration` | Months enrolled (1–12) — triggers `HCC_ED` short-enrollment flag |
|
|
89
|
+
| `--data-dir` | Override the bundled data with a custom coefficient directory |
|
|
90
|
+
|
|
91
|
+
### Look up a coefficient
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Single metal
|
|
95
|
+
python3 skills/hhs-hcc-risk-adjustment/scripts/lookup.py \
|
|
96
|
+
--year 2025 --model Adult --variable HHS_HCC042 --metal Silver
|
|
97
|
+
# → 10.9030
|
|
98
|
+
|
|
99
|
+
# All metals
|
|
100
|
+
python3 skills/hhs-hcc-risk-adjustment/scripts/lookup.py \
|
|
101
|
+
--year 2025 --model Infant --variable EXTREMELY_IMMATURE_X_SEVERITY5
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Compute a risk transfer
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Transfer payment per billable member-month
|
|
108
|
+
python3 skills/hhs-hcc-risk-adjustment/scripts/risk_transfer.py \
|
|
109
|
+
--plrs 1.8 --idf 1.08 --gcf 1.09 --av 0.8 --arf 1.90 \
|
|
110
|
+
--statewide-plrs 1.5 --statewide-idf 1.03 --statewide-gcf 1.0 \
|
|
111
|
+
--statewide-av 0.686 --statewide-arf 1.541 --premium 375
|
|
112
|
+
|
|
113
|
+
# Inflection point: at what PLRS does Platinum beat Gold?
|
|
114
|
+
python3 skills/hhs-hcc-risk-adjustment/scripts/risk_transfer.py --inflection \
|
|
115
|
+
--arf 1.541 --statewide-plrs 1.5 --statewide-av 0.686 --statewide-arf 1.541
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Bundled data
|
|
121
|
+
|
|
122
|
+
All data lives under `skills/hhs-hcc-risk-adjustment/`.
|
|
123
|
+
|
|
124
|
+
### Coefficient CSVs — `data/BY<YYYY>/`
|
|
125
|
+
|
|
126
|
+
Three files per benefit year: `adult_model_factors.csv`, `child_model_factors.csv`, `infant_model_factors.csv`. Each row is a model variable with five metal-level coefficients (Platinum through Catastrophic).
|
|
127
|
+
|
|
128
|
+
| Folder | CMS source revision | Model family |
|
|
129
|
+
|--------|---------------------|--------------|
|
|
130
|
+
| BY2018 | `2018_DIY_120418` | V05 |
|
|
131
|
+
| BY2019 | `2019_DIY_041520` | V05 |
|
|
132
|
+
| BY2020 | `2020_DIY_080320` | V05 |
|
|
133
|
+
| BY2021 | `2021_DIY_033122` | V07 |
|
|
134
|
+
| BY2022 | `2022_DIY_122022` | V07 |
|
|
135
|
+
| BY2023 | `2023_NBPP_050622` | V07 |
|
|
136
|
+
| BY2024 | `2024_DIY_090624` | V07 |
|
|
137
|
+
| BY2025 | `2025_DIY_072325` | V07 |
|
|
138
|
+
| BY2026 | `2026_NBPP_100524` | V07 |
|
|
139
|
+
| BY2027 | `2027_NBPP_020926` | V07 |
|
|
140
|
+
|
|
141
|
+
Where CMS published both an initial NBPP release and a later DIY revision, the DIY revision is used — it supersedes the NBPP release and incorporates corrections.
|
|
142
|
+
|
|
143
|
+
### Cross-reference tables — `data/`
|
|
144
|
+
|
|
145
|
+
| File | Contents | Rows |
|
|
146
|
+
|------|----------|------|
|
|
147
|
+
| `hcc_labels.csv` | Human-readable label and clinical category for every HCC, group flag, RXC, and interaction variable | 210 |
|
|
148
|
+
| `csr_adjustment_factors.csv` | CSR adjustment factors by CSR_Code and model year (BY2020–BY2027) | 96 |
|
|
149
|
+
| `statewide_ra_factors.csv` | Statewide PLRS, IDF, AV, ARF, avg premium, and member months by state, market, and year (BY2018–BY2024) | 1,009 |
|
|
150
|
+
|
|
151
|
+
### Code-mapping tables — `references/`
|
|
152
|
+
|
|
153
|
+
| File | Contents | Rows |
|
|
154
|
+
|------|----------|------|
|
|
155
|
+
| `dx-mapping.csv` | Full ICD-10 → CC crosswalk with age/sex edits and effective date gating | 11,568 |
|
|
156
|
+
| `hcpcs-rxc.csv` | HCPCS J-code → RXC mapping | 86 |
|
|
157
|
+
| `ndc-rxc.csv` | NDC → RXC pharmacy mapping with start/end year | 15,134 |
|
|
158
|
+
| `service-code-reference.csv` | CPT/HCPCS qualifying-service-code list | 21,109 |
|
|
159
|
+
|
|
160
|
+
### Reference documents — `references/`
|
|
161
|
+
|
|
162
|
+
| File | Covers |
|
|
163
|
+
|------|--------|
|
|
164
|
+
| `model-overview.md` | V07 architecture, sub-models, scoring formula, key terminology |
|
|
165
|
+
| `adult-model.md` | Adult variables, group flags, severity/transplant buckets, HCC_ED, RXC interactions |
|
|
166
|
+
| `child-model.md` | Child variables, group flags, severity/transplant buckets (note 6_7 and 8PLUS collapsing) |
|
|
167
|
+
| `infant-model.md` | Maturity hierarchy, severity hierarchy, AGE0/AGE1 swap, maturity × severity grid |
|
|
168
|
+
| `cc-hcc-hierarchies.md` | DX → CC mapping, CC → HCC hierarchies, group collapsing, age/sex/MCE edits |
|
|
169
|
+
| `claim-qualification.md` | Which medical claims qualify for HCC scoring; why labs, DME, and J-code-only claims don't count |
|
|
170
|
+
| `rxc-interactions.md` | RXC variables, RXC_06 → RXC_07 hierarchy, HCC × RXC interactions including the RXC_09 triple |
|
|
171
|
+
| `csr-adjustments.md` | CSR adjustment factors by HIOS variant, RA_CSR_Indicator mapping, BY2025 schedule change |
|
|
172
|
+
| `risk-transfer-formula.md` | Full CMS risk transfer formula and metal-level optimization |
|
|
173
|
+
| `year-changes.md` | NBPP year-over-year model changes (BY2018–BY2027) |
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Background: what is HHS-HCC risk adjustment?
|
|
178
|
+
|
|
179
|
+
Under the ACA, CMS runs a risk adjustment program across all non-grandfathered Individual and Small Group plans. Plans with sicker-than-average enrollees receive transfer payments from plans with healthier-than-average enrollees. This levels the playing field and reduces incentives to cherry-pick healthy members.
|
|
180
|
+
|
|
181
|
+
The **HHS-HCC model** is the risk-scoring engine. It converts each enrollee's demographics, diagnoses (mapped from medical claims to Hierarchical Condition Categories), and pharmacy fills (mapped to RXC variables) into a **Plan Liability Risk Score (PLRS)**. The PLRS feeds into the CMS transfer formula alongside state-level Induced Demand Factors (IDF), Geographic Calibration Factors (GCF), actuarial values (AV), and allowable rating factors (ARF).
|
|
182
|
+
|
|
183
|
+
CMS publishes updated model specifications annually in the **Notice of Benefit and Payment Parameters (NBPP)** and releases SAS source code, DIY Excel workbooks, and (starting BY2025) a Python package. The SAS source is the authoritative spec when sources disagree.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Installing the plugin
|
|
188
|
+
|
|
189
|
+
### Option 1 — npx (recommended)
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
npx hhs-hcc-risk-adjustment
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
This copies the plugin to `~/.claude/plugins/hhs-hcc-risk-adjustment/` and adds it to your global `~/.claude/settings.json` automatically. Restart Claude Code afterward.
|
|
196
|
+
|
|
197
|
+
Safe to re-run — it won't add a duplicate entry.
|
|
198
|
+
|
|
199
|
+
### Option 2 — manual
|
|
200
|
+
|
|
201
|
+
Clone the repo and add the plugin path to your Claude Code settings.
|
|
202
|
+
|
|
203
|
+
**User-level** (`~/.claude/settings.json`):
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"plugins": [
|
|
207
|
+
{ "path": "/path/to/skills/hhs-hcc-risk-adjustment" }
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Project-level** (`.claude/settings.json` in your project):
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"plugins": [
|
|
216
|
+
{ "path": "/path/to/skills/hhs-hcc-risk-adjustment" }
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
Code and scripts: [MIT](../LICENSE) — © 2026 Wesley Sanders.
|
|
226
|
+
|
|
227
|
+
CMS model specifications, coefficient tables, and code-mapping crosswalks are U.S. government works in the public domain (published by the Centers for Medicare & Medicaid Services under the ACA risk adjustment program).
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
|
|
8
|
+
const PLUGIN_NAME = 'hhs-hcc-risk-adjustment';
|
|
9
|
+
const CLAUDE_DIR = path.join(os.homedir(), '.claude');
|
|
10
|
+
const INSTALL_DIR = path.join(CLAUDE_DIR, 'plugins', PLUGIN_NAME);
|
|
11
|
+
const SETTINGS_PATH = path.join(CLAUDE_DIR, 'settings.json');
|
|
12
|
+
|
|
13
|
+
// Package root is one level up from bin/
|
|
14
|
+
const SOURCE_DIR = path.join(__dirname, '..');
|
|
15
|
+
|
|
16
|
+
// Directories/files to skip at the top level of the package
|
|
17
|
+
const TOP_LEVEL_SKIP = new Set([
|
|
18
|
+
'bin', 'node_modules', 'package.json', 'package-lock.json',
|
|
19
|
+
'.git', 'scripts', // scripts/ at plugin root is stale; real scripts are in skills/
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
function copyDir(src, dest, topLevel = false) {
|
|
23
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
24
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
25
|
+
if (entry.name.startsWith('.') && entry.name !== '.claude-plugin') continue;
|
|
26
|
+
if (topLevel && TOP_LEVEL_SKIP.has(entry.name)) continue;
|
|
27
|
+
if (entry.name === 'node_modules' || entry.name === '__pycache__') continue;
|
|
28
|
+
const s = path.join(src, entry.name);
|
|
29
|
+
const d = path.join(dest, entry.name);
|
|
30
|
+
entry.isDirectory() ? copyDir(s, d) : fs.copyFileSync(s, d);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function patchSettings(pluginPath) {
|
|
35
|
+
let settings = {};
|
|
36
|
+
if (fs.existsSync(SETTINGS_PATH)) {
|
|
37
|
+
try { settings = JSON.parse(fs.readFileSync(SETTINGS_PATH, 'utf8')); }
|
|
38
|
+
catch { console.warn(`Warning: could not parse ${SETTINGS_PATH} — will create a new one.`); }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Support both skills[] and plugins[] arrays
|
|
42
|
+
if (!Array.isArray(settings.plugins)) settings.plugins = [];
|
|
43
|
+
|
|
44
|
+
const already = settings.plugins.some(
|
|
45
|
+
(p) => (typeof p === 'string' ? p : p?.path) === pluginPath
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
if (!already) {
|
|
49
|
+
settings.plugins.push({ path: pluginPath });
|
|
50
|
+
fs.mkdirSync(CLAUDE_DIR, { recursive: true });
|
|
51
|
+
fs.writeFileSync(SETTINGS_PATH, JSON.stringify(settings, null, 2) + '\n', 'utf8');
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function main() {
|
|
58
|
+
console.log(`\nInstalling ${PLUGIN_NAME} plugin...\n`);
|
|
59
|
+
|
|
60
|
+
copyDir(SOURCE_DIR, INSTALL_DIR, true);
|
|
61
|
+
console.log(` Plugin files copied to:\n ${INSTALL_DIR}`);
|
|
62
|
+
|
|
63
|
+
const added = patchSettings(INSTALL_DIR);
|
|
64
|
+
if (added) {
|
|
65
|
+
console.log(` Added to Claude Code settings:\n ${SETTINGS_PATH}`);
|
|
66
|
+
} else {
|
|
67
|
+
console.log(` Already in Claude Code settings — no change needed.`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
console.log(`
|
|
71
|
+
Done. Restart Claude Code (or reload the window) for the plugin to take effect.
|
|
72
|
+
|
|
73
|
+
Slash commands added:
|
|
74
|
+
/hhs-hcc-score — score an enrollee
|
|
75
|
+
/hhs-hcc-lookup — look up a coefficient
|
|
76
|
+
/hhs-hcc-transfer — compute a risk transfer
|
|
77
|
+
|
|
78
|
+
Or just ask Claude a question about the HHS-HCC model directly.
|
|
79
|
+
`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
main();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hhs-hcc-lookup
|
|
3
|
+
description: Look up a coefficient from the HHS-HCC model by variable name, benefit year, and metal level. Handles HCCs, group flags, RXCs, interaction terms, age/sex variables, severity/transplant counters, and infant maturity×severity variables.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Collect the following. If the user already provided them in their message, proceed directly.
|
|
7
|
+
|
|
8
|
+
- **Variable name** — the exact model variable (e.g. `HHS_HCC042`, `G01`, `RXC_09`, `EXTREMELY_IMMATURE_X_SEVERITY5`, `SEVERE_HCC_COUNT3`, `MAGE_LAST_45_49`). If the user gives a description instead of a variable name (e.g. "heart failure"), look it up in `data/hcc_labels.csv` using Grep first.
|
|
9
|
+
- **Benefit year** — BY2018–BY2027.
|
|
10
|
+
- **Model** — Adult, Child, or Infant. If not provided, infer from the variable type (infant maturity/severity variables → Infant; G-prefix group flags → Adult or Child as applicable).
|
|
11
|
+
- **Metal level** — Platinum, Gold, Silver, Bronze, Catastrophic. If omitted, return all five.
|
|
12
|
+
|
|
13
|
+
Run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python3 "${CLAUDE_PLUGIN_ROOT}/skills/hhs-hcc-risk-adjustment/scripts/lookup.py" \
|
|
17
|
+
--year YEAR --model MODEL --variable VARIABLE [--metal METAL]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Present the result and add brief context:
|
|
21
|
+
- What condition or model construct the variable represents
|
|
22
|
+
- Whether the variable is in the severity/transplant bucket set
|
|
23
|
+
- Any year-over-year note if the user might be comparing to a prior year value (check `references/year-changes.md` for changes affecting this variable)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hhs-hcc-score
|
|
3
|
+
description: Score an ACA enrollee under the HHS-HCC risk adjustment model. Collects demographics, flagged HCCs/RXCs, and benefit year, then runs score_enrollee.py and explains the result.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Collect the following inputs conversationally. If the user already provided some in their message, skip those questions.
|
|
7
|
+
|
|
8
|
+
**Required:**
|
|
9
|
+
- **Benefit year** — BY2018–BY2027. Always confirm this first; coefficients change annually.
|
|
10
|
+
- **Age** — `AGE_LAST` (age on the last day of the benefit year)
|
|
11
|
+
- **Sex** — M or F
|
|
12
|
+
- **Metal level** — Platinum, Gold, Silver, Bronze, or Catastrophic
|
|
13
|
+
- **CSR indicator** — the `RA_CSR_Indicator` for this enrollment span:
|
|
14
|
+
- `1` = Standard plan, no CSR (most Bronze/Gold/Platinum, and Silver plans not receiving CSR)
|
|
15
|
+
- `3` = Silver state-subsidy (HIOS variants 05/06/07, 30–36)
|
|
16
|
+
- `4` = Zero Cost Share Platinum | `5` = LCS Platinum | `6` = ZCS Silver | `7` = LCS Silver
|
|
17
|
+
- `8` = ZCS Gold | `9` = LCS Gold | `10` = ZCS Bronze | `11` = LCS Bronze | `12` = ZCS Platinum
|
|
18
|
+
- If unsure, ask for the last two digits of the 16-character HIOS plan ID.
|
|
19
|
+
- **Flagged HCCs** — space-separated list of HCC variable names **after hierarchy and group collapsing** (e.g. `HHS_HCC042 HHS_HCC156`). Remind the user: inputs must be post-hierarchy; do not pass both an HCC and an HCC it supersedes.
|
|
20
|
+
|
|
21
|
+
**Optional:**
|
|
22
|
+
- **Flagged RXCs** — Adult model only (e.g. `RXC_09`). Skip for Child/Infant.
|
|
23
|
+
- **Enrollment duration** — months enrolled (1–12). Only relevant if < 7 months and the enrollee has at least one HCC; triggers the `HCC_ED` short-enrollment flag.
|
|
24
|
+
|
|
25
|
+
Once you have the inputs, run:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python3 "${CLAUDE_PLUGIN_ROOT}/skills/hhs-hcc-risk-adjustment/scripts/score_enrollee.py" \
|
|
29
|
+
--age AGE --sex SEX --metal METAL --csr CSR --year YEAR \
|
|
30
|
+
--hcc HCC1 HCC2 ... \
|
|
31
|
+
--rxc RXC1 ... \
|
|
32
|
+
--enrol-duration MONTHS
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Omit `--rxc` if no RXCs. Omit `--enrol-duration` if not provided.
|
|
36
|
+
|
|
37
|
+
After running, present the output table and then:
|
|
38
|
+
1. Identify the top contributing variables and explain what each HCC/RXC/interaction represents clinically.
|
|
39
|
+
2. Note any severity or transplant counter that fired and why.
|
|
40
|
+
3. Show the CSR-adjusted final score and explain the CSR factor applied.
|
|
41
|
+
4. Flag anything surprising (e.g. an expected HCC that didn't appear — check if it was superseded by a hierarchy).
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hhs-hcc-transfer
|
|
3
|
+
description: Compute a CMS risk transfer payment T(i) per billable member-month, or find the PLRS inflection point where a Platinum metal strategy beats Gold. Optionally looks up statewide inputs from the bundled statewide_ra_factors.csv.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Ask the user which mode they want:
|
|
7
|
+
|
|
8
|
+
1. **Transfer** — compute T(i) for a plan given its plan-level and statewide inputs
|
|
9
|
+
2. **Inflection** — find the PLRS at which Platinum becomes favorable over Gold (transfer-only perspective)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Transfer mode
|
|
14
|
+
|
|
15
|
+
Collect:
|
|
16
|
+
|
|
17
|
+
**Plan-level inputs:**
|
|
18
|
+
- `PLRS` — Plan Liability Risk Score
|
|
19
|
+
- `IDF` — Induced Demand Factor
|
|
20
|
+
- `GCF` — Geographic Calibration Factor
|
|
21
|
+
- `AV` — Actuarial Value (e.g. 0.80 for Gold)
|
|
22
|
+
- `ARF` — Allowable Rating Factor
|
|
23
|
+
|
|
24
|
+
**Statewide inputs:**
|
|
25
|
+
- Statewide weighted-average PLRS, IDF, GCF, AV, ARF
|
|
26
|
+
- Statewide average premium P̄
|
|
27
|
+
|
|
28
|
+
**Offer to look up statewide values:** If the user provides a state abbreviation and benefit year, grep `${CLAUDE_PLUGIN_ROOT}/skills/hhs-hcc-risk-adjustment/data/statewide_ra_factors.csv` for matching rows and present the available market options (Market 1 = Individual, Market 2 = Small Group). Let the user select the right market and confirm the values before running.
|
|
29
|
+
|
|
30
|
+
Run:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python3 "${CLAUDE_PLUGIN_ROOT}/skills/hhs-hcc-risk-adjustment/scripts/risk_transfer.py" \
|
|
34
|
+
--plrs PLRS --idf IDF --gcf GCF --av AV --arf ARF \
|
|
35
|
+
--statewide-plrs SW_PLRS --statewide-idf SW_IDF --statewide-gcf SW_GCF \
|
|
36
|
+
--statewide-av SW_AV --statewide-arf SW_ARF \
|
|
37
|
+
--premium PBAR
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
After running, explain:
|
|
41
|
+
- Whether the plan receives or pays a transfer and why (PLRS vs. statewide average, metal AV)
|
|
42
|
+
- The magnitude in annualized terms (multiply per-member-month result × 12 × estimated enrollment)
|
|
43
|
+
- What levers would shift the transfer (PLRS improvement, metal-level mix, GCF)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### Inflection mode
|
|
48
|
+
|
|
49
|
+
Collect:
|
|
50
|
+
- Plan ARF
|
|
51
|
+
- Statewide PLRS, AV, ARF
|
|
52
|
+
|
|
53
|
+
Run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python3 "${CLAUDE_PLUGIN_ROOT}/skills/hhs-hcc-risk-adjustment/scripts/risk_transfer.py" \
|
|
57
|
+
--inflection --arf ARF \
|
|
58
|
+
--statewide-plrs SW_PLRS --statewide-av SW_AV --statewide-arf SW_ARF
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Explain the result: if projected PLRS exceeds the inflection point, Platinum is favorable from a transfer-only perspective. Note this is before considering the premium revenue difference between metals.
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hhs-hcc-risk-adjustment",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Claude Code plugin for HHS-HCC commercial risk adjustment (ACA BY2018–BY2027)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"hhs-hcc-skill": "./bin/install.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
".claude-plugin/",
|
|
10
|
+
"bin/",
|
|
11
|
+
"commands/",
|
|
12
|
+
"skills/",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"claude-code",
|
|
17
|
+
"claude-plugin",
|
|
18
|
+
"risk-adjustment",
|
|
19
|
+
"hhs-hcc",
|
|
20
|
+
"aca",
|
|
21
|
+
"cms",
|
|
22
|
+
"health-insurance"
|
|
23
|
+
],
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=16"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hhs-hcc-risk-adjustment
|
|
3
|
+
description: Domain expertise and computational support for the HHS-HCC commercial risk adjustment model (V07, plan years 2018+). Use when the user asks about how the HHS-HCC model works, what the year-over-year NBPP changes are, how to compute a risk score, what a specific coefficient is, or how to compare model specs across plan years. Covers the Adult, Child, and Infant sub-models, CC/HCC hierarchies, severity and transplant counters, RXC interactions, infant maturity-by-severity interactions, and CSR adjustments.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<essential_principles>
|
|
7
|
+
## How the HHS-HCC Model Works (Always Apply)
|
|
8
|
+
|
|
9
|
+
The HHS-HCC model is the risk adjustment model for the **commercial individual and small-group ACA markets**. It is published annually by CMS in the Notice of Benefit and Payment Parameters (NBPP) and is **not** the same model as the Medicare CMS-HCC. The model family in use depends on the benefit year — V07 covers BY2021 and onward, V05 covered BY2018-BY2020, and earlier V01-V04 versions covered BY2014-BY2017.
|
|
10
|
+
|
|
11
|
+
**Always confirm the benefit year before answering substantive questions.** Coefficients, severity placements, group flags, and CSR factors all vary year over year. Never assume a "default" or "current" year; ask the user.
|
|
12
|
+
|
|
13
|
+
### Principle 1: Three Sub-Models, Not One
|
|
14
|
+
|
|
15
|
+
Every enrollee is scored under exactly one of three age-based sub-models. The boundary is `AGE_LAST` (age on the last day of the benefit year):
|
|
16
|
+
|
|
17
|
+
- **Adult model** — `AGE_LAST >= 21`
|
|
18
|
+
- **Child model** — `AGE_LAST in [2, 20]`
|
|
19
|
+
- **Infant model** — `AGE_LAST in [0, 1]`
|
|
20
|
+
|
|
21
|
+
The Adult and Child models are HCC-additive. The **Infant model is structurally different** — it does not score HCCs directly; instead it uses a maturity × severity *interaction grid* (see references/infant-model.md). Most cross-version bugs come from confusing infant and child rules.
|
|
22
|
+
|
|
23
|
+
### Principle 2: HCC Hierarchies Run Before Group Collapsing
|
|
24
|
+
|
|
25
|
+
Each enrollee's diagnoses map to CCs via `dx_mapping_table` (with effective-date and age/sex edits). CCs become HCCs after applying CC hierarchies (e.g., HCC008 zeros HCC009-013). Adult and Child models then collapse certain HCC pairs/triples into Group flags (G01, G02B, ..., G24). The Infant model does **not** apply group collapsing.
|
|
26
|
+
|
|
27
|
+
### Principle 3: Severity / Transplant Counters Are Bucket-Schema Specific
|
|
28
|
+
|
|
29
|
+
The Adult model has 10 severe buckets (1-9, 10PLUS) and 5 transplant buckets (4-7, 8PLUS). The Child model has 7 severe buckets (1-5, **6_7**, **8PLUS**) and a single transplant bucket (**4PLUS**). The Infant model has neither — severity in infants is part of the maturity interaction.
|
|
30
|
+
|
|
31
|
+
### Principle 4: Year Matters for Both Logic and Data
|
|
32
|
+
|
|
33
|
+
The published coefficients change every year. The **logic** also changes occasionally (e.g., BY2023 introduced the modern severity model; BY2024 added G24; BY2025 ungrouped HCC070/HCC071 from G07A and reassigned them to higher infant severity for sickle cell disease). Always confirm benefit year before answering or scoring.
|
|
34
|
+
|
|
35
|
+
### Principle 5: CMS Python ≠ CMS DIY Tables ≠ CMS SAS
|
|
36
|
+
|
|
37
|
+
CMS publishes the model in three forms — SAS source (canonical, available going back to BY2014), DIY tables (Excel reference workbook, intended for non-SAS implementers), and starting BY2025 a Python package. **The SAS source is the authoritative spec when sources disagree.** A known instance: the BY2025 Python release omits the `AGE0_MALE → AGE1_MALE` reassignment that is present in every SAS release and both the BY2024 and BY2025 DIY tables.
|
|
38
|
+
|
|
39
|
+
### Principle 6: Diagnoses Only Count from Qualifying Claims
|
|
40
|
+
|
|
41
|
+
A diagnosis on a claim contributes to risk score **only if** the claim is of a type CMS deems evidence of a clinician-documented condition. Inpatient (UB-04 bill types 111-114, 117) qualifies automatically. Outpatient UB-04 and Professional (CMS-1500) claims qualify only if they carry a CPT/HCPCS code on the CMS qualifying-services list — face-to-face physician encounters, surgical procedures, qualifying telehealth, etc.
|
|
42
|
+
|
|
43
|
+
**Lab work, DME deliveries, technical-component-only imaging, ambulance transport, and J-code-only claims do not qualify.** A diabetes diagnosis on a lab claim adds nothing to the score, even though the same diagnosis on an office visit would add HCC021. See `references/claim-qualification.md`.
|
|
44
|
+
|
|
45
|
+
This is the most common source of "I have the diagnosis on a claim, why isn't it scoring?" surprises. RXC variables (Adult only) use a different mechanism — pharmacy NDC matching, no qualifying-claim filter on the pharmacy side.
|
|
46
|
+
|
|
47
|
+
### Principle 7: Risk Score Is Just One Input to the Transfer
|
|
48
|
+
|
|
49
|
+
The HHS-HCC model produces a per-enrollee risk score, which aggregates to a Plan Liability Risk Score (PLRS). PLRS is **one component** of the CMS risk transfer formula:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
T(i) = [PLRS_i · IDF_i · GCF_i / Σ(s · PLRS · IDF · GCF)
|
|
53
|
+
− AV_i · ARF_i · IDF_i · GCF_i / Σ(s · AV · ARF · IDF · GCF)] · P̄_s
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The transfer also depends on Induced Demand Factor, Geographic Calibration Factor, Actuarial Value, Allowable Rating Factor, and statewide weighted averages. A high risk score does not guarantee a positive transfer, and metal-level decisions for high-risk populations have non-obvious effects. See `references/risk-transfer-formula.md`.
|
|
57
|
+
</essential_principles>
|
|
58
|
+
|
|
59
|
+
<intake>
|
|
60
|
+
**Ask the user:**
|
|
61
|
+
|
|
62
|
+
What would you like to do with the HHS-HCC model?
|
|
63
|
+
|
|
64
|
+
1. **Explain** — Describe how part of the model works (general principles, a specific sub-model, how a calculation is performed, what changed in a given year)
|
|
65
|
+
2. **Calculate score** — Compute a risk score for an enrollee given demographics + flagged HCCs/RXCs
|
|
66
|
+
3. **Lookup** — Find a specific coefficient or rule (e.g., "what's the BY2025 Silver coefficient for HHS_HCC042?")
|
|
67
|
+
4. **Compare years** — Identify what changed between two plan years
|
|
68
|
+
5. **Risk transfer** — Compute or analyze the CMS risk transfer (PLRS, IDF, GCF, AV, ARF) for a plan, or evaluate metal-level optimization
|
|
69
|
+
|
|
70
|
+
If the user already stated their intent in their request, skip the question and route directly.
|
|
71
|
+
|
|
72
|
+
**Wait for response unless intent is already clear.**
|
|
73
|
+
</intake>
|
|
74
|
+
|
|
75
|
+
<routing>
|
|
76
|
+
| User intent | Workflow |
|
|
77
|
+
|---|---|
|
|
78
|
+
| 1, "explain", "how does", "what is", "tell me about" | `workflows/explain-model.md` |
|
|
79
|
+
| 2, "calculate score", "score an enrollee", "compute risk score" | `workflows/calculate-score.md` |
|
|
80
|
+
| 3, "lookup", "find the coefficient", "what's the value of" | `workflows/lookup-coefficient.md` |
|
|
81
|
+
| 4, "compare", "what changed", "diff", "year over year" | `workflows/compare-years.md` |
|
|
82
|
+
| 5, "transfer", "PLRS", "metal optimization", "IDF", "GCF", "ARF", "AV" | `workflows/risk-transfer.md` |
|
|
83
|
+
|
|
84
|
+
**After reading the workflow, follow it exactly.**
|
|
85
|
+
</routing>
|
|
86
|
+
|
|
87
|
+
<reference_index>
|
|
88
|
+
All domain knowledge in `references/`:
|
|
89
|
+
|
|
90
|
+
**Architecture and rules:**
|
|
91
|
+
- `model-overview.md` — V07 architecture, sub-models, scoring formula, key terminology
|
|
92
|
+
- `adult-model.md` — Adult variables, group flags, severity/transplant buckets, HCC_ED, RXC interactions
|
|
93
|
+
- `child-model.md` — Child variables, group flags, severity/transplant buckets (note 6_7 and 8PLUS collapsing)
|
|
94
|
+
- `infant-model.md` — Maturity hierarchy, severity hierarchy, AGE0/AGE1 swap, maturity × severity grid
|
|
95
|
+
|
|
96
|
+
**Cross-cutting topics:**
|
|
97
|
+
- `claim-qualification.md` — Which medical claims qualify for HCC scoring (inpatient bill types vs outpatient/professional with qualifying CPT/HCPCS), why labs/DME/J-code-only claims don't count, supplemental diagnoses
|
|
98
|
+
- `cc-hcc-hierarchies.md` — DX→CC mapping, CC→HCC hierarchies, group collapsing, age/sex/MCE edits
|
|
99
|
+
- `rxc-interactions.md` — RXC variables, RXC_06→RXC_07 hierarchy, HCC×RXC interactions including the RXC_09 triple
|
|
100
|
+
- `csr-adjustments.md` — CSR adjustment factors by HIOS variant ID, BY2025 schedule change
|
|
101
|
+
- `risk-transfer-formula.md` — The full CMS risk transfer formula (PLRS, IDF, GCF, AV, ARF, statewide averages) and metal-level optimization
|
|
102
|
+
- `year-changes.md` — Year-over-year NBPP changes (BY2018-BY2027 as available)
|
|
103
|
+
- `coefficient-data.md` — Where canonical coefficients live, how to load them
|
|
104
|
+
|
|
105
|
+
**Local code-mapping CSVs (use Grep to look up specific codes):**
|
|
106
|
+
- `dx-mapping.csv` — Full ICD-10 → CC crosswalk (11,568 rows). Columns: `DGNS_CD,CC_CD,ACC_CD,DGNS_CD_EFF_STRT_DT,DGNS_CD_EFF_END_DT,MIN_AGE_DGNS_INCLUDE,MAX_AGE_DGNS_EXCLUDE,CC_AGE_SPLIT_MIN_AGE_INC,CC_AGE_SPLIT_MAX_AGE_EXC,CC_SEX_SPLIT`. Use to answer "what CC does diagnosis X map to?" or "which diagnoses map to HCC Y?" (grep for the CC number in CC_CD column). Includes date-gating and age/sex edit columns.
|
|
107
|
+
- `hcpcs-rxc.csv` — HCPCS J-code → RXC mapping (86 rows). Columns: `HCPCS_CODE,RXC`. Use to answer "does this J-code trigger an RXC?" or "which J-codes map to RXC_04?"
|
|
108
|
+
- `ndc-rxc.csv` — NDC → RXC pharmacy mapping (15,134 rows). Columns: `NDC_CODE,RXC,start_year,end_year`. Use to answer "does this NDC trigger an RXC?" or "which NDCs map to RXC_05 in BY2025?" (filter by start_year/end_year).
|
|
109
|
+
- `service-code-reference.csv` — CPT/HCPCS qualifying-service-code list (21,109 rows). Columns: `SRVC_CD,SRVC_TYPE_CD,SRVC_CD_EFCTV_STRT_DT,SRVC_CD_EFCTV_END_DT,CPT_HCPCSELGBL_RISKADJSTMT_IND`. Use to answer "does CPT code X qualify a claim for risk adjustment?" — look for `CPT_HCPCSELGBL_RISKADJSTMT_IND=Y` with the service date in the effective range. SRVC_TYPE_CD distinguishes CPT (01) from HCPCS (02).
|
|
110
|
+
|
|
111
|
+
**Bundled reference data in `data/` (loaded automatically by scripts or grepped directly):**
|
|
112
|
+
- `data/hcc_labels.csv` — Human-readable label and clinical category for every HCC, group flag, RXC, and interaction variable (210 rows). Columns: `column_name,hcc_number,label,clinical_category`. Use to answer "what does HCC042 mean?" or "which HCCs are in the Oncology category?" — grep by column_name or clinical_category.
|
|
113
|
+
- `data/csr_adjustment_factors.csv` — CSR adjustment factors by CSR_Code and model year (BY2020–BY2027, 96 rows). Columns: `CSR_Code,CSR_Desc,model_year,adj_factor`. Loaded automatically by `score_enrollee.py`; also useful for "what is the CSR factor for Silver 94% in BY2025?"
|
|
114
|
+
- `data/statewide_ra_factors.csv` — Statewide weighted-average PLRS, IDF, AV, ARF, average premium, and member months by state, market, and year (BY2018–BY2024, ~1,009 rows). Columns: `State,RA_Adj_Avg_Pre,Avg_pre,PLRS,ARF,AV,IDF,MM,Market,Year`. Use to look up the statewide inputs needed for the risk transfer formula — grep by State and Year, then filter by Market (1=Individual, 2=Small Group).
|
|
115
|
+
- `data/BY<YYYY>/` — Coefficient CSVs (adult/child/infant model factors) for BY2018–BY2027. Loaded automatically by scripts via `--year`.
|
|
116
|
+
</reference_index>
|
|
117
|
+
|
|
118
|
+
<workflows_index>
|
|
119
|
+
| Workflow | Purpose |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `explain-model.md` | Walk the user through a topic in the model, citing references |
|
|
122
|
+
| `calculate-score.md` | Compute a risk score for an enrollee using `scripts/score_enrollee.py` |
|
|
123
|
+
| `lookup-coefficient.md` | Find a coefficient by variable name + metal + year using `scripts/lookup.py` |
|
|
124
|
+
| `compare-years.md` | Diff model spec across plan years using `references/year-changes.md` |
|
|
125
|
+
| `risk-transfer.md` | Compute a CMS risk transfer or analyze metal-level optimization using `scripts/risk_transfer.py` |
|
|
126
|
+
</workflows_index>
|
|
127
|
+
|
|
128
|
+
<scripts_index>
|
|
129
|
+
Reusable code in `scripts/`:
|
|
130
|
+
|
|
131
|
+
- `score_enrollee.py` — End-to-end risk score for one enrollee given demographics + flagged HCCs/RXCs. Reads CMS factor CSVs.
|
|
132
|
+
- `load_coefficients.py` — Load CMS adult/child/infant factor CSVs into a dict for lookup or arithmetic.
|
|
133
|
+
- `lookup.py` — Quick coefficient lookup by `(model, variable, metal, year)`.
|
|
134
|
+
- `risk_transfer.py` — Compute the CMS risk transfer T(i) given PLRS, IDF, GCF, AV, ARF, statewide averages, and average premium. Includes a metal-level inflection-point helper.
|
|
135
|
+
|
|
136
|
+
Coefficient CSVs for BY2018–BY2027 are bundled in `data/BY<YYYY>/`. Scripts use them automatically via `--year`; pass `--data-dir` to override with a custom path. Always confirm benefit year with the user before scoring — never assume.
|
|
137
|
+
</scripts_index>
|
|
138
|
+
|
|
139
|
+
<key_data_locations>
|
|
140
|
+
CMS publishes all model artifacts annually on the CMS website under the Risk Adjustment section. Key file types to obtain for a given benefit year:
|
|
141
|
+
- **Coefficient CSVs** — `adult_model_factors.csv`, `child_model_factors.csv`, `infant_model_factors.csv` (from the CMS HHS-HCC software package, inside `data/input/internal/`)
|
|
142
|
+
- **SAS source** — canonical logic; available going back to BY2014
|
|
143
|
+
- **DIY tables** — Excel reference workbook for non-SAS implementers; published for BY2024 and BY2025
|
|
144
|
+
- **DX mapping, HCPCS/NDC crosswalks** — also in the CMS software package; mirrored locally in `references/` CSVs for this skill
|
|
145
|
+
</key_data_locations>
|