Skip to main content
Spec: PM-13
Status: ✅ Complete
Last Updated: 2026-02-22

Overview

PM-13 adds telehealth session lifecycle management linked to PM-03 appointments. Sessions are created via an edge function, modality-driven modifiers integrate with PM-07 charge capture, and POS codes follow AHCCCS/CMS rules.

Tables

RLS: Both tables use pm_has_org_access() for SELECT/INSERT/UPDATE, pf_is_org_admin() for DELETE. FORCE ROW LEVEL SECURITY enabled. All UPDATE policies include WITH CHECK.

Edge Function

telehealth-create-session
  • Auth: validateAuth() + verifyOrgAccess() via pf_user_role_assignments
  • Reads pm_telehealth_configuration for platform resolution
  • Inserts pm_telehealth_sessions with stub session URL (MVP)
  • Returns session URL, status, modality, platform

Domain Events


PM-07 Integration (Billing Modifiers)

modifier-logic.ts updated with telehealthModality on EncounterContext: A legacy in-memory isAudioOnly boolean on EncounterContext is preserved as a runtime fallback for backward compatibility; new code passes telehealthModality. (There is no is_audio_only database column — telehealth_modality is the only persisted modality field.)

Permissions


Module Settings

Added to pm_module_settings:
  • telehealth_require_consent_every_encounter (BOOLEAN, default TRUE)
  • telehealth_recording_retention_days (INTEGER, default 90)
  • telehealth_default_platform (TEXT, default ‘stub’)

Telehealth added under pm-scheduling group at /pm/telehealth with Video icon, gated by pm.telehealth_sessions.view.

Files

New

  • supabase/migrations/20260222..._pm_13_telehealth.sql
  • supabase/functions/telehealth-create-session/index.ts
  • src/cores/pm/hooks/useTelehealthSessions.ts
  • src/cores/pm/hooks/useTelehealthConfiguration.ts
  • src/cores/pm/pages/TelehealthSessionListPage.tsx
  • src/cores/pm/pages/TelehealthConfigurationPage.tsx
  • tests/unit/pm/modifier-logic-telehealth.test.ts
  • tests/rls/pm/pm-telehealth.test.ts
  • docs/pm/telehealth-user-guide.md
  • docs/pm/telehealth-admin-guide.md

Modified

  • src/cores/pm/utils/modifier-logic.ts (telehealthModality + helpers)
  • src/platform/permissions/constants.ts (3 permission keys)
  • src/platform/modules/module-registry/pm-module.ts (nav item)
  • src/routes/pm.tsx (route registration)

Future Work

  • PM-15: Clearinghouse submission of telehealth claims with modifier/POS
  • Video Platform: Replace stub adapter with Zoom/Doxy.me BAA-compliant integration
  • PM-12: Patient portal join link for self-service session access
  • CL-16: FHIR Encounter resource with telehealth extension