Skip to content

ClaimReportingService

Implements IClaimReportingService, orchestrating the broken-provider-relationship report: for each enabled report option (worker representation, attending physician) it retrieves expired provider relationships via IClaimReportDataRetriever, resolves affected claims per relationship, builds ReportItem records, filters out inactive-claim noise, and — when requested — creates follow-up tasks via ITaskService, scheduled for the next working day per IWorkCalendarService.

Purpose

  • Runs the worker-representation and attending-physician broken-relationship report options independently based on flags in the incoming ReportRequest.
  • Aggregates report items per option, tracking total relationships processed, inactive relationships ignored, and total usable items found.
  • Optionally creates a claim task per report item (via ITaskService.CreateTaskStateless) describing the expired provider relationship, scheduled for today or the next working day, and records per-item task IDs/errors.
  • Tracks aggregate counts of tasks successfully created versus errored across both report options.

Context

  • Namespace: SAIF.Services.Claims.Reports
  • Assembly/package: SAIF.Services (packaged inside the SAIF.SAIFCode.Core NuGet package)

Public members

Member Signature Purpose
ClaimReportingService(retriever, providerInformationService, taskService, workCalendarService) public ClaimReportingService(IClaimReportDataRetriever retriever, IProviderInformationService providerInformationService, ITaskService taskService, IWorkCalendarService workCalendarService) Validates and stores the data retriever, provider-information service (currently unused beyond storage), task service, and work-calendar service.
GetBrokenProviderRelationshipDetails(request) public ReportResults GetBrokenProviderRelationshipDetails(ReportRequest request) Runs the worker-representation and/or attending-physician report options per the request flags, populating a ReportResults with per-option items/counts, then creates follow-up tasks if request.CreateTasks is set.

Behavioral notes

  • The injected IProviderInformationService field is marked with a code-analysis suppression for being unused (CA1823:AvoidUnusedPrivateFields), indicating it is currently retained but not exercised by any method body.
  • UpdateResults (private) recomputes InactiveRelationshipsIgnored and TotalUsageFound by filtering out non-active-claim items after report items are collected, so raw relationship counts and final "usable" counts are tracked separately.
  • Task creation dates default to today, advancing to the next working day via IWorkCalendarService.NextWorkDay when today is not a working day.
  • Task creation failures are caught per-item; the exception message is recorded on the ReportItem.TaskErrorMessage field rather than aborting the batch.

Constraints and usage notes

  • GetBrokenProviderRelationshipDetails assumes request is non-null (guarded only by a code-analysis suppression, not a runtime null check).
  • Task text generation assumes ParentProviderName/ParentProviderId are populated on each ReportItem, which only happens when the underlying claim was active with outstanding reserves at report-build time.*

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • Services/SAIF.Services/Claims/Reports/ClaimReportingService.cs