Skip to content

AuditedService

AuditedService wraps a single CbpAuditedService line from an Audit and resolves the presentation-ready data an EOB and bill audit screen need for that service: the paid amount after MCO withhold, whether the line is a pharmacy service, and the service or NDC code description resolved through ServiceCode/ServiceCodeManager lookups (OP-DOM-08). Audit.Services is the only in-library constructor of this type, and EobGenerator consumes its AuditedServiceContract and Adjustments when building a bill's explanation of benefits.

Purpose

  • Resolves the correct service code and description for a service line: the national drug code and its generic name for pharmacy services, or the standard service code lookup otherwise.
  • Computes the paid amount for a single service (allowed amount minus its MCO administration fee) for use in EOB and audit displays.
  • Maps a CbpAuditedService entity to the Core.Contracts.Claims.Bills.AuditedService contract used by callers outside the domain wrapper layer, via a static AutoMapper configuration registered on first use.

Context

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

Public members

Member Signature Purpose
AuditedService (constructor) public AuditedService(IAuditQueryProvider provider, CbpAuditedService service) Wraps service with the query provider needed to resolve service-code descriptions and national drug codes; registers the CbpAuditedService → AuditedService AutoMapper map on first use of the type via its static constructor.
Data public CbpAuditedService Data { get; } Exposes the underlying CbpAuditedService entity.
PaidAmount public decimal PaidAmount { get; } The amount paid on this service line: allowed amount minus its MCO administration fee; 0 when the service has no data.
IsPharmacyService public bool IsPharmacyService { get; } Indicates the service's bill-service type code is "P" (pharmacy), which changes how ServiceCode/ServiceDescription are resolved.
AuditedServiceContract public Core.Contracts.Claims.Bills.AuditedService AuditedServiceContract { get; } Maps this service to the Core.Contracts.Claims.Bills.AuditedService contract, substituting the national drug code and its generic name for pharmacy services or the standard service code/description otherwise.
ServiceDescription public string ServiceDescription { get; } The description of the bill service code, resolved through ServiceCode for the service's date of service; empty when the service has no bill service code.
SecondaryServiceDescription public string SecondaryServiceDescription { get; } The description of the service's secondary service code, resolved the same way as ServiceDescription; empty when there is no secondary code.
McoWithholdAmount public decimal McoWithholdAmount { get; } The service's MCO administration fee, negated for display as a withheld amount.
Adjustments public IEnumerable<CbpAuditedServiceAdjustment> Adjustments { get; } The raw adjustment rows recorded against this service, as read from the underlying entity.

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 CbpAuditedService entity is present, evaluated as !DataItem.IsNull(). SAIF.Domain — DomainBase<TItem>

Behavioral notes

  • AuditedServiceContract returns a blank Core.Contracts.Claims.Bills.AuditedService (rather than null) when the wrapped service has no data, so callers can bind to the contract without a null check.
  • Description lookups (ServiceDescription, SecondaryServiceDescription) go through ServiceCode, which itself resolves a date-scoped CbpServiceDescription for the service's service date (OP-DOM-08).

Constraints and usage notes

  • The static constructor's BillMappingHelper.MapAuditedService() call configures shared AutoMapper maps process-wide; constructing the first AuditedService in a process has this side effect*.

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/AuditedService.cs
  • Domain/SAIF.Domain/Model/Claims/Bills/BillMappingHelper.cs
  • Domain/SAIF.Domain/DomainBase.cs
  • Domain/SAIF.Domain/DomainQueryBase.cs