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.1.0 Last Updated: 2026-02-22 Status: ✅ Reviewed (pre-implementation) Constitution Reference: Section 1.2 (Core Independence), Section 1.3 (Integration Patterns) Source: CL-PM-SPEC-REVIEW Finding 5.3, Pre-Implementation Review 2026-02-22

Overview

Telehealth workflows span CL and PM with overlapping data. This contract defines which core owns which data and how they integrate without direct cross-core dependencies.

Ownership Boundaries

DataOwnerSpecRationale
Session platform/URLPM-13pm_telehealth_sessionsOperational/scheduling concern
Session status & modalityPM-13pm_telehealth_sessions.session_status, telehealth_modalitySession lifecycle concern
Appointment telehealth flagPM-03pm_appointments.is_telehealthScheduling concern
Clinical documentation fieldsCL-04cl_progress_notes.is_telehealth, telehealth_modality, patient_location, provider_locationClinical documentation concern
Modifier determinationPM-07Charge capture logicBilling concern
Place of Service codePM-07Charge capture logicBilling concern

Integration Flow

PM-03: Appointment created with is_telehealth = true

PM-13: Telehealth session created, platform link generated
  (pm_telehealth_sessions.appointment_id → pm_appointments.id)
  (session_status = 'scheduled', telehealth_modality set)

PM-13: Session starts → session_status = 'active'
  → publishes telehealth_session_started event

PM-03: Encounter created when appointment starts
  (pm_encounters.id created)

PM-13: Session ends → session_status = 'completed'
  → publishes telehealth_session_completed event
  (payload includes telehealth_modality, patient_location, provider_location)

CL-04: Clinician documents visit, captures telehealth clinical fields
  (cl_progress_notes with is_telehealth, modality, locations)

CL-04: Note finalized → clinical_note_finalized event
  (includes is_telehealth, telehealth_modality in payload)

PM-07: Charge capture applies telehealth modifiers
  (95 for synchronous audio/video, FQ for audio-only, GQ for store-forward)
  (POS = 10 for patient at home, 02 for telehealth)

Telehealth Fields by Core

PM-13: pm_telehealth_sessions (Operations)

appointment_id   → pm_appointments(id)
encounter_id     → pm_encounters(id)     -- link to encounter
platform         TEXT                     -- 'zoom' | 'doxy' | 'teams' etc.
session_url      TEXT
session_status   TEXT                     -- 'scheduled' | 'active' | 'completed' | 'no_show'
telehealth_modality TEXT                  -- 'audio_video' | 'audio_only' | 'store_forward' | 'remote_monitoring'
is_audio_only    BOOLEAN                  -- DEPRECATED: use telehealth_modality. Sunset target: 2026-Q4.
patient_location TEXT                     -- State/location of patient
provider_location TEXT                    -- State/location of provider
patient_joined_at  TIMESTAMPTZ
provider_joined_at TIMESTAMPTZ
session_ended_at   TIMESTAMPTZ
duration_minutes   INTEGER

CL-04: cl_progress_notes (Clinical Documentation)

is_telehealth       BOOLEAN DEFAULT false
telehealth_modality TEXT     -- 'audio_video' | 'audio_only' | 'store_forward' | 'remote_monitoring'
patient_location    TEXT     -- State/location of patient during session
provider_location   TEXT     -- State/location of provider during session
place_of_service    TEXT     -- Overrides default POS for telehealth

PM-07: Charge Capture Logic (Billing)

Modifier auto-application rules based on clinical_note_finalized event payload:
Telehealth ModalityModifierPOS Code
audio_video9510 (home) or 02 (other)
audio_onlyFQ (or 93 per payer)10 or 02
store_forwardGQ02

Events

PM-13 Events (New)

telehealth_session_started

Published when pm_telehealth_sessions.session_status transitions to 'active'.
payload: {
  session_id: string;
  appointment_id: string;
  encounter_id?: string;
  organization_id: string;
  telehealth_modality: 'audio_video' | 'audio_only' | 'store_forward' | 'remote_monitoring';
  platform: string;
}

telehealth_session_completed

Published when pm_telehealth_sessions.session_status transitions to 'completed'.
payload: {
  session_id: string;
  appointment_id: string;
  encounter_id?: string;
  organization_id: string;
  telehealth_modality: 'audio_video' | 'audio_only' | 'store_forward' | 'remote_monitoring';
  /** @deprecated Use `telehealth_modality` instead. Sunset target: 2026-Q4. */
  is_audio_only: boolean; // backward compat for PM-07 modifier-logic.ts until migration completes
  patient_location?: string;
  provider_location?: string;
  duration_minutes?: number;
}

Existing Event: clinical_note_finalized (CL-04 → PM-07)

The clinical_note_finalized event (defined in CL-PM-ENCOUNTER-TO-BILLING.md) includes telehealth fields:
payload: {
  // ... other fields
  is_telehealth: boolean;
  telehealth_modality?: 'audio_video' | 'audio_only' | 'store_forward' | 'remote_monitoring';
  patient_location?: string;
  provider_location?: string;
}
PM-07 uses these to determine modifiers and POS without querying CL tables directly.

pm_appointments.telehealth_url Deprecation

PM-03 Phase 1 stores a manual telehealth_url TEXT on pm_appointments. Once PM-13 is active for an organization:
  • Write path: Join links are generated into pm_telehealth_sessions.session_url via the edge function.
  • Read path: UI should prefer pm_telehealth_sessions.session_url when a linked session exists; fall back to pm_appointments.telehealth_url for appointments without a PM-13 session.
  • Migration path: No data migration needed. The telehealth_url column remains for orgs not using PM-13.
  • Sunset date: The telehealth_url column on pm_appointments will be deprecated once all organizations are migrated to PM-13. Target sunset: 2026-Q4. After sunset, the column will be dropped in a future migration.
  • Warning mechanism: Type accessors that expose pm_appointments.telehealth_url MUST include /** @deprecated Use pm_telehealth_sessions.session_url instead. Sunset: 2026-Q4. */ JSDoc annotations. Similarly, accessors exposing is_audio_only MUST include /** @deprecated Use telehealth_modality instead. Sunset: 2026-Q4. */. Runtime access without a linked PM-13 session should emit a structured warning (deprecated_column_access: telehealth_url) to support migration tracking.

Event Registration

The following events should be registered in fw_workflow_events for automation support:
Event NameChannelRegistration Status
telehealth_session_startedcl_pm_events📝 Planned
telehealth_session_completedcl_pm_events📝 Planned
Register in EVENT_CONTRACTS.md under PM-13 section when implemented.

Cross-Reference

SpecResponsibility
PM-03Flags appointments as telehealth
PM-13Manages telehealth platform session, publishes session events
CL-04Documents clinical telehealth fields
PM-07Applies telehealth billing modifiers
CL-PM-ENCOUNTER-TO-BILLINGEvent carries telehealth data from CL-04 to PM-07