Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Feature ID: CL-02-EN-60
Core: CL
Status: ✅ Complete
Last Updated: 2026-04-03

Summary

CL-02-EN-60 replaces Arizona-specific intake assessment requirement checks with jurisdiction-profile-driven logic while preserving Arizona baseline behavior. This includes renaming TypeScript constants (AHCCCS_SECTION_CODESINTAKE_SECTION_CODES), creating a generic SQL function (cl_check_intake_elements), and wiring UI components to read required elements from PF-96 jurisdiction profiles.

Integration Pattern

  • Pattern: Platform dependency through PF-96 jurisdiction profiles.
  • CL consumes useClinicalRules() from @/platform/jurisdiction (convenience hook over useJurisdictionProfile).
  • No direct core-to-core imports.
  • No new external API contracts.
  • No new events published or consumed.

Upstream Dependencies

DependencyTypeUsage
PF-96Platform configuration/profile resolutionSource of clinical.assessment_required_elements via pf_resolve_jurisdiction_profile RPC
PF-96 migration plan (A2)Migration guidanceGeneric function pattern (cl_check_intake_elements)
PF-96 migration plan (B1)Migration guidanceTypeScript constant rename (AHCCCS_SECTION_CODESINTAKE_SECTION_CODES)

Downstream Consumers

ConsumerImpact
CL-02 AssessmentForm.tsxUses useClinicalRules().assessment_required_elements for section rendering; falls back to INTAKE_SECTION_CODES
CL-40 intake workflowReads intake_element_complete column (trigger-maintained) for completeness status
CL-25 audit dashboardConsumes intake_element_complete for compliance reporting (no code change needed)
Tests (unit/integration)Updated to use INTAKE_SECTION_CODES naming

Data Changes

ChangeTable/FunctionDetails
New functioncl_check_intake_elements(UUID, JSONB)Generic completeness checker; SECURITY DEFINER
Updated functioncl_check_ahcccs_18_elements(UUID)Now wraps cl_check_intake_elements with AZ defaults; deprecated
New columncl_intake_assessments.intake_element_completeTrigger-maintained BOOLEAN
Deprecated columncl_intake_assessments.ahcccs_18_element_completeRetained during dual-read; to be dropped later
New triggertrg_cl_intake_element_completeFires on INSERT/UPDATE; evaluates completeness

Security Notes

  • Organization-scoped profile resolution required for all lookups.
  • cl_check_intake_elements uses SECURITY DEFINER with SET search_path = public.
  • Existing RLS and tenant isolation patterns remain in force on cl_intake_assessments.
  • No PHI is transmitted to AI systems for profile resolution.
  • Profile data is non-PHI (jurisdiction configuration metadata only).

Events and APIs

  • Events published: None.
  • Events consumed: None.
  • API contracts changed: Yes — cl_check_intake_elements and cl_check_ahcccs_18_elements RPCs added/updated.
  • RPC functions added:
    • cl_check_intake_elements(UUID, JSONB) — Generic intake element completeness checker (see API_CONTRACTS.md)
    • cl_check_ahcccs_18_elements(UUID) — Legacy wrapper (DEPRECATED); updated to call generic function
See also:

Validation Checklist

  • Arizona 18-element parity verified (legacy wrapper output matches generic function with AZ fixture).
  • At least one non-Arizona profile test fixture verified.
  • Existing CL-02 and CL-40 regression suites pass.
  • rg 'AHCCCS_SECTION_CODES' src/ returns zero results (excluding deprecated alias).
  • npm run validate passes clean.
  • Profile lookup adds <50ms to form load p95.