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-02-17 Constitution Reference: Section 1.2 (Core Independence), Section 1.3 (Integration Patterns) Source: CL-PM-SPEC-REVIEW Finding 5.2

Overview

Referrals involve both clinical coordination (CL-12) and business operations (PM-06). This contract defines the ownership boundary and integration pattern.

Ownership Boundaries

ConcernOwnerSpec
Referral lifecycle (create, track, convert)PM-06pm_referrals
Referral source/attribution trackingPM-06pm_referrals.source
Insurance verification for referralPM-02Eligibility check
Clinical summary for referralCL-12cl_transitions
Medication reconciliation at transitionCL-05cl_medication_reconciliations
Treatment plan transferCL-03cl_treatment_plans
Safety plan updateCL-07cl_safety_plans
C-CDA transition documentCL-16FHIR/C-CDA generation
Principle: PM-06 owns the referral entity. CL-12 adds clinical context by linking transitions to referrals through the Platform Integration Layer.

Integration Pattern

Event: referral_accepted

Publisher: PM-06 Subscribers: CL-12 Channel: cl_pm_events When a referral is accepted (status → accepted), CL-12 receives the event to:
  1. Create a cl_transitions record (type = referral)
  2. Trigger discharge checklist if outbound referral
  3. Trigger medication reconciliation
  4. Generate C-CDA transition summary (via CL-16)
interface ReferralAccepted {
  event: 'referral_accepted';
  publisher: 'PM';
  subscriber: ['CL'];
  payload: {
    referral_id: uuid;
    patient_id: uuid;
    referral_direction: 'inbound' | 'outbound';
    from_facility?: string;
    to_facility?: string;
    from_level_of_care?: string;
    to_level_of_care?: string;
    referral_reason: string;
    urgency: 'routine' | 'urgent' | 'emergent';
  };
  metadata: {
    organization_id: uuid;
    user_id: uuid;
    timestamp: string;
    correlation_id: uuid;
  };
}

Data Linkage

CL-12 cl_transitions references the PM-06 referral through the Platform Integration Layer:
-- CL-12 adds this column to cl_transitions
referral_id UUID  -- References pm_referrals.id via Platform Integration Layer
                  -- NOT a direct FK (would violate core independence)
                  -- Validated at application layer, not database level

Workflow: Outbound Referral with Clinical Transition

PM-06: Referral created (outbound, status = 'pending')

PM-02: Insurance eligibility verified at destination

PM-06: Referral accepted (status = 'accepted')
  → publishes referral_accepted event

CL-12: Creates cl_transitions record (type = 'referral')
  ↓ (parallel)
CL-05: Medication reconciliation triggered
CL-07: Safety plan reviewed/updated
CL-16: C-CDA transition summary generated
CL-03: Treatment plan review triggered

CL-12: Transition checklist completed
  → publishes transition_completed event

PM-06: Referral status updated to 'completed'

Cross-Reference

SpecResponsibility
PM-06Referral entity lifecycle, source tracking
CL-12Clinical transition documentation, care coordination
CL-05Medication reconciliation at transition
CL-07Safety plan update
CL-16C-CDA transition summary
PM-02Eligibility verification