---
title: Provider ineligibility period retrieval
summary: Retrieves a single provider ineligibility period by ID, or the full ineligibility-period history for a provider location, used to determine whether a location was ineligible on a given date.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Business.View.Provider
reference_type: package
operation_id: OP-VP-05
trigger: Caller calls clsProviderIneligibilityPeriod.GetProviderIneligibilityPeriod(dpi, ineligibilityPeriodID), or reads clsProviderLocation.IneligibilityPeriods / calls clsProviderIneligibilityPeriodCollection.GetProviderIneligibilityPeriodCollection(dpi, providerLocationID) directly
---

# Provider ineligibility period retrieval

Provider ineligibility period retrieval reads `PROVIDER_INELIG_PERIOD` rows, either a single period by its identifier or the full set of periods for a provider location. Each period carries a start date, an optional termination date (open-ended when unset, mapped to `Date.MaxValue` at read time), and a reason code; the collection is the basis for eligibility-window checks used elsewhere in this library.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-VP-05 |
| **Trigger** | `clsProviderIneligibilityPeriod.GetProviderIneligibilityPeriod(inDataportal, inIneligibilityPeriodID)`; `clsProviderIneligibilityPeriodCollection.GetProviderIneligibilityPeriodCollection(inDataportal, inProviderLocationID)` — invoked directly or via `clsProviderLocation.IneligibilityPeriods` |
| **Inputs** | Ineligibility period ID (Decimal); or provider location ID (Decimal) |
| **Outputs** | A populated `clsProviderIneligibilityPeriod` or `clsProviderIneligibilityPeriodCollection` |
| **Primary components** | `clsProviderIneligibilityPeriod.GetProviderIneligibilityPeriod`, `clsProviderIneligibilityPeriod.Load`, `clsProviderIneligibilityPeriodCollection.GetProviderIneligibilityPeriodCollection` |
| **Entry point** | `Business\SAIF.Business.View.Provider\clsProviderIneligibilityPeriod.vb` |

## Steps

1. **Request a single period.** `GetProviderIneligibilityPeriod` builds a criteria carrying the ineligibility period ID and retrieves through the standard data-portal path.
2. **Bind the single-period parameter.** `BeforeRetrieve` binds `:IneligibilityPeriodID` and executes the retrieve SQL against `PROVIDER_INELIG_PERIOD` ([SQL-008](../sql/SQL-008-saif-business-view-provider.md), [PROVIDER_INELIG_PERIOD](../database-tables.md#provider_inelig_period)).
3. **Read the single row.** `AfterRetrieve` reads at most one row, fills the object (start date, reason code, provider location ID, termination date, update info), and marks it old only when a row was found.
4. **Request the period history for a location.** `GetProviderIneligibilityPeriodCollection` builds a criteria carrying the provider location ID.
5. **Bind the collection parameter.** `BeforeRetrieve` binds `:ProviderLocationID` and caches it on the collection instance, then executes the collection retrieve SQL against `PROVIDER_INELIG_PERIOD` ([SQL-009](../sql/SQL-009-saif-business-view-provider.md), [PROVIDER_INELIG_PERIOD](../database-tables.md#provider_inelig_period)).
6. **Populate the collection.** `AfterRetrieve` iterates the result set, constructs a `clsProviderIneligibilityPeriod` per row, calls `Load`, and adds each to the collection.
7. **Normalize an open-ended termination date.** Reading `TerminationDate` on a period whose underlying value is unset returns `Date.MaxValue` rather than a null or default date, so a period with no explicit end is treated as still in effect indefinitely.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Ineligibility period requested]) --> Which{Single or collection?}
	Which -->|Single, by ID| Single[Bind IneligibilityPeriodID parameter]
	Which -->|Collection, by location| Coll[Bind ProviderLocationID parameter]
	Single --> Exec1[Execute retrieve query]
	Exec1 --> Row{Row found?}
	Row -->|Yes| Fill1[Fill period; MarkOld]
	Row -->|No| Empty1([Object left in default state])
	Coll --> Exec2[Execute retrieve query]
	Exec2 --> Loop[For each row: create period,<br>Load, add to collection]
	Loop --> Done([Populated collection returned])
	Fill1 --> Read[TerminationDate read]
	Done --> Read
	Read --> Norm{Termination date set?}
	Norm -->|No| Max([Return Date.MaxValue])
	Norm -->|Yes| Actual([Return stored date])
```

## Failure and edge-case behavior

- A single-period lookup that matches no row leaves the object in its default (empty) state with no exception raised, consistent with other retrieval operations in this library.
- A location with no ineligibility-period history returns an empty collection, which callers elsewhere in this library treat as "never ineligible" when testing a date against the collection.
- This class re-retrieves the collection on every call to `clsProviderLocation.IneligibilityPeriods` (it is not cached on the location, unlike most of that location's other lazy-load properties), so repeated eligibility checks against the same location each issue a fresh query.*

## Related documentation

- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts.

## Sources

- `Business\SAIF.Business.View.Provider\clsProviderIneligibilityPeriod.vb`
- `Business\SAIF.Business.View.Provider\clsProviderIneligibilityPeriodCollection.vb`
