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-07-EN-01
Status: πŸ“‹ Planned
Spec Reference: specs/cl/specs/CL-07-EN-01-zero-suicide-framework.md
Last Updated: 2026-04-10

Overview

CL-07-EN-01 extends CL-07 with structured lethal means assessment capture, safety plan sharing with consent controls, and automated high-risk follow-up scheduling. This enhancement integrates with platform scheduling, notifications, and clinical context layers while preserving CL ownership boundaries.

Integration Points

DependencyPatternPurpose
PF-01 Organizations & SitesDirect dependencyTenant/site scope for all created records and operations
PF-10 NotificationsPlatform Integration LayerNotify clinicians/support network for safety-plan sharing (signed URL in action_url) and follow-up milestones
PM-03 SchedulingPlatform Integration Layer (@/platform/scheduling)Create 24/48/72 follow-up encounters without direct CL->PM imports
PF-96 Jurisdiction ProfilesPlatform Integration LayerSupport jurisdiction-specific policy parameters without hardcoded state constants
CL-11 Consent ManagementPlatform Clinical Layer (@/platform/clinical)useConsentCheck(chartId, 'safety_plan_share') β†’ cl_check_sud_consent RPC for Part 2 consent gating before share
Supabase StorageDirect (edge function)24h signed URLs; share-row gate + audit (see below)

Storage / signed URL policy

  • Bucket: cl-safety-plan-shares. TTL: createSignedUrl(..., 86400) (24h).
  • Before issuing or returning a signed URL: require cl_safety_plan_shares.status === 'active'; reject revoked / expired. Persist revocation as status = 'revoked'.
  • Log each fetch: share row id, user id, timestamp, client IP, outcome (allow/deny).

Event and API Contracts

Planned Events

  • cl_safety_plan_shared
    • Publisher: CL
    • Subscribers: PF-10 notifications, workflow listeners
    • Payload (minimum): organization_id, patient_id, safety_plan_id, shared_by, shared_at
  • cl_zero_suicide_followup_scheduled
    • Publisher: CL
    • Subscribers: PM scheduling views, PF-10 reminders
    • Payload (minimum): organization_id, patient_id, followup_type, scheduled_for, encounter_id

API Surface (planned)

  • createSafetyPlanShare(...) β€” consent via cl_check_sud_consent; PDF to Storage; signed URL (24h TTL); insert cl_safety_plan_shares (status = active, expires_at aligned); PF-10 action_url = URL
  • scheduleZeroSuicideFollowups(chartId, riskLevel) β€” creates 24/48/72h follow-up appointment requests via @/platform/scheduling when riskLevel is β€˜high’ or β€˜imminent’

Security and Compliance Notes

  • Enforce tenant isolation via organization_id and RLS on new CL tables.
  • Enforce consent-aware sharing logic for SUD/Part 2-sensitive content.
  • Log only identifiers in integration payloads; avoid PHI-rich payload structures.

  • docs/architecture/integrations/CL-07-suicide-risk-screening-safety-planning-INTEGRATION.md
  • docs/architecture/integrations/CROSS_CORE_INTEGRATIONS.md
  • docs/architecture/integrations/EVENT_CONTRACTS.md
  • docs/architecture/integrations/API_CONTRACTS.md