---
title: MedicareQueryProvider
summary: API reference for MedicareQueryProvider.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# MedicareQueryProvider

Query provider exposing 5 data-access operation(s) (`FindMedicareHistoryMatch`, `GetBeneficiaries`, `GetCountforBatchOfMedicareBeneficiary`, `GetCountforBatchOfMedicareHistory`, `GetNextMinumumSubmissionBatch`) against 3 distinct table(s); see [sql/index.md](../../sql/index.md) for the full ORM operation catalog.

## Purpose
- Provides read/write access to 3 table(s) via NHibernate `IQueryable<T>`/`GetRepository<T>()` calls documented in [sql/index.md](../../sql/index.md).
- Exposes 5 public query/command method(s) consumed by higher application layers; see [database-tables.md](../../database-tables.md) for the underlying schema.

## Context
- Namespace: `SAIF.Data.Queries.Claims`
- Assembly/package: `SAIF.Data`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetNextMinumumSubmissionBatch | `MedicareBeneficiaryQueryBatch GetNextMinumumSubmissionBatch()` | Executes an ORM query ([SQL-176](../../sql/SQL-176-medicare-query-provider-get-next-minumum-submission-batch.md)) against [MEDICARE_BENEFICIARY_QUERY_BAT](../../database-tables.md#medicare_beneficiary_query_bat). |
| FindMedicareHistoryMatch | `MedicareQueryHistory FindMedicareHistoryMatch(MedicareBeneficiaryQuery medicareBeneficiary)` | Executes an ORM query ([SQL-177](../../sql/SQL-177-medicare-query-provider-find-medicare-history-match.md)) against [MEDICARE_QUERY_HISTORY](../../database-tables.md#medicare_query_history). |
| GetCountforBatchOfMedicareBeneficiary | `int GetCountforBatchOfMedicareBeneficiary(DateTime submissionDate)` | Executes an ORM query ([SQL-178](../../sql/SQL-178-medicare-query-provider-get-countfor-batch-of-medicare-beneficiary.md)) against [MEDICARE_BENEFICIARY_QUERY](../../database-tables.md#medicare_beneficiary_query). |
| GetCountforBatchOfMedicareHistory | `int GetCountforBatchOfMedicareHistory(DateTime submissionDate)` | Executes an ORM query ([SQL-179](../../sql/SQL-179-medicare-query-provider-get-countfor-batch-of-medicare-history.md)) against [MEDICARE_QUERY_HISTORY](../../database-tables.md#medicare_query_history). |
| GetBeneficiaries | `IEnumerable<MedicareBeneficiaryQuery> GetBeneficiaries(DateTime submissionDateTime)` | Executes an ORM query ([SQL-180](../../sql/SQL-180-medicare-query-provider-get-beneficiaries.md)) against [MEDICARE_BENEFICIARY_QUERY](../../database-tables.md#medicare_beneficiary_query). |
| MedicareQueryProvider(IRepositoryFactory factory) | `MedicareQueryProvider(IRepositoryFactory factory)` | Initializes a new instance, wiring the repository factory used by this provider's query methods.* |

## Behavioral notes
- Query methods build LINQ expressions over `IQueryable<T>` obtained via `Factory.GetRepository<T>()` and execute them against the underlying NHibernate session.*

## Constraints and usage notes
- Instances are constructed with an `IRepositoryFactory` and are expected to be resolved through dependency injection rather than instantiated directly.*

> **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
- `Data/SAIF.Data/Queries/Claims/MedicareQueryProvider.cs`
