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

# ProviderIndexerV2

`ProviderIndexerV2` is the current (v2) implementation of `IProviderIndexer` for operation OP-DOM-04: after resolving the provider by tax ID, it excludes correspondence and expired addresses, applies the institutional filter, builds four address candidate lists (all, filtered by facility name, filtered by provider type, filtered by both), selects an ordered `IProviderMatchRule` set based on which address roles the biller has, and asks a `ProviderMatcher` for the first unique match — retrying with two-line address concatenation if the first pass finds none. It supersedes the simpler `ProviderIndexer` (v1) algorithm.

## Purpose
- Requires the billing provider's tax ID to resolve to a known SAIF provider, recording "Provider Tax Id not found" otherwise, matching v1's requirement ([DOM-BR-020](../../business-rules.md#dom-br-020-provider-indexing)).
- Excludes correspondence-type and expired provider addresses before matching, then applies the same institutional (`NU`/`HO`/`HH`) filter as v1 when the bill is institutional ([DOM-BR-021](../../business-rules.md#dom-br-021-provider-indexing), [DOM-BR-026](../../business-rules.md#dom-br-026-v2-indexing)).
- Further filters candidate addresses by provider type — Pharmacy `PH`, Dental `DE`, Hospital `HO`/`NU`/`HH`, Professional everything else — to build the facility-name/provider-type-filtered candidate lists ([DOM-BR-027](../../business-rules.md#dom-br-027-v2-indexing)).
- Chooses the applicable `IProviderMatchRule` ordering: billers with physical, payment, and facility addresses get the PaymentAndFacility/ThreeAddressNoFacilityMatches rule chain; others get the PaymentAndFacility/PhysicalAndPayment/PhysicalAndFacility/PhysicalOnly/PhysicalOnlyMatchPhysicalWithPayment chain ([DOM-BR-028](../../business-rules.md#dom-br-028-v2-indexing)).
- Retries the match with the biller's Line1+Line2 addresses concatenated when the first pass finds no unique match and any address has a Line2, and records "Provider location match not found" when neither pass succeeds ([DOM-BR-029](../../business-rules.md#dom-br-029-matching), [DOM-BR-029a](../../business-rules.md#dom-br-029a-matching)).

## Context
- Namespace: `SAIF.Domain.Claims.Ebilling.Indexing`
- Assembly/package: `SAIF.Domain` (`Domain/SAIF.Domain/SAIF.Domain.csproj`, .NET Framework 4.6.2 class library)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| IndexProvidersToLocation | `public ResultCount IndexProvidersToLocation(long batchId, IEbillingQueryProvider queryProvider, IErrorConditionHandler errorConditionHandler, string updateUser)` | Indexes every non-indexed e-billing provider in the batch using the v2 rule-set matcher, tallying successes/failures into a `ResultCount` and rethrowing any per-provider exception with the provider id attached. |

## Behavioral notes
- The private `IndexProviderToLocation` builds the candidate rule set through `GenerateMatchRuleset` and hands it to a fresh `ProviderMatcher`, retrying once with `concatenateTwoLineBillAddresses = true` before giving up and recording "Provider location match not found" ([DOM-BR-029a](../../business-rules.md#dom-br-029a-matching)).
- Provider-type detection (`GetProviderType`) derives the type from the first e-bill patient/bill pair matching the provider, so a provider linked to multiple patients with different bill set types uses only that first match's type**.
- Only public surface is exposed through `IProviderIndexer`; all rule-set construction, address filtering, and location-assignment helpers are private implementation details of this class*.

> **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
- `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexerV2.cs`
