---
title: ClaimReportDataRetriever
summary: API reference for ClaimReportDataRetriever.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# ClaimReportDataRetriever

Implements `IClaimReportDataRetriever`, sourcing claims linked to a provider relationship and expired provider relationships from `IReportQueryProvider`, and assembling per-claim `ReportItem` records (status, provider names, adjuster contact) using an internal provider-name cache and `IClaimContactService.GetResponsibleAdjuster` for the responsible adjuster.

## Purpose
- Retrieves claim IDs associated with a provider location acting as legal representative or attending physician on active relationships.
- Retrieves provider relationships that expired on or after a given date and have no currently active relationship covering the same provider pair.
- Builds a `ReportItem` per claim/relationship, populating provider names via an internal cache to avoid redundant provider lookups, and only fully populating claim status/provider/adjuster details when the claim has outstanding reserves and is active.

## Context
- Namespace: `SAIF.Services.Claims.Reports`
- Assembly/package: `SAIF.Services` (packaged inside the `SAIF.SAIFCode.Core` NuGet package)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| ClaimReportDataRetriever(reportQueryProvider, contactService) | `public ClaimReportDataRetriever(IReportQueryProvider reportQueryProvider, IClaimContactService contactService)` | Validates and stores the report query provider and contact service used by all retrieval methods. |
| GetLegalRepClaimsWithProviderRelationship(providerLocationId, parentProviderLocationId) | `public IEnumerable<long> GetLegalRepClaimsWithProviderRelationship(long providerLocationId, long parentProviderLocationId)` | Returns claim IDs where the provider/parent pair is the legal representative, via `IReportQueryProvider.GetLegalRepClaimsWithRelationship`. |
| GetAttendingPhysicianClaimsWithProviderRelationship(providerLocationId, parentProviderLocationId) | `public IEnumerable<long> GetAttendingPhysicianClaimsWithProviderRelationship(long providerLocationId, long parentProviderLocationId)` | Returns claim IDs where the provider/parent pair is the attending physician, via `IReportQueryProvider.GetAttendingClaimsWithRelationship`. |
| GetBenefitPaymentClaimsWithProviderRelationship(providerLocationId, parentProviderLocationId) | `public IEnumerable<long> GetBenefitPaymentClaimsWithProviderRelationship(long providerLocationId, long parentProviderLocationId)` | Not implemented; always throws `NotImplementedException`. |
| GetExpiredRelationships(effectiveDate) | `public IEnumerable<ProviderRelationship> GetExpiredRelationships(DateTime effectiveDate)` | Returns provider relationships expiring on/after `effectiveDate` that have no currently active relationship for the same provider/parent pair. |
| GetReportDetails(claimId, relationship) | `public ReportItem GetReportDetails(long claimId, ProviderRelationship relationship)` | Builds a `ReportItem` with claim number, check character, and relationship expiration date always populated; when the claim has outstanding reserves and is active, additionally populates provider IDs/names (via the internal provider-name cache), claim status description, and responsible adjuster mail ID/name. |

## Behavioral notes
- `GetBenefitPaymentClaimsWithProviderRelationship` is a stub that always throws `NotImplementedException`, despite being declared on the interface and implemented by this class.
- Provider names are cached in an instance-level dictionary (`_providers`) keyed by provider location ID, populated lazily the first time each ID is encountered via the private `AddProvider` method.
- `GetReportDetails` only populates the extended fields (`ActiveClaim`, provider names, claim status, adjuster) when `claim.HasOutstandingReserves && claim.IsActive`; otherwise the returned `ReportItem` has only the always-populated basic fields.

## Constraints and usage notes
- Callers must not invoke `GetBenefitPaymentClaimsWithProviderRelationship` in production paths, as it is unimplemented and will throw.
- The internal provider-name cache is per-instance and not thread-safe for concurrent population of the same uncached provider ID.*

> **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/ClaimReportDataRetriever.cs
