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.

Spec: specs/cl/specs/CL-35-population-health-care-gap-management.md Status: Phase 2/3 ✅ Complete (2026-04-01) — Phase 2 schema parity gap closed 2026-05-11: closure_type + risk_score_at_identification deployed on cl_care_gaps; 4 pop_health_* settings columns deployed on cl_module_settings; UI wired (CloseGapDialog Select, GapDetailSheet display incl. system auto-close branch); RLS test stubs and deriveCareGapCloseStatus unit tests added. Last Updated: 2026-05-11

Integration Overview

CL-35 is a consumer of existing CL data sources (CL-02, CL-03, CL-07, CL-10, CL-15, CL-22, CL-26, CL-29) and a producer of new population health data (risk scores, care gaps, quality measure periods). It integrates cross-core with FA (Finance) via event contract for VBP payment adjustment and with FW (Workflow) via care gap closure events.

Platform Foundation Dependencies

PF DependencyIntegration TypeUsage
PF-01 (Organizations & Sites)Direct dependencyorganization_id tenant isolation on all CL-35 tables
PF-02 (RBAC)Direct dependencyRole-based access to work list, dashboards, measure views
PF-30 (Permissions)Direct dependency6 permission keys (cl.care-gaps.view/close, cl.risk-stratifications.view, cl.quality-measures.view/export, cl.population-dashboard.view) — see CL-35 spec § Security Considerations.

CL-Internal Data Sources (Read-Only)

Source SpecData ReadTables/EntitiesUsage in CL-35
CL-02 (Assessments)Assessment dates and typescl_assessmentsGap rule: assessment_expired
CL-03 (Treatment Planning)Plan last review datecl_treatment_plansGap rule: plan_not_reviewed
CL-07 (Risk Screening)Safety screening scores, PHQ-9/GAD-7 datescl_risk_screeningsRisk stratification (40% weight); gap rules: overdue_phq9, overdue_gad7
CL-10 (Outcomes)Outcome trajectory datacl_outcome_measures, cl_program_outcomesRisk stratification (30% weight); HEDIS numerator data
CL-15 (Quality Measures)Quality measure reporting— (consumer of cl_quality_measure_periods)CL-35 computes HEDIS period results; CL-15 consumes for reporting dashboards
CL-21 (MOUD/OTP)MOUD adherence datacl_moud_enrollments, cl_moud_medication_events, cl_moud_monitoring_eventsRisk stratification (10% weight, optional; gated on 42 CFR Part 2 consent)
CL-22 (Vital Signs)Metabolic datacl_vital_signsRisk stratification (20% weight)
CL-26 (PROs)PRO submission dates— (CL-26 PRO tables not yet deployed; integration deferred)Gap rule: overdue PRO completion (planned)
CL-29 (Discharge & Aftercare)Follow-up scheduling, discharge eventspm_encounters (via @/platform/scheduling)Gap rule: follow_up_not_scheduled; HEDIS FUH/FUM

Event Contracts

Events Published

1. cl_quality_measure_period_calculated
  • Publisher: CL-35 (Phase 3)
  • Subscribers: FA (Finance — VBP payment adjustment)
  • Payload Schema:
    {
      organization_id: string;        // UUID
      measure_id: string;             // e.g. 'AMM', 'FUH'
      measure_type: 'HEDIS' | 'MA_STARS';
      period_start: string;           // ISO date
      period_end: string;             // ISO date
      denominator_count: number;
      numerator_count: number;
      rate: number;                   // 0.0000–1.0000
      calculated_at: string;          // ISO timestamp
    }
    
  • Integration doc: CL-FA-VBP-QUALITY-DATA-PIPELINE.md
2. cl_care_gap_closed (Phase 2)

Events Consumed

None — CL-35 reads data via direct queries to CL-internal tables, not events.

API Contracts

No external APIs exposed. Internal edge functions:
  • cl-risk-stratification-cron: Batch risk score calculation (Phase 2)
  • cl-care-gap-rules: Batch gap rule evaluation (Phase 1)
  • cl-hedis-measure-calculation: HEDIS period calculation (Phase 3)
  • Population dashboard aggregate queries (Phase 3)

Platform Integration Layer Usage

LayerImport PathUsage
Scheduling@/platform/schedulingRead encounter context for pm_encounters (discharge events, contact tracking)
Permissions@/platform/permissionsuseHasPermission('cl.care-gaps.view') etc.
Table v2@/platform/table-v2Work list UI (TanStack Table v8)

Security Considerations

  • All data access RLS-gated via cl_has_org_access(organization_id, auth.uid())
  • Population dashboard aggregates enforce small-cell suppression (n < 5 → "<5")
  • No PHI in event payloads (quality measure periods are aggregate counts)
  • Edge function logs must not contain patient identifiers

References