Skip to content

EobGenerator

EobGenerator builds the ExplanationOfBenefits contract for a single bill by combining the Bill, its Audit, and the associated Claim/worker/adjuster data: it populates the bill header (claim number, worker and adjuster names, status, service dates, payment issue date), then — when the bill has an audit — fills in charge/adjustment/paid totals, the audited service lines with their per-service adjustments, and the EOB notes. Bill.GenrateEob() calls this class as the concrete implementation behind OP-DOM-13's GenrateEob behaviour, and its output feeds EobExtensions.ToEobXml for rendering. The file physically lives at Claims/Bills/EobGenerator.cs but declares the SAIF.Domain.Model.Claims.Bills.Audits namespace — a folder/namespace mismatch noted in the Stage 1 analysis rather than a documentation error*.

Purpose

  • Assembles a single bill's ExplanationOfBenefits contract from Bill, Audit, and provider data, implementing the EOB-construction step of Bill.GenrateEob (OP-DOM-13).
  • Only populates audit-derived totals, service detail, and notes when the bill actually has an audit (Audit.HasData); a bill with no audit yields a header-only EOB.
  • Sets PaymentIssueDate and TotalPaidAmount only once the bill's status is completed, keeping in-progress bills from showing a premature payment date.

Context

  • Namespace: SAIF.Domain.Model.Claims.Bills.Audits
  • Assembly/package: SAIF.Domain (packaged in SAIF.SAIFCode.Core)

Public members

Member Signature Purpose
GenerateEob public static ExplanationOfBenefits GenerateEob(Bill bill) Builds and returns the complete ExplanationOfBenefits contract for bill, populating header fields from the bill/claim/worker/adjuster, and audit totals, service lines, and notes when the bill's audit has data.

Behavioral notes

  • Provider display name prefers the currently effective tax-ID registered name over the billing provider's raw business name when one is on file for today's date*.
  • Service-level MCO administration fee is negated to a positive display value only when it was originally positive, matching the audit's stored sign convention*.
  • Notes are added in ascending Id order so the EOB note list preserves the order notes were originally recorded.

Constraints and usage notes

  • Requires bill.Claim to be non-null for header fields such as SaifClaimNumber and WorkerName; callers (Bill.GenrateEob) already guard against a missing claim before invoking this class (DOM-BR-134).

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

Sources

  • Domain/SAIF.Domain/Claims/Bills/EobGenerator.cs