Dev Reference

Revenue Cycle Management (RCM)

Claim creation, scrubbing, clearinghouse submission, ERA/EOB posting, denial management, appeals, and patient statement generation.

Data Classification: All entities are org-scoped (partitioned by OrganizationID). See Data Model for ownership rules and IC Reference for isolation constraints.

Claim

Org-scoped. Trust Tier: T1 (PHI + financial).

Schema

FieldTypeRequiredPKFKNotes
ClaimIDUUIDYesYesPrimary key
PatientIDUUIDYesPatient
EncounterIDUUIDYesEncounter
ProviderIDUUIDYesProviderRendering provider
PayerIDString(50)YesPayer identifier
ClaimTypeString(50)YesProfessional / Institutional / Dental
StatusString(50)YesDraft / Scrubbed / Submitted / Accepted / Denied / Paid / PartiallyPaid / WrittenOff / Voided
TotalChargeAmountMoneyYes
TotalChargeCurrencyCodeString(3)YesISO 4217
TotalAllowedAmountMoneyNo
TotalAllowedCurrencyCodeString(3)NoISO 4217
TotalPaidAmountMoneyNo
TotalPaidCurrencyCodeString(3)NoISO 4217
PatientResponsibilityAmountMoneyNo
PatientResponsibilityCurrencyCodeString(3)NoISO 4217
AdjustmentAmountMoneyNo
AdjustmentCurrencyCodeString(3)NoISO 4217
SubmissionDateTimeDateTime (UTC)No
ClearinghouseTrackingIdString(50)No
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

RBAC

RoleTierPermissions
Patient (10)T1Read own claims via portal
Front Desk (30)T1Read status; post cash/card payments
MA / RN (40)T1Read
Coder / Biller (50)T1Read / write claims and claim lines
Clinician (60)T1Read; sign-off on coding
Billing Manager (70)T1Read / write / submit / appeal
Practice Admin (80)T1Full CRUD
EditAMI (90)T1Schema administration

ClaimLine

Org-scoped. Trust Tier: T1 (procedure-level financial detail).

Schema

FieldTypeRequiredPKFKNotes
ClaimLineIDUUIDYesYesPrimary key
ClaimIDUUIDYesClaim
LineNumberIntYesSequence within claim
CptCodeString(50)YesCPT/HCPCS code
Icd10PointerString(50)YesDiagnosis pointer (e.g. 1,2)
ModifierString(50)NoCPT modifier(s)
ChargeAmountMoneyYes
ChargeCurrencyCodeString(3)YesISO 4217
AllowedAmountMoneyNo
AllowedCurrencyCodeString(3)NoISO 4217
PaidAmountMoneyNo
PaidCurrencyCodeString(3)NoISO 4217
PatientResponsibilityAmountMoneyNo
PatientResponsibilityCurrencyCodeString(3)NoISO 4217
AdjustmentAmountMoneyNo
AdjustmentCurrencyCodeString(3)NoISO 4217
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

RBAC

RoleTierPermissions
Coder / Biller (50)T1Read / write claim lines
Clinician (60)T1Read; sign-off
Billing Manager (70)T1Read / write
Practice Admin (80)T1Full CRUD
EditAMI (90)T1Schema administration

Payment (RCM)

Org-scoped. Trust Tier: T2 (financial posting, no direct PHI).

Schema

FieldTypeRequiredPKFKNotes
PaymentIDUUIDYesYesPrimary key
ClaimIDUUIDYesClaim
PayerNameString(100)Yes
AmountMoneyYes
CurrencyCodeString(3)YesISO 4217
MethodString(50)YesEFT / Check / VirtualCard
EraTraceNumberString(50)NoERA 835 trace number
PostingDateTimeDateTime (UTC)Yes
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

RBAC

RoleTierPermissions
Front Desk (30)T2Read; post cash/card payments
Coder / Biller (50)T2Read / write / post ERA payments
Billing Manager (70)T2Read / write / adjust / void
Practice Admin (80)T2Full CRUD
EditAMI (90)T2Schema administration

Denial

Org-scoped. Trust Tier: T2 (claim adjudication metadata).

Schema

FieldTypeRequiredPKFKNotes
DenialIDUUIDYesYesPrimary key
ClaimIDUUIDYesClaim
DenialCodeString(50)YesCARC/RARC code
DenialReasonString(200)Yes
DenialCategoryString(50)YesClinical / Administrative / Technical
AppealStatusString(50)NoNotAppealed / Pending / Won / Lost / Expired
AppealDeadlineDateTimeDateTime (UTC)No
RootCauseString(50)Noe.g. MissingAuth, CodingError, Timely Filing
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

RBAC

RoleTierPermissions
Coder / Biller (50)T2Read / write denials; initiate appeals
Billing Manager (70)T2Read / write / escalate appeals
Practice Admin (80)T2Full CRUD
EditAMI (90)T2Schema administration

PatientStatement

Org-scoped. Trust Tier: T2 (patient financial summary).

Schema

FieldTypeRequiredPKFKNotes
PatientStatementIDUUIDYesYesPrimary key
PatientIDUUIDYesPatient
TotalDueAmountMoneyYes
TotalDueCurrencyCodeString(3)YesISO 4217
StatementDateDateTime (UTC)Yes
PaymentPlanIDString(50)NoOptional payment plan reference
IsPaidBoolYes
OrganizationIDUUIDYesOrganizationTenant partition key
CreatedByUserIDUUIDYesUserAudit
CreatedDateTimeDateTime (UTC)YesAudit
UpdatedByUserIDUUIDYesUserAudit
UpdatedDateTimeDateTime (UTC)YesAudit

RBAC

RoleTierPermissions
Patient (10)T2Read own statements via portal
Front Desk (30)T2Read; collect payments
Coder / Biller (50)T2Read / write / generate statements
Billing Manager (70)T2Read / write / adjust / write-off
Practice Admin (80)T2Full CRUD
EditAMI (90)T2Schema administration

Trust tier roll-up

EntityTierSource of truth
Claim1 — Internal canonicalGenerated from encounter documentation and submitted through the platform’s clearinghouse connector
ClaimLine1 — Internal canonicalDerived from encounter procedures and scrubbed by the platform’s rules engine
Payment (manual)1 — Internal canonicalPosted by authorized billing staff from checks, cash, or card receipts
Payment (ERA)2 — External inboundPayment amounts and adjustments originate from the payer’s ERA/835 adjudication response
Denial (code/reason)2 — External inboundDenial code and reason originate from the payer’s adjudication response
Denial (category/root-cause)1 — Internal canonicalAI categorization and root-cause assignment are performed by the platform’s triage engine
PatientStatement1 — Internal canonicalGenerated by the platform from the patient’s org-scoped balance

RBAC matrix (IC 0–100 scale)

