Skip to content

ProviderInformationService

Implements IProviderInformationService, resolving medical/service provider address, relationship, and MCO-plan information used by claims payment and correspondence workflows, including fallback logic across physical/payment/correspondence address types and parent/child provider location relationships. It depends only on IProviderQueryProvider for all underlying provider, address, and relationship data.

Purpose

  • Resolves a provider's internal ID from a tax ID, and lists provider locations that have been paid on a claim.
  • Builds selectable address lists for a provider location and its parent, combining physical, payment, and correspondence addresses with fallback ordering when a preferred type is unavailable.
  • Resolves a single best-available formatted address for a provider location (optionally relative to a parent location) for a requested address type, and specifically for subpoena service (requiring an Oregon address).
  • Lists a provider's MCO plans and its active working-relationship hierarchy (who it works for) relative to a parent location, and checks whether a parent/child provider relationship is currently active.

Context

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

Public members

Member Signature Purpose
ProviderInformationService(...) public ProviderInformationService(IProviderQueryProvider queryProvider) Validates queryProvider is non-null via Enforce.ArgumentNotNull and wires it in.
GetProviderIdByTin public long GetProviderIdByTin(string providerTin) Returns the internal provider ID for the given tax ID, resolving only active providers.
GetParentProviderAddresses public IEnumerable<ProviderSelection> GetParentProviderAddresses(long providerLocationId, bool includeExpired = false) Returns physical addresses for the location (falling back to payment addresses if none exist), each supplemented with its payment and correspondence address variants, ordered by location name.
GetProviderLocationAddresses public IEnumerable<ProviderSelection> GetProviderLocationAddresses(long locationId, bool includeExpired = false) Returns physical addresses for the location (falling back to a single payment address, then a correspondence address, if none exist), supplemented with payment/correspondence variants, ordered by location name.
GetPaidProviderLocations public IEnumerable<PaidProviderLocation> GetPaidProviderLocations(long claimId) Returns the provider locations that have received a bill/payment on the specified claim, with provider type and location details populated.
GetProviderAddress(providerLocationId, parentProviderLocationId, type) public ProviderAddress.ProviderAddress GetProviderAddress(long providerLocationId, long parentProviderLocationId, AddressTypes type = AddressTypes.Correspondence) If the provider has an active relationship to the parent, resolves the parent's most recent address of the requested type (falling back through the type hierarchy — correspondence→physical, payment→physical→correspondence, physical→correspondence) and returns it flagged as a parent address; otherwise delegates to the single-location overload.
GetProviderAddress(providerLocationId, type) public ProviderAddress.ProviderAddress GetProviderAddress(long providerLocationId, AddressTypes type = AddressTypes.Correspondence) Resolves the location's own most recent address of the requested type, applying the same type-fallback hierarchy, and returns an empty result if none exists.
GetProviderAddressForSubpoenas public ProviderAddress.ProviderAddress GetProviderAddressForSubpoenas(long? providerLocationId, long? registeredAgentLocationId) Resolves an Oregon address for service of a subpoena, preferring the registered agent location over the provider location and trying correspondence, then physical, then payment address types in turn; throws InvalidPaymentAddressException if no location ID is supplied or no Oregon address can be found.
GetMcoPlansForProvider public IList<string> GetMcoPlansForProvider(long providerLocationId) Returns the distinct short descriptions of MCO plans associated with the provider location.
GetWorkingProviderRelationshipsByParentLocation public IEnumerable<ProviderRelations> GetWorkingProviderRelationshipsByParentLocation(long providerLocationId, bool includeExpired = false) Returns the provider locations currently (or, if requested, historically) working for the given parent location, formatted with business or personal names, with the parent location itself (or the queried location, if no relationships exist) prepended as the first entry.
IsRelationshipValid public bool IsRelationshipValid(long providerLocationId, long parentProviderLocationId) Returns whether an active provider/parent-provider relationship currently exists between the two locations.

Behavioral notes

  • Address resolution consistently applies a fixed fallback order per requested AddressTypes value (e.g. correspondence falls back to physical; payment falls back to physical then correspondence; physical falls back to correspondence), so callers always get the "closest available" address type rather than an empty result when the preferred type is missing.
  • GetProviderAddressForSubpoenas enforces that the resolved address's State must be "OR", trying progressively different address types until an Oregon address is found or all options are exhausted, then throws InvalidPaymentAddressException if none qualifies.
  • GetWorkingProviderRelationshipsByParentLocation always inserts a synthetic first entry representing either the parent (when relationships exist) or the queried location itself (when none exist), so the returned list is never simply the raw relationship set.

Sources

  • Services/SAIF.Services/Providers/ProviderInformationService.cs