> ## 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.

# Integration Documentation: PM-44 — ERA Reconciliation & Underpayment Detection

> Version: 1.0 Created: 2026-04-08 Last Updated: 2026-04-08 Status: 📝 Planned

**Version:** 1.0
**Created:** 2026-04-08
**Last Updated:** 2026-04-08
**Status:** 📝 Planned

***

## Overview

PM-44 integrates with multiple PM-core specs and Platform Foundation services to provide automated ERA-to-contract reconciliation, underpayment detection, payer performance analytics, and appeal workflow initiation.

***

## Integration Points

### Platform Foundation (PF) Dependencies

| PF Spec                       | Integration Type           | Description                                                                       |
| ----------------------------- | -------------------------- | --------------------------------------------------------------------------------- |
| PF-01 (Organizations & Sites) | Direct dependency          | Tenant context (`organization_id`, `site_id`) for all reconciliation data         |
| PF-02 (RBAC)                  | Direct dependency          | Permission checks via `pf_has_permission()` for billing/collections access        |
| PF-10 (Notifications)         | Platform Integration Layer | Alert billing team on high-variance underpayments                                 |
| PF-12 (Reports)               | Platform Integration Layer | Export reconciliation and payer performance reports                               |
| PF-96 (Jurisdiction Profiles) | Data dependency            | Jurisdiction-scoped compliance parameters for state-specific reconciliation rules |

### Same-Core Dependencies (PM)

| PM Spec                             | Integration Type | Description                                                                                                |
| ----------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------- |
| PM-09 (Payment Posting & ERA)       | Event consumer   | `payment_posted` triggers reconciliation; reads `pm_payments` for paid amounts                             |
| PM-23 (Contract & Fee Schedule)     | Data dependency  | Reads `pm_contracted_rates` for allowable amounts per CPT/modifier/payer/date                              |
| PM-29 (Denial Management & Appeals) | API / action     | Initiates underpayment appeals with pre-populated variance data                                            |
| PM-11 (Revenue Cycle Dashboard)     | Data provider    | Payer performance snapshot data feeds PM-11 dashboard widgets                                              |
| PM-36 (Charge Reconciliation)       | Adjacent         | PM-36 handles pipeline gaps (missing charges/payments); PM-44 handles amount variance (paid vs contracted) |

***

## Event Contracts

### Events Consumed

| Event            | Publisher | Payload                                           | Purpose                                                       |
| ---------------- | --------- | ------------------------------------------------- | ------------------------------------------------------------- |
| `payment_posted` | PM-09     | `{ era_file_id, payment_ids[], organization_id }` | Triggers reconciliation for each claim line in the posted ERA |

### Events Published

| Event                      | Subscribers                                              | Payload                                                                                 | Purpose                                             |
| -------------------------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `pm_underpayment_detected` | PM-29 (if auto-appeal enabled), PM-11 (dashboard widget) | `{ reconciliation_id, claim_id, payer_id, variance_amount, cpt_code, organization_id }` | Notify downstream systems of detected underpayments |

***

## Boundary Clarifications

### PM-23 Boundary

* **PM-23 owns:** Contract rate data, rate lookup logic, initial variance flag on claim/payment line
* **PM-44 owns:** Operational reconciliation queue, bulk actions, payer performance analytics, appeal initiation workflow, AI pattern detection
* **Shared:** PM-44 reads contracted rates from PM-23's `pm_contracted_rates` table

### PM-29 Boundary

* **PM-29 owns:** Denial tracking, appeal templates, appeal submission workflow
* **PM-44 owns:** Underpayment detection, variance data, appeal initiation (one-click from queue)
* **Handoff:** PM-44 creates appeal record in PM-29 with pre-populated variance data

### PM-36 Boundary

* **PM-36 owns:** Charge pipeline gap detection (missing charge, missing claim, missing payment)
* **PM-44 owns:** Payment amount variance detection (paid vs contracted)
* **Distinction:** PM-36 = "is there a payment?" vs PM-44 = "is the payment correct?"

***

## Scheduled Processing

| Job Name                            | Schedule                                                                                                                | Edge Function                         | Purpose                                |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | -------------------------------------- |
| `pm-payer-performance-snapshot`     | `0 2 * * *` (daily 2:00 AM UTC; windowing uses org-local timezone with UTC persistence per PM-44 Clarification)         | `generate-payer-performance-snapshot` | Refresh payer performance data         |
| `pm-underpayment-pattern-detection` | `0 3 * * 1` (weekly Monday 3:00 AM UTC; windowing uses org-local timezone with UTC persistence per PM-44 Clarification) | `detect-underpayment-patterns`        | AI pattern analysis on historical data |

***

## References

* **Spec:** `specs/pm/specs/PM-44-automated-era-reconciliation-underpayment-detection.md`
* **PM-09:** `specs/pm/specs/PM-09-payment-posting-era-processing.md`
* **PM-23:** `specs/pm/specs/PM-23-contract-fee-schedule-management.md`
* **PM-29:** `specs/pm/specs/PM-29-claims-denial-management-appeals.md`
* **PM-11:** `specs/pm/specs/PM-11-revenue-cycle-dashboard-analytics.md`
* **PM-36:** `specs/pm/specs/PM-36-automated-charge-reconciliation.md`
* **Cross-Core Matrix:** `docs/architecture/integrations/CROSS_CORE_INTEGRATIONS.md`