RoleLevelClaimClaimLinePaymentDenialPatientStatement
Patient (self)10Read own (via Patient Portal)No accessRead ownRead ownRead own
Front desk (Jordan)30Read statusReadRead; post manual (cash/card)Read flagRead; generate
MA / RN40ReadReadReadReadRead
Coder / Biller50Read / Write (edit codes, modifiers)Read / Write (edit line-level codes)Read / Write (post manual, split-allocate)Read / Write (update appeal status)Read / Write (generate, adjust)
Clinician (Dr. M / Maria)60Read; sign-off on charge captureReadReadReadRead
Billing manager (Sam)70Read / Write / SubmitRead / WriteRead / WriteRead / Write / AppealRead / Write
Practice admin80Full CRUD + write-off approvalFull CRUDFull CRUDFull CRUDFull CRUD
EditAMI90Required for any AMI schema break (per IC hard rule #5)

Claim submission hard rule: Only users with level ≥ 70 (billing manager) can submit a claim to the clearinghouse. Coders (level 50) can edit and scrub, but submission requires manager approval. Clinicians (level 60) sign off on charge capture at encounter close but do not submit claims directly.

FK Relationship Diagram

erDiagram
    Patient ||--o{ Claim : "has"
    Encounter ||--o{ Claim : "generates"
    Provider ||--o{ Claim : "renders"
    Claim ||--o{ ClaimLine : "contains"
    Claim ||--o{ Payment : "receives"
    Claim ||--o{ Denial : "may have"
    Patient ||--o{ PatientStatement : "owes"
    

Claim State Machine

stateDiagram-v2
    [*] --> Draft
    Draft --> Scrubbed : Auto-scrub rules pass
    Scrubbed --> Submitted : Send to clearinghouse
    Submitted --> Accepted : Payer accepts
    Submitted --> Denied : Payer denies
    Accepted --> Paid : Full payment received
    Accepted --> PartiallyPaid : Partial payment received
    Accepted --> Denied : Post-acceptance denial
    PartiallyPaid --> Paid : Remaining balance paid
    PartiallyPaid --> WrittenOff : Balance written off
    Denied --> Submitted : Appeal resubmission
    Denied --> WrittenOff : Write off denied balance
    Draft --> Voided : Cancel before submission
    Scrubbed --> Voided : Cancel before submission
    Paid --> [*]
    WrittenOff --> [*]
    Voided --> [*]
    

Functional Requirements

  1. P0 The system SHALL create claims from encounter data with CPT, ICD-10, and modifier codes on claim lines.
  2. P0 The system SHALL auto-scrub claims against payer-specific rules before submission and flag errors for correction.
  3. P0 The system SHALL submit claims electronically via clearinghouse (ANSI X12 837P/837I) and track clearinghouse acknowledgments.
  4. P0 The system SHALL process ERA (835) remittance files and auto-post payments to corresponding claims.
  5. P0 The system SHALL track claim status through the full lifecycle (Draft through Paid/WrittenOff/Voided) with immutable audit.
  6. P1 The system SHALL capture denial codes (CARC/RARC), categorize denials, and track appeal deadlines.
  7. P1 The system SHALL generate patient statements consolidating patient responsibility across claims.
  8. P1 The system SHALL support payment plans with scheduled installment tracking on PatientStatement.
  9. P1 The system SHALL provide denial root-cause analytics (MissingAuth, CodingError, TimelyFiling) for process improvement.
  10. P1 The system SHALL allow billing managers to submit appeals with supporting documentation before appeal deadlines.
  11. P1 The system SHALL support secondary and tertiary claim submission when primary payer adjudication is complete.
  12. P2 The system SHALL provide aging reports (30/60/90/120+ days) for accounts receivable management.
  13. P2 The system SHALL support batch claim submission and batch ERA posting for high-volume practices.
  14. P2 The system SHALL allow clinicians to review and sign off on coding before claim submission.
  15. P2 The system SHALL display patient statements in the patient portal with online payment capability.
  16. P2 The system SHALL support write-off workflows with configurable approval thresholds by dollar amount.

Non-Functional Requirements

icApplication Overrides

How the five RCM AMI schemas turn into a live application: module-specific stack additions, override component bindings, the clearinghouse integration pipeline, the denial triage & appeal pipeline, a versioning worked example, environment cascade, and RBAC enforcement.

Shared generation map. The IC platform code-gen flow, default bindings, environment cascade, RBAC model, and CLI commands are identical across all modules. See the IC Reference for the canonical shared reference. This section covers only RCM-specific content.

Technology stack P0

The shared platform stack (Cosmos DB, Redis, IC-generated API, Angular 21, SQS+SNS, OpenTelemetry, etc.) is documented in the IC Reference. Module-specific additions:

LayerTechnologyNotes
Clearinghouse (primary)Waystar837P submission, 276/277 status, ERA/835 ingestion. BUY decision per Integration Ecosystem.
Clearinghouse (secondary)AvailityDirect-connect payers that require Availity routing (e.g., some BCBS plans). BUY decision.
Claim scrubbingHYBRID: core engine built, rule content licensed10K+ payer-specific rules (NCCI, MUE, LCD/NCD). Weekly rule-content updates from licensed source. Engine is platform-native.
AI codingHYBRID: model trained on practice data, rules from Coding/CDSAI coding suggestions per §4.4 integrated with Coding / CDS module.
Patient statementsInstaMedStatement rendering, delivery, and payment processing via InstaMed. BUY decision.
Online bill payInstaMedPCI-compliant payment processing integrated with Patient Portal. BUY decision.
CollectionsCollection agency APIBad-debt routing with audit trail. BUY decision (agency selection per org).
Denial AI triageInternal model (BERT-based classifier)Categorizes denials into 6 buckets + root-cause tagging. Retrained quarterly on labeled denial outcomes.
FHIR resource profilesClaim, ClaimResponse, ExplanationOfBenefit, PaymentNoticeR4 baseline; USCDI v3 alignment for CY 2026.

RCM-specific override bindings P0

These overrides are declared in rules/*.rules.json and replace the default for the matching field name pattern.

FieldDefault would renderOverride componentWhy
Claim.StatusString50plain text displayic-ng21-rcm-1-claim-status-pillColor-coded status pill (Draft / Scrubbed / Submitted / Accepted / Rejected / Denied / Paid / PartiallyPaid / WrittenOff / Voided) with aging indicator.
ClaimLine.CptCodeString50plain text inputic-ng21-rcm-1-coding-suggestionCPT/HCPCS code search with AI coding suggestions, modifier warnings, and scrubbing feedback inline.
ClaimLine.Icd10PointerString50plain text inputic-ng21-rcm-1-coding-suggestionICD-10-CM diagnosis pointer selector with AI suggestions from encounter documentation.
ClaimLine.ModifierString50plain text inputic-ng21-rcm-1-charge-captureModifier intelligence selector with conflict warnings (NCCI pair, bilateral modifier).
Claim.TotalChargeAmountMoney + Claim.TotalChargeCurrencyCodeString3 + financial summaryplain money displayic-ng21-rcm-1-charge-captureCharge summary panel with auto-calculated totals, scrubbing status badge, and submission gate.
Denial.DenialCategoryString50plain text displayic-ng21-rcm-1-denial-triageAI-categorized denial card with root-cause tag, appeal deadline countdown, and routing queue assignment.
Denial.AppealStatusString50plain text displayic-ng21-rcm-1-appeal-editorAppeal workflow panel: letter editor with regulatory citations, deadline tracker, and submission gate.
Payment.PaymentMethodString50 + postingplain text inputic-ng21-rcm-1-era-postingPayment posting panel: ERA auto-post status, manual entry form with split-allocation, and contractual adjustment display.
PatientStatement.TotalDueAmountMoney + PatientStatement.TotalDueCurrencyCodeString3 + billingplain money displayic-ng21-rcm-1-patient-statementStatement card with InstaMed delivery status, online pay link, payment plan enrollment, and credit balance indicator.
(synthetic) AR aging dashboardn/aic-ng21-rcm-1-ar-dashboardReal-time AR aging: days in AR, clean-claim rate, denial rate, collection rate, aging buckets, payer and provider drill-down.
(synthetic) MIPS performancen/aic-ng21-rcm-1-mips-dashboardMIPS quality measures, promoting interoperability, improvement activities, APP Plus, 27 MVPs with benchmark comparison.

Clearinghouse integration pipeline P0

Claim submission and remittance ingestion flow through two clearinghouse connectors. Waystar is primary; Availity is used for direct-connect payers that require it (some BCBS plans). Both are BUY integrations per the Integration Ecosystem decision.

flowchart LR
  CLAIM[Claim ready
Status = Scrubbed] WAYSTAR[Waystar
primary] AVAILITY[Availity
secondary] PAYER[Payer
adjudication] ERA[ERA/835
remittance] CLAIM --> WAYSTAR CLAIM --> AVAILITY WAYSTAR --> PAYER AVAILITY --> PAYER PAYER --> ERA ERA --> POSTING[Auto-posting
+ Denial routing]
StageDirectionConnectorTransaction
Claim submissionOutboundWaystar (primary) / Availity (secondary)837P professional claim
Claim status queryOutboundWaystar276/277 real-time status
Remittance ingestionInboundWaystar / AvailityERA/835 auto-posting
Secondary claimOutboundWaystar837P with COB adjustments

The waystar-clearinghouse.ts adapter handles 837P serialization, 276/277 polling, and ERA/835 deserialization. The availity-clearinghouse.ts adapter handles direct-connect payer routing. Payer routing rules are maintained in rules/claim.rules.json and specify which PayerIDString50 values route through Availity vs. Waystar.

Denial triage & appeal pipeline P0

Denied claims are processed through an AI-powered triage pipeline that categorizes, routes, and enables appeal generation:

flowchart TD
  DENIAL[Denial received
from ERA/835] TRIAGE[AI Triage Engine
BERT classifier] CAT{Category?} QUEUE[Work Queue
assignment] APPEAL[Appeal Letter
Generator] SUBMIT[Appeal Submitted
to payer] TRACK[SLA Tracking
+ Escalation] DENIAL --> TRIAGE TRIAGE --> CAT CAT -- Eligibility --> QUEUE CAT -- Authorization --> QUEUE CAT -- Coding --> QUEUE CAT -- TimelyFiling --> QUEUE CAT -- COB --> QUEUE CAT -- MedicalNecessity --> QUEUE QUEUE --> APPEAL APPEAL --> SUBMIT SUBMIT --> TRACK

The denial-triage-worker.ts job consumes denials from the ERA ingestion queue, runs them through the BERT-based classifier, populates Denial.DenialCategoryString50 and Denial.RootCauseString50, and routes to the appropriate work queue. The appeal-letter-generator.ts adapter generates appeal letters with regulatory citations when the billing manager initiates an appeal. The appeal-deadline-monitor.ts job tracks SLA deadlines and escalates via Task Management.

Versioning — worked example P0

All RCM artifacts are versioned break.feature.bug.buildtimestamp per IC hard rule #9. The example below traces a feature bump on Claim.

Claim 1.0.0.20260401T120000Z — Initial schema. 14 business fields plus four org-scoped audit columns. Component ic-ng21-rcm-1-charge-capture and ic-ng21-rcm-1-claim-submit bind to claim@1.0.0.* via the DI manifest.

Claim 1.1.0.20260715T093000Z — feature bump — Adds a single optional field, SecondaryPayerIDString, to support explicit secondary payer tracking on the claim header (previously derived from Eligibility COB data at runtime). Per the IC change matrix:

ChangeVersion impactApproval neededMin permission
Add optional field SecondaryPayerIDString50feature bump (1.0.0 → 1.1.0)NoWrite (50)

Because the change is backward-compatible, the component tag stays ic-ng21-rcm-1-charge-capture. Existing UI consumers continue to bind claim@1.x.* and ignore the new field. New UI surfaces that need explicit secondary payer display bind claim@^1.1.0. No new database is required (IC rule #13 only applies to break bumps).

Claim 2.0.0.20280101T120000Z — break bump (illustrative) — An illustrative future break bump: StatusString50 is replaced with a StatusInt enum-backed integer for faster index scans and type safety. Per the IC change matrix this is change field type — break bump, EditAMI (90) approval, and per IC rule #13 a new database is provisioned with ETL from the old one. The component tag becomes ic-ng21-rcm-2-charge-capture; consumers must re-bind. The old database stays live for the configured grace period (default 90 days) for rollback.

Illustrative. The 2.0.0 example is illustrative of the change matrix and IC rule #13; it is not a committed roadmap item.

RCM environment details

EnvClearinghouseInstaMedDenial AI
DevWaystar sandbox (test trading partners)InstaMed sandboxModel sandbox (mock predictions)
QAWaystar sandbox + Availity sandboxInstaMed sandboxModel QA (labeled test set)
UATWaystar staging (pre-prod payer connectivity)InstaMed stagingModel staging (production weights)
ProdWaystar prod + Availity prodInstaMed prodModel prod (live predictions)

RCM RBAC notes

Cross-Module Dependencies

See also: RCM walkthrough · IC Reference