Audit¶
Audit wraps a bill's CbpAudit entity and implements the audit-adjustment behaviour of OP-DOM-14: disallowing or allowing every audited service on a bill, and computing the running charge/allowed/paid/MCO-withhold totals that drive the bill's EOB and payment amounts. Bill.Audit is the sole in-library entry point that constructs an Audit, and EobGenerator reads its totals and Services collection when assembling a bill's explanation of benefits.
Purpose¶
- Applies bulk disallow/allow decisions across every audited service on a bill, adjusting each service's allowed and MCO-fee amounts and recording the adjustment history (DOM-BR-140, DOM-BR-141).
- Computes the audit-level totals — adjustment, paid, and MCO-withhold amounts — that other domain types (
Bill,EobGenerator) read to present bill financials (DOM-BR-142). - Exposes the audited services as
AuditedServicedomain wrappers rather than rawCbpAuditedServiceentities, so callers get the same behaviour-rich API as any other domain type.
Context¶
- Namespace:
SAIF.Domain.Model.Claims.Bills.Audits - Assembly/package:
SAIF.Domain(packaged inSAIF.SAIFCode.Core)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| Empty | public static Audit Empty() |
Returns an Audit instance with no backing data, used by Bill.Audit when a bill has no audit record yet (HasData is false). |
| Data | public CbpAudit Data { get; } |
Exposes the underlying CbpAudit entity for callers that need direct entity access. |
| TotalAdjustementAmount | public decimal TotalAdjustementAmount { get; } |
The aggregate adjustment amount, computed as -(charged - allowed) (DOM-BR-142). |
| TotalPaidAmount | public decimal TotalPaidAmount { get; } |
The amount actually paid on the bill: allowed amount minus the MCO administration fee (DOM-BR-142). |
| TotalMcoWithholdAmount | public decimal TotalMcoWithholdAmount { get; } |
The MCO administration fee total, negated for display as a withheld amount. |
| Services | public IEnumerable<AuditedService> Services { get; } |
The bill's audited services, ordered by Id and wrapped as AuditedService domain objects; returns an empty sequence when the audit has no data. |
| DisallowAllServices | public bool DisallowAllServices(string reasonId, string userId) |
Zeroes every service's allowed and MCO-fee amounts, records a disallowance adjustment per service using reasonId, and zeroes the audit-level totals (DOM-BR-140); returns false when the audit has no data. |
| AllowAllServices | public bool AllowAllServices(string userId) |
Reverses DB/MD/TC adjustments for every service whose original bill code is not "D", recomputes each service's MCO fee (rounded away from zero), and recalculates the audit-level allowed and MCO-fee totals (DOM-BR-141); returns false when the audit has no data. |
Inherited public members¶
Members in this section are inherited from DomainBase<TItem> in SAIF.Domain. They are available on this type through inheritance (via the intermediate DomainQueryBase<TItem,TQueryProvider> base).
| Member | Signature | Purpose | Origin |
|---|---|---|---|
| HasData | public virtual bool HasData { get; } |
Reports whether the wrapped CbpAudit entity is present, evaluated as !DataItem.IsNull(). |
SAIF.Domain — DomainBase<TItem> |
Behavioral notes¶
DisallowAllServicesonly adjusts services whoseAllowedAmountis currently greater than zero, so already-zeroed services are left untouched*.AllowAllServicesskips services whoseOriginalBillCode.Codeis"D"(dental), meaning dental service adjustments are never reversed by this method.
Constraints and usage notes¶
DisallowAllServicesandAllowAllServicesboth returnfalseimmediately whenHasDataisfalse, so callers should check the return value rather than assuming success.
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/Model/Claims/Bills/Audits/Audit.csDomain/SAIF.Domain/DomainBase.csDomain/SAIF.Domain/DomainQueryBase.cs