Skip to main content

sdac-validate-cost-pools

Purpose

Validates cost pool assignments, provider eligibility, and district enrollment requirements.

Tool ID

sdac-validate-cost-pools

Tool type

Deterministic (rule-based)

Inputs

  • report_id (string)
  • record_ids (number[], optional)

Outputs

  • success, passed
  • error_count, warning_count
  • errors, warnings, executed_rules

Example output

{
"success": true,
"passed": false,
"error_count": 1,
"warning_count": 1,
"errors": [
{
"rule_id": "COST_POOL_1_INELIGIBLE_TITLE",
"row_number": 56,
"job_title": "Administrative Assistant",
"message": "Job title is not normally eligible for Cost Pool 1.",
"severity": "ERROR"
}
],
"warnings": [
{
"rule_id": "COST_POOL_1_REQUIRES_VERIFICATION",
"row_number": 22,
"job_title": "School Psychologist",
"message": "Credential verification is required for Cost Pool 1.",
"severity": "WARNING"
}
],
"executed_rules": [
"COST_POOL_1_INELIGIBLE_TITLE",
"COST_POOL_1_REQUIRES_VERIFICATION"
]
}

Functional details

  • Verifies cost pool values and their allowed job-function pairings.
  • Flags CP2 therapist placements when flagged for special review.
  • Optionally checks IEP service documentation and district enrollment status.

Implementation details

  • Loads district enrollment via loadDistrictForReport(report_id).
  • Uses keyword matching for provider type (SLP/OT/PT/audiology/psych/behavioral/PCA/PDN).
  • Emits specific rule IDs like COST_POOL_PCA_NOT_ENROLLED, COST_POOL_PDN_NOT_ENROLLED, COST_POOL_MHD_NOT_ENROLLED.
  • Missing provider type for Cost Pool 1 yields COST_POOL_PROVIDER_UNKNOWN (warning).
  • Normalizes job titles to lowercase and checks substrings against PROVIDER_KEYWORDS.
  • Treats non–Cost Pool 1 rows as pass-through (no provider eligibility checks).

Code Location: packages/domain-sdac/src/tools/validate-cost-pools.tool.ts