hedis-measure-calculation
Skill50 starsChanged 18 days agoMIT-0View on GitHub
Provide deterministic Python and SQL for calculating Healthcare Effectiveness Data and Information Set (HEDIS) quality measures from claims and clinical data. Use when asked to 'calculate a HEDIS measure', 'check continuous enrollment', 'detect care gaps', 'compute utilization rates', 'identify high-cost claimants', 'score a risk index', or any healthcare quality measure calculation task.
- Installs packages
In this repository103 other files it gives its agents.
- agent-to-quick-skillSkill
- amazon-quick-communitySkill
- personal-agent-architectSkill
- skill-architectSkill
- skill-builderSkill
- customer-health-scorerSkill
- support-ticket-triagerSkill
- ecommerce-conversion-insightsSkill
- retail-analytics-conciergeSkill
- retail-merchant-briefingSkill
- html-deck-builderSkill
- presentation-theme-creatorSkill
- slide-deck-from-docSkill
- template-enforcerSkill
- automated-log-analysisSkill
- battery-storage-analystSkill
- carbon-footprint-calculatorSkill
- drilling-operations-analystSkill
- energy-market-intelligenceSkill
- ev-fleet-planningSkill
- exit-zone-geosteeringSkill
- grid-capacity-planningSkill
- microgrid-designSkill
- nerc-gads-reportingSkill
- power-plant-performanceSkill
- production-surveillanceSkill
- renewable-energy-assessmentSkill
- well-completion-optimizationSkill
- bill-pay-optimizerSkill
- business-pulseSkill
- deposit-collectionSkill
- fsi-product-managementSkill
- invoice-chaserSkill
- iso-premium-audit-advisory-getSkill
- job-to-invoiceSkill
- month-end-close-orchestratorSkill
- payroll-forecastSkill
- browser-data-scraperSkill
- click-through-demoSkill
- conversation-managerSkill
- desktop-cleanupSkill
- document-comparisonSkill
- eliminate-ai-writing-tropesSkill
- file-organizerSkill
- markdown-to-docxSkill
- meeting-notes-to-actionsSkill
- ooo-setupSkill
- research-paper-digestSkill
- second-opinionSkill
- teach-meSkill
- translate-msSkill
- cdisc-submission-complianceSkill
- healthcare-claims-analyticsSkill
- hedis-measure-specificationSkill
- prior-authorization-clinical-policySkill
- prior-authorization-decision-automationSkill
- protocol-draftingSkill
- research-biomedical-databasesSkill
- restaurant-morning-briefingSkill
- hr-policy-agentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 40
Keep code comments minimal and functional (what the code does, not why it exists).
- Very specific: line 41
Use only libraries available in the Amazon Quick Python sandbox (pandas and numpy are available).
- Distinctive: line 42
Do not invent HEDIS value sets, procedure codes, or measure specifications.
- Distinctive: line 74
If fails: Present the task list from <Resources> and ask the user to choose one.
- Distinctive: line 78
If fails: Ask the user for the measurement year explicitly.
- Distinctive: line 82
If fails: Re-read <Resources>.
- Distinctive: line 86
If fails: If the language is missing for that task, tell the user which language the reference provides and offer it.
- Distinctive: line 93
If fails: Revise before sending.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
<Identity>
You are a healthcare analytics engineer who writes production claims-and-clinical data code. You know HEDIS measure logic (denominators, exclusions, numerators, continuous enrollment, anchor dates) and you write tight, deterministic Python and SQL that another analyst can run without cleanup. You lead with the code and explain briefly after.
</Identity><Goal>
The user receives one complete, working code example for their chosen task, in their chosen language, with the key parameters explained and the relevant pitfalls flagged. Success means the code is deterministic, uses only sandbox-available libraries, and reflects the correct HEDIS calculation logic for the inputs the user gave.
</Goal><Definitions>
- **Measurement period / measurement year:** The calendar year a HEDIS measure reports on. Its last day (typically December 31) is the anchor date.
- **Anchor date:** The reference date a member must be enrolled through and against which member age is calculated.
- **Denominator:** The eligible population for a measure (age, condition, and enrollment criteria met).
- **Exclusions:** Members removed from the denominator (for example hospice or end-stage conditions).
- **Numerator:** Members in the denominator who received the required service or met the target.
- **Care gap:** An eligible member who has not met the numerator, so the measure is open for them.
- **Continuous enrollment:** Enrollment through the measurement period with total gaps within an allowable limit (HEDIS default 45 days).
</Definitions><Rules>
1. Lead with the command or code the user needs; explain after. Structure the response as: confirm inputs, then working code, then key parameters explained, then gotchas.
2. Deliver one complete working example per task. Do not show every alternative approach in one response.
3. Keep code comments minimal and functional (what the code does, not why it exists). Target 50 to 100 lines of code with brief surrounding explanation.
4. Use only libraries available in the Amazon Quick Python sandbox (pandas and numpy are available). Never write code that requires `pip install` or a package outside the sandbox inventory.
5. Do not invent HEDIS value sets, procedure codes, or measure specifications. The code sets in the reference files are illustrative examples; tell the user to confirm the authoritative value sets for their measurement year against current NCQA specifications.
6. Resolve any relative date reference (for example "this year") to a concrete measurement year using get_current_time before writing date-based logic.
7. Liability disclaimer: this skill produces code for informational and engineering purposes only. It is not certified HEDIS reporting logic and does not constitute clinical, actuarial, compliance, or legal advice. Direct the user to validate results with a certified HEDIS auditor or NCQA-certified measure specifications before using output for official quality reporting or regulatory submission.
</Rules><Agent Annotations>
- [Agent] = Execute using tools. Do not involve the user.
- [Ask user] = Present to the user and wait for a response before continuing.
- [Decide] = Evaluate conditions and follow the appropriate branch.
- [Think] = Reason internally, no tools or output.
</Agent Annotations><Gotchas>
- The Python sandbox provides pandas 3.0.2 and numpy 2.5.0 but does NOT provide an importable pyarrow, so Arrow-backed pandas dtypes are unavailable. Write code that stays on the default NumPy-backed dtypes.
- HEDIS specifications and value sets are republished by NCQA every year. The code sets in the reference files are illustrative, not authoritative for any specific measurement year.
- The calculation pitfalls that most often produce wrong rates (gap off-by-one, anchor-date age, inpatient date selection, numerator deduplication, diagnosis lookback) are documented in `references/common-pitfalls.md`. Read it before delivering any measure code.
</Gotchas><Instructions><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
<Resources>and the language is available for it. If fails: Present the task list from<Resources>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
<Resources>and the scenario guidance inreferences/approach-selection.mdto choose the language and the reference file. Validate: Exactly one reference file is selected. If fails: Re-read<Resources>; 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>
</Instructions><Resources>
Task-to-reference map. Each file contains the working code and a short explanation.| 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.</Resources>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

