Version: 1.1.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Status: ✅ Implemented
Last Updated: 2026-03-27
Spec: PM-18 Configurable Claim Scrubbing & Org Edit Rules
Constitution Reference: Section 1.2 (Core Independence), Section 1.3 (Integration Patterns)
Overview
PM-18 extends PM-08 claim scrubbing with organization-level overrides for system scrub rules (enabled, severity, optional config). The scrubbing engine remains internal; no new public API or event contracts. Overrides are stored inpm_scrub_rule_overrides; definitions in pm_scrub_rule_definitions (seeded, read-only).
Key tables: pm_scrub_rule_definitions, pm_scrub_rule_overrides, pm_scrub_custom_edits (EN-06)RLS:
pm_scrub_rule_overrides and pm_scrub_custom_edits (SELECT/INSERT/UPDATE with WITH CHECK via pm_has_org_access; DELETE via pf_is_org_admin()). Definitions are system-wide read-only.
Enhancement: PM-EN-06 — Per-Payer Custom Scrub Rules
Spec: PM-18-EN-06 Per-Payer Custom Scrub Rules EN-06 extends PM-18 with:- Per-payer/claim-type overrides:
payer_idandclaim_typecolumns added topm_scrub_rule_overrides; override priority: payer+type → payer-only → org-wide. - Custom edits: New
pm_scrub_custom_editstable for org-defined rules with condition expressions (single/compound), severity, message templates, and scope (claim/line). - Effectiveness reporting: Per-rule pass/fail/warning rate from
pm_claim_notesscrub_error entries, with date range presets and per-payer filter. - Permission:
pm.settings.scrub_rules.payergates per-payer override and custom edit management. - PF-70 dependency: Active (not Phase 2) for code-type field validation in custom edit conditions.
Integration Points
| Dependency | Pattern | Status | Purpose | Note |
|---|---|---|---|---|
| PM-08 | Internal (same core) | ✅ Implemented | Claim scrubbing is part of PM-08; PM-18 adds configurable overrides. Engine loads org overrides and applies them when running scrub. | PM-18 extends PM-08 behavior. |
| PF-70 | Platform | ✅ Implemented | Phase 1: PF-70 validates code-type fields (CPT, ICD-10, HCPCS) for custom edit conditions in EN-06. | EN-06 custom edits rely on PF-70 Phase 1 code validation (@/platform/codes); scrub UI/engine consumption per PM-18/EN-06 implementation schedule. |
| PF-01, PF-02 | Platform | ✅ Implemented | Identity, tenancy. | Existing platform dependencies already in use. |
API Contracts
No new public API. Scrubbing is invoked internally by PM-08 claim detail/generate flows; engine acceptsorganizationId and uses PM-18 overrides when present. Contract remains existing ScrubResult shape (isValid, errors[]). EN-06 adds rule_key to custom edit errors for traceability.
Event Contracts
None. PM-18 does not publish or subscribe to events.Tenant Isolation & Auth
- All override access is scoped by
organization_idvia RLS onpm_scrub_rule_overridesandpm_scrub_custom_edits. - UI for managing overrides is gated by
pm.settings.scrub_rules(org-wide) andpm.settings.scrub_rules.payer(per-payer/custom edits). - No PHI in rule definitions, overrides, or custom edits; rule execution operates on claim/line data already protected by PM-08 RLS.