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.

Spec: PM-32
Status: ✅ Complete
Last Updated: 2026-04-03
Owner: PM (Practice Management)

Overview

PM-32 adds a structured financial counseling workflow: income collection, FPL calculation, assistance program referral tracking, and charity care determination. It reads patient data from PM-01, writes insurance policies to PM-02, feeds charity indicator data to PM-16, informs sliding fee decisions to PM-21, and optionally integrates with PM-20 GFE and PF-08 forms. All integrations are same-core data reads (PM-01, PM-02, PM-16, PM-20, PM-21) or platform layer (PF-08 form snapshot). No direct cross-core imports. No event contracts are required for MVP; PM-02 eligibility trigger is a same-core function call.

Integration Points

1. PM-01 (Patient Registration)

AttributeDetail
PatternSame-core data reference (FK)
DirectionPM-32 → PM-01 (reads patient)
Datapm_financial_counseling_sessions.patient_id → pm_patients.id
NotesSessions and applications are patient-scoped; patient must exist before counseling session

2. PM-02 (Insurance Policy Management & Eligibility)

AttributeDetail
PatternSame-core function call
DirectionPM-32 → PM-02
TriggerWhen pm_assistance_program_referrals.application_status transitions to approved
ActionPopulate policy_id FK on referral; call PM-02 eligibility check for the new policy
NotesPolicy must already exist in pm_insurance_policies or be created as part of approval; PM-32 links the referral to the policy; PM-02 owns eligibility verification
Stub schema (approval action):
// Called when referral approved
interface ApprovalPayload {
  referralId: string;       // pm_assistance_program_referrals.id
  patientId: string;        // pm_patients.id
  organizationId: string;
  policyId: string;         // pm_insurance_policies.id — must exist
}
// After: trigger PM-02 eligibility check on policyId

3. PM-16 (Patient Statement Generation & Billing Communications)

AttributeDetail
PatternSame-core data read (live join)
DirectionPM-16 → PM-32 tables
DataPM-16 queries pm_charity_care_applications to determine charity indicator
Join conditionapproved_at IS NOT NULL AND (expiration_date IS NULL OR expiration_date > CURRENT_DATE)
Required indexidx_pm_charity_care_applications_patient on (organization_id, patient_id, expiration_date)
NotesNo denormalized flag; no event required; PM-32 owns the data, PM-16 reads it

4. PM-20 (Good Faith Estimate & Price Transparency)

AttributeDetail
PatternInformational reference (no direct data dependency for MVP)
DirectionFinancial counselor workflow context informs GFE process
NotesWhen patient receives financial counseling, counselor may trigger a GFE via PM-20 for out-of-pocket cost estimate; PM-32 does not generate GFEs. PM-20 may read charity status from PM-32 tables in future phases.

5. PM-21 (Sliding Fee Discount Schedule Management)

AttributeDetail
PatternSame-core data read
DirectionPM-21 → PM-32 tables
DataPM-21 reads fpl_percentage from most recent authoritative session in pm_financial_counseling_sessions to determine sliding fee tier
Authoritative FPLMost recent session with income_verified_at IS NOT NULL; fallback: most recent by session_date
NotesPM-21 owns the discount schedule; PM-32 owns the income/FPL data. PM-21 does not write to PM-32 tables.

6. PF-08 (Forms)

AttributeDetail
PatternPlatform layer (PF-08 form reference + snapshot)
DirectionPM-32 → PF-08 (optional)
Datapm_financial_counseling_sessions.form_id → pf_forms.id; form_snapshot JSONB
NotesOptional: counselors may use a PF-08 intake form for income/asset collection; snapshot is stored for PHI audit trail even if PF-08 template changes

Platform Layers Used

LayerUsage
@/platform/clinical (patient context)Read patient context for counseling session; usePatientContext(patientId) when available
@/platform/permissionsuseHasPermission('pm.financial_counseling.view'), manage, approve_charity
PF-30 (RBAC)Permission keys seeded: pm.financial_counseling.view, manage, approve_charity
PF-10 (Notifications)30-day charity expiration reminder; annual review reminder

Event Contracts

Events Consumed

pm_cost_estimate_generated (from PM-48)

  • Publisher: PM-48 (Patient Cost Estimation & Financial Clearance)
  • Event Name: pm_cost_estimate_generated
  • Version: 1.0
  • Payload Schema:
    {
      estimate_id: string;
      patient_id: string;
      organization_id: string;
      patient_estimated_responsibility: number;
      service_type: string;
    }
    
  • Subscription Rules: Conditional — subscribe only when patient_estimated_responsibility exceeds the configured threshold (from PF-96 jurisdiction profile or pm_module_settings.financial_clearance_threshold)
  • Threshold Behavior:
    • Read financial_clearance_threshold from jurisdiction profile (PF-96) if available
    • Fallback to pm_module_settings.financial_clearance_threshold (default: $1,000)
    • Auto-create PM-32 referral record when threshold exceeded
  • Delivery Semantics: At-least-once; idempotent via estimate_id (check for existing referral before creating)
  • Retry Policy: Standard retry with exponential backoff (3 attempts)
  • Idempotency Keys: estimate_id — prevent duplicate referrals
  • ACL/Topic: pm.cost_estimates topic
  • Purpose: Auto-route patients to financial counseling when estimated responsibility exceeds threshold
  • Status: 📝 Planned
Potential future events (post-MVP):
EventProducerConsumersNotes
pm_charity_approvedPM-32PM-16, FANotify statement generation and financial accounting of charity determination. Deferred.
pm_assistance_referral_approvedPM-32PM-02Trigger eligibility check when referral status = approved. Currently a same-core call.

API Contracts

No external API contracts for MVP. All data flows are internal (same-core or platform layer). Future: AHCCCS direct submission API (deferred per Out of Scope in PM-32 spec).

Security

  • All tables behind pm_has_org_access SECURITY DEFINER RLS.
  • pm.financial_counseling.approve_charity is supervisor-level; not assigned to standard counselor role by default.
  • Income/financial data is PHI; no PHI written to logs; access via RLS + RBAC only.

Pending Contracts

No pending contracts for MVP. See PENDING_CONTRACTS.md if future event contracts are needed.

References