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.

Version: 1.0.0 Last Updated: 2026-04-08 Constitution Reference: Section 1.2 (Core Independence), Section 1.3 (Integration Patterns) Source: CL-14-EN-01 Spec Review

Overview

CL-14-EN-01 automates the generation of individual encounter records and charge entries from group session attendance. It extends the existing cl_group_session_documented event contract (CL-PM-GROUP-SESSIONS.md) with a batch review workflow and publishes cl_group_encounters_approved for downstream charge creation.

Ownership Boundaries

ConcernOwnerTable/Event
Group session documentation & attendanceCL-14cl_group_sessions, cl_group_attendance
Encounter generation trackingCL-14-EN-01cl_group_encounter_generations
CPT code proposal (advisory)CL-14-EN-01cl_group_encounter_generations.proposed_cpt_code
Authoritative CPT determinationPM-07pm_charges (at charge capture time)
Encounter recordsPM (pm_encounters)pm_encounters
Charge creation from approved generationsPM-07Triggered by cl_group_encounters_approved event
Key Principle: CL-14-EN-01 proposes CPT codes; PM-07 retains final authority for CPT/modifier/unit determination at charge capture. The proposed_cpt_code is advisory and may be overridden by PM-07 fee schedule rules.

Event Contracts

Consumed Events

cl_group_session_documented (existing — defined in CL-PM-GROUP-SESSIONS.md)
  • Publisher: CL-14
  • Existing Subscriber: PM-07
  • New Subscriber: CL-14-EN-01 (encounter generation handler)
  • Purpose: Triggers creation of cl_group_encounter_generations records per present/partial attendee
  • Idempotency: Insert-once by (organization_id, group_session_id, patient_id) using ON CONFLICT (organization_id, group_session_id, patient_id) DO NOTHING; replayed events are skipped and existing rows are not mutated.

Published Events

cl_group_encounters_approved (new — 📝 Planned)
  • Publisher: CL-14-EN-01
  • Subscriber: PM-07
  • Channel: cl_events
  • Payload Schema:
    {
      session_id: string; // UUID
      approved_generations: Array<{
        generation_id: string; // UUID
        encounter_id: string; // UUID
        patient_id: string; // UUID
        proposed_cpt_code: string;
        duration_minutes: number;
        modifiers: string[];
      }>;
      organization_id: string; // UUID
    }
    
  • Purpose: Triggers charge creation in PM-07 for approved encounter generations
  • Trigger: Batch approval action in review UI (single or bulk)

Platform Integration Layer Usage

LayerImport PathUsage
PF-70 (Code Library)@/platform/code-libraryCPT code lookup and validation
PF-96 (Jurisdiction)@/platform/jurisdictionuseJurisdictionProfile() for state-variable timed code thresholds and group CPT mappings
Platform Clinical@/platform/clinicalGroup session context, patient context
Platform Scheduling@/platform/schedulingEncounter context for PM encounter creation

Data Flow

CL-14 group note submitted
  → cl_group_session_documented event (existing)
    → CL-14-EN-01 handler:
       1. For each present/partial attendee:
          a. Create pm_encounters record (encounter_type: 'group')
          b. Propose CPT code (PF-96 jurisdiction + group type)
          c. Insert cl_group_encounter_generations row (status: pending_review)
       2. Absent attendees: tracked but no encounter generated
    → Batch review UI (CL-14-EN-01)
       1. Supervisor/billing coordinator reviews generated encounters
       2. Approve → status: approved → publish cl_group_encounters_approved
       3. Reject → status: rejected (with reason); no charge created
    → PM-07 consumes cl_group_encounters_approved
       1. Creates charges per approved generation
       2. Final CPT/modifier/units determined by PM-07 fee schedule

Cross-Core References

SpecRelationship
CL-14Parent spec — group therapy documentation and attendance
PM-07Downstream — charge capture from approved generations
PM-08Indirectly downstream — charges flow to claims
CL-39Integration pattern provider — platform hooks
CL-PM-GROUP-SESSIONS.mdExisting integration contract — extended by this spec
CL-PM-ENCOUNTER-TO-BILLING.mdEncounter-to-billing pipeline — followed for pm_encounters schema
PF-96Jurisdiction profiles — state-variable CPT mappings and timed code thresholds

Security & Compliance

  • RLS: cl_group_encounter_generations has RLS with pf_has_org_access SECURITY DEFINER helper
  • 42 CFR Part 2: SUD group encounters inherit Part 2 protections; consent verification before display in batch review
  • PHI Minimization: Generation tracking stores patient_id reference only; no clinical content
  • Permission Keys: cl.group-encounter-generation.view, .approve, .edit