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

# ProviderMatcher

`ProviderMatcher` implements `IProviderMatcher` by evaluating an ordered list of `IProviderMatchRule` implementations and returning the first one that produces a unique match, implementing the rule-precedence part of operation OP-DOM-04's address matching ([DOM-BR-029](../../business-rules.md#dom-br-029-matching)). Its default constructor builds a fixed four-rule fallback chain (`PhysicalPaymentAndFacilityMatchRule`, `PhysicalAndPaymentMatchRule`, `PhysicalAndFacilityMatchRule`, `PhysicalOnlyMatchRule`); `ProviderIndexerV2` instead supplies its own larger rule set (per [DOM-BR-028](../../business-rules.md#dom-br-028-v2-indexing)) through the second constructor.

## Purpose
- Evaluates a set of `IProviderMatchRule` instances in order and stops at the first one that returns a non-null unique `ProviderLocation`, implementing the "first unique rule match wins" precedence rule ([DOM-BR-029](../../business-rules.md#dom-br-029-matching)).
- Provides a convenience constructor that builds the default four-rule fallback chain directly from e-bill and provider addresses, for callers that do not need `ProviderIndexerV2`'s larger, filtered rule set.

## 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 |
| --- | --- | --- |
| ProviderMatcher (constructor) | `public ProviderMatcher(IEnumerable<EbillAddress> ebillAddresses, IEnumerable<ProviderAddress> providerAddresses)` | Builds the default rule chain — `PhysicalPaymentAndFacilityMatchRule`, `PhysicalAndPaymentMatchRule`, `PhysicalAndFacilityMatchRule`, `PhysicalOnlyMatchRule`, in that order — from the given e-bill and provider addresses. |
| ProviderMatcher (constructor) | `public ProviderMatcher(IEnumerable<IProviderMatchRule> providerMatchRules)` | Builds the matcher from a caller-supplied, already-ordered rule set, letting `ProviderIndexerV2` provide its own filtered/expanded rule chain ([DOM-BR-028](../../business-rules.md#dom-br-028-v2-indexing)). |
| UniqueProviderLocationMatch | `public ProviderLocation UniqueProviderLocationMatch(bool concatenateTwoLineBillAddresses)` | Evaluates the configured rules in order and returns the first rule's non-null unique match, or `null` if none of the rules match uniquely ([DOM-BR-029](../../business-rules.md#dom-br-029-matching)). |

## Behavioral notes
- Rule evaluation stops at the first non-null match, so rule ordering directly determines which candidate location wins when more than one rule could otherwise match*.

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