Overview
Provides deterministic, copy-ready Python and SQL for the common building blocks of Healthcare Effectiveness Data and Information Set (HEDIS) quality reporting: continuous enrollment checks, measure rate calculation, care gap detection, utilization rates, high-cost claimant identification, and risk stratification scoring. Use it when a user needs working code for one of these tasks against claims or claims-plus-clinical data. Each calculation lives in a reference file so the skill delivers one focused, working example per request rather than a wall of alternatives.
Workflow
<Workflow - Provide Measure Calculation Code description="Gather inputs, select the matching reference, and deliver one working code example for the requested HEDIS calculation." tools=[file_read, get_current_time] triggers=["User asks to calculate a HEDIS measure", "check continuous enrollment", "detect care gaps", "compute utilization rates", "identify high-cost claimants", "score a risk index"]
-
[Ask user] Confirm the inputs needed to pick the right example:
- Which task (enrollment check, measure rate, care gaps, utilization, high-cost claimants, risk score, or stratification).
- Language preference (Python or SQL), if the task offers both.
- Data source (claims only, or claims plus clinical/EHR).
- Measurement year, and single-payer vs multi-payer enrollment. Validate: The task maps to a row in and the language is available for it. If fails: Present the task list from and ask the user to choose one.
-
[Agent] If the user referenced a relative year (for example "this year"), call get_current_time and resolve it to a concrete measurement year. Validate: A four-digit measurement year is fixed before writing date logic. If fails: Ask the user for the measurement year explicitly.
-
[Decide] Consult the task table in and the scenario guidance in
references/approach-selection.mdto choose the language and the reference file. Validate: Exactly one reference file is selected. If fails: Re-read ; if two tasks seem to fit, ask the user which output they want. -
[Agent] Read the selected reference file via file_read, plus
references/common-pitfalls.mdandreferences/parameters.md. Validate: The reference file loaded and contains code in the requested language. If fails: If the language is missing for that task, tell the user which language the reference provides and offer it. -
[Think] Match the example's parameters (measurement year,
max_gap_days, anchor date, lookback, threshold) to the user's inputs and identify which pitfalls fromreferences/common-pitfalls.mdapply to this task. Validate: The parameter values in the code will reflect the user's stated inputs. -
[Agent] Present the response per Rules 1 to 3: confirm inputs, then the working code, then key parameters explained, then the applicable pitfalls. Append the Rule 7 liability disclaimer. Validate: One complete example, correct language, sandbox-only libraries, disclaimer present. If fails: Revise before sending.
</Workflow - Provide Measure Calculation Code>
| Task | Language(s) | Reference file |
|---|---|---|
| Continuous enrollment check | Python, SQL | references/continuous-enrollment.md |
| HEDIS measure rate calculation | Python, SQL | references/hedis-measure.md |
| Care gap detection and prioritization | Python | references/care-gap-detection.md |
| Utilization rates (ED, inpatient, readmission) | SQL | references/utilization-rates.md |
| High-cost claimant identification | Python | references/high-cost-claimants.md |
| Risk stratification (Charlson, LACE) | Python | references/risk-stratification.md |
| Measure rate stratified by plan/provider | SQL | references/measure-stratification.md |
Supporting references:
references/approach-selection.md: scenario-to-approach guidance (single vs batch, data source, enrollment topology).references/parameters.md: default parameter values and their meanings.references/common-pitfalls.md: the calculation mistakes that most often produce wrong rates.


