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-23
Status: ✅ Implemented
Last Verified: 2026-02-23 Spec: PM-16-patient-statement-generation-billing-communications

Overview

PM-16 adds statement cycle orchestration, multichannel delivery (print/email/portal), payment plans, and financial assistance workflow. It depends on PF and same-core PM features only; no cross-core imports.

Quick Reference

I need to…PatternLocation
Generate/send statement communications safelyPF-10 notifications + PHI-safe payload IDs onlySecurity & Tenant Isolation
Persist statement artifactsPF-11 documents integrationContract: Platform Foundation
Align billing state with existing PM recordsPM-09 statement/payment linkageContract: Same-Core (PM)

Integration Matrix

IntegrationSpecDirectionPatternStatus
Organizations & SitesPF-01PM-16 → PFDirect📝 Planned
RBAC / PermissionsPF-02 (PF-30)PM-16 → PFDirect📝 Planned
Notifications (email)PF-10PM-16 → PFPlatform Integration Layer📝 Planned
Documents (statement PDFs)PF-11PM-16 → PFPlatform Integration Layer📝 Planned
Payments & statement tablePM-09PM-16 → PMSame core📝 Planned
Patient portal postingPM-12PM-16 → PMSame core📝 Planned

Cross-Core Summary (CROSS_CORE_INTEGRATIONS.md)

This row matches the central matrix format for alignment with CROSS_CORE_INTEGRATIONS.md:
From CoreTo CoreIntegration PatternStatusDocumentation
PM (PM-16)PF-10, PF-11, PM-09, PM-12Platform Layer / Data📝PM-16 Patient Statement Generation & Billing Communications

Contract: Platform Foundation

PF-01 (Organizations & Sites)

  • Usage: Tenant context (organization_id, optional site_id) on all PM-16 tables; RLS and app-level filtering.
  • Contract: Standard multi-tenant pattern; no custom API.

PF-02 / PF-30 (Permissions)

  • Usage: Permission keys pm.statements.*, pm.payment_plans.*, pm.financial_assistance.* for UI and actions.
  • Contract: Keys defined in spec; seeded in migration; checks via pf_has_permission().

PF-10 (Notifications)

  • Usage: Email delivery of statements / billing communications.
  • Contract: Use @/platform/notifications (Platform Integration Layer). Payload and template TBD in implementation.

PF-11 (Documents)

  • Usage: Statement PDF generation and storage; portal and print consumption.
  • Contract: Use @/platform/documents (Platform Integration Layer). Document type and metadata TBD in implementation.

Contract: Same-Core (PM)

PM-09 (Payments & statement table)

  • Usage: Payment artifacts and existing statement table; payments update balances and statuses used by PM-16.
  • Contract: Direct table access within PM; align statement run and delivery tables with PM-09 data model.

PM-12 (Patient portal)

  • Usage: Portal posting of statements; patient-facing billing view.
  • Contract: Direct PM hooks/queries; statement visibility and download via portal scope (patient + org).

Event Contracts

No cross-core events required for PM-16. Internal events (e.g., statement_run_completed, delivery_attempt_recorded) may be added for audit or workflow; document in EVENT_CONTRACTS.md if added.

API Contracts

No public cross-core APIs. Internal PM hooks and edge functions (e.g., statement generation, delivery trigger) to be documented in implementation tasks.

Security & Tenant Isolation

  • All PM-16 data scoped by organization_id; RLS and app-level filter on every mutation.
  • PHI: statement and payment-plan data; no PHI in logs; access via RLS and permission keys only.
  • Integration with PF-10/PF-11: no PHI in notification payloads; use system-generated UUIDs only (e.g. patient_id, statement_id, organization_id); resolve display names and account details via authorized API calls in the UI; document the retrieval pattern in implementation. Must not include in payloads: patient names, MRNs, DOBs, account numbers. Acceptable: patient UUID, statement ID, organization ID.

Open Items

  • Finalize statement PDF format and storage location (PF-11).
  • Define email template and notification payload for statement delivery (PF-10).
  • Confirm PM-09 table names and columns for statement/balance linkage.
  • Add CROSS_CORE_INTEGRATIONS.md row if any cross-core integration is added later.