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

# EbillQueryProvider

Query provider exposing 24 data-access operation(s) (`GetBill`, `GetBillAssignmentRule`, `GetBillByClearinghouseAndControlNumber`, `GetBillCountByClearinghouseControlNumber`, `GetBillSetTypeCode`, `GetBillSetTypeCodeByCode` and 18 more) against 15 distinct table(s); see [sql/index.md](../../sql/index.md) for the full ORM operation catalog.

## Purpose
- Provides read/write access to 15 table(s) via NHibernate `IQueryable<T>`/`GetRepository<T>()` calls documented in [sql/index.md](../../sql/index.md).
- Exposes 24 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.Ebilling`
- Assembly/package: `SAIF.Data`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetBill | `Ebill GetBill(long billId)` | Executes an ORM query ([SQL-114](../../sql/SQL-114-ebill-query-provider-get-bill.md)) against [EBILL](../../database-tables.md#ebill). |
| GetBillByClearinghouseAndControlNumber | `Ebill GetBillByClearinghouseAndControlNumber(string clearinghouseControlNumber, EbillClearinghouse clearinghouse)` | Executes an ORM query ([SQL-115](../../sql/SQL-115-ebill-query-provider-get-bill-by-clearinghouse-and-control-number.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_CLEARINGHOUSE](../../database-tables.md#ebill_clearinghouse). |
| GetBillCountByClearinghouseControlNumber | `int GetBillCountByClearinghouseControlNumber(string clearinghouseControlNumber)` | Executes an ORM query ([SQL-116](../../sql/SQL-116-ebill-query-provider-get-bill-count-by-clearinghouse-control-number.md)) against [EBILL](../../database-tables.md#ebill). |
| GetBillsForResponseFileForClearinghouse | `IEnumerable<Ebill> GetBillsForResponseFileForClearinghouse(EbillClearinghouse clearinghouse)` | Executes an ORM query ([SQL-117](../../sql/SQL-117-ebill-query-provider-get-bills-for-response-file-for-clearinghouse.md)) against [EBILL](../../database-tables.md#ebill), [CBP_BILL](../../database-tables.md#cbp_bill), [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_CLEARINGHOUSE](../../database-tables.md#ebill_clearinghouse), [CBP_BILL_STATUS_CODE](../../database-tables.md#cbp_bill_status_code). |
| GetBillsByBatch | `IEnumerable<Ebill> GetBillsByBatch(long batchId)` | Executes an ORM query ([SQL-118](../../sql/SQL-118-ebill-query-provider-get-bills-by-batch.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_BATCH](../../database-tables.md#ebill_batch). |
| GetBillsByEob | `IEnumerable<Ebill> GetBillsByEob(long eobId)` | Executes an ORM query ([SQL-119](../../sql/SQL-119-ebill-query-provider-get-bills-by-eob.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_EOB](../../database-tables.md#ebill_eob). |
| GetBillsByReceivedMonth | `IEnumerable<Ebill> GetBillsByReceivedMonth(DateTime startDate, DateTime endDate)` | Executes an ORM query ([SQL-120](../../sql/SQL-120-ebill-query-provider-get-bills-by-received-month.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_BATCH](../../database-tables.md#ebill_batch). |
| GetEbillResponseSet | `EbillResponseSet GetEbillResponseSet(int responseSetSequenceNumber)` | Executes an ORM query ([SQL-121](../../sql/SQL-121-ebill-query-provider-get-ebill-response-set.md)) against [EBILL_RESPONSE_SET](../../database-tables.md#ebill_response_set). |
| GetEbillSum | `decimal GetEbillSum(IEnumerable<Ebill> groupBills)` | Retrieves ebill sum.* |
| GetNonIndexedBills | `IEnumerable<Ebill> GetNonIndexedBills(long batchId)` | Executes an ORM query ([SQL-122](../../sql/SQL-122-ebill-query-provider-get-non-indexed-bills.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_PATIENT](../../database-tables.md#ebill_patient), [EBILL_PROVIDER](../../database-tables.md#ebill_provider), [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_STATUS_CODE](../../database-tables.md#ebill_status_code). |
| GetNonAssignedBills | `IEnumerable<Ebill> GetNonAssignedBills(long batchId)` | Executes an ORM query ([SQL-123](../../sql/SQL-123-ebill-query-provider-get-non-assigned-bills.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_PATIENT](../../database-tables.md#ebill_patient), [EBILL_PROVIDER](../../database-tables.md#ebill_provider), [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_STATUS_CODE](../../database-tables.md#ebill_status_code). |
| GetNonImagedBills | `IEnumerable<Ebill> GetNonImagedBills(long batchId)` | Executes an ORM query ([SQL-124](../../sql/SQL-124-ebill-query-provider-get-non-imaged-bills.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_STATUS_CODE](../../database-tables.md#ebill_status_code). |
| GetIndexedBills | `IEnumerable<long> GetIndexedBills(long batchId)` | Executes an ORM query ([SQL-125](../../sql/SQL-125-ebill-query-provider-get-indexed-bills.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_PATIENT](../../database-tables.md#ebill_patient), [EBILL_PROVIDER](../../database-tables.md#ebill_provider), [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_STATUS_CODE](../../database-tables.md#ebill_status_code). |
| GetImagedBills | `IEnumerable<long> GetImagedBills(long batchId)` | Executes an ORM query ([SQL-126](../../sql/SQL-126-ebill-query-provider-get-imaged-bills.md)) against [EBILL](../../database-tables.md#ebill), [EBILL_PATIENT](../../database-tables.md#ebill_patient), [EBILL_PROVIDER](../../database-tables.md#ebill_provider), [EBILL_BATCH](../../database-tables.md#ebill_batch), [EBILL_STATUS_CODE](../../database-tables.md#ebill_status_code). |
| GetEbill | `Ebill GetEbill(long batchId)` | Executes an ORM query ([SQL-127](../../sql/SQL-127-ebill-query-provider-get-ebill.md)) against [EBILL](../../database-tables.md#ebill). |
| GetBillStatusCode | `EbillStatusCode GetBillStatusCode(string billStatusCode)` | Executes an ORM query ([SQL-128](../../sql/SQL-128-ebill-query-provider-get-bill-status-code.md)) against [EBILL_STATUS_CODE](../../database-tables.md#ebill_status_code). |
| GetBillStatusAccepted | `EbillStatusCode GetBillStatusAccepted()` | Retrieves bill status accepted.* |
| GetBillStatusAssigned | `EbillStatusCode GetBillStatusAssigned()` | Retrieves bill status assigned.* |
| GetBillStatusCompleted | `EbillStatusCode GetBillStatusCompleted()` | Retrieves bill status completed.* |
| GetBillStatusDocumentLoad | `EbillStatusCode GetBillStatusDocumentLoad()` | Retrieves bill status document load.* |
| GetBillStatuseEobDistributed | `EbillStatusCode GetBillStatuseEobDistributed()` | Retrieves bill statuse eob distributed.* |
| GetBillStatuseEobRejected | `EbillStatusCode GetBillStatuseEobRejected()` | Retrieves bill statuse eob rejected.* |
| GetBillStatusImaged | `EbillStatusCode GetBillStatusImaged()` | Retrieves bill status imaged.* |
| GetBillStatusIndexed | `EbillStatusCode GetBillStatusIndexed()` | Retrieves bill status indexed.* |
| GetBillStatusNew | `EbillStatusCode GetBillStatusNew()` | Retrieves bill status new.* |
| GetBillStatusPended | `EbillStatusCode GetBillStatusPended()` | Retrieves bill status pended.* |
| GetBillStatusRejected | `EbillStatusCode GetBillStatusRejected()` | Retrieves bill status rejected.* |
| GetBillStatusCbpSetup | `EbillStatusCode GetBillStatusCbpSetup()` | Retrieves bill status cbp setup.* |
| GetBillStatusExtracted | `EbillStatusCode GetBillStatusExtracted()` | Retrieves bill status extracted.* |
| GetPendedProviderErrors | `IEnumerable<EbillErrorCondition> GetPendedProviderErrors(long providerId)` | Executes an ORM query ([SQL-129](../../sql/SQL-129-ebill-query-provider-get-pended-provider-errors.md)) against [EBILL_ERROR_CONDITION](../../database-tables.md#ebill_error_condition), [EBILL_PROVIDER](../../database-tables.md#ebill_provider). |
| GetPendedPatientErrors | `IEnumerable<EbillErrorCondition> GetPendedPatientErrors(long patientId)` | Executes an ORM query ([SQL-130](../../sql/SQL-130-ebill-query-provider-get-pended-patient-errors.md)) against [EBILL_ERROR_CONDITION](../../database-tables.md#ebill_error_condition), [EBILL_PATIENT](../../database-tables.md#ebill_patient). |
| GetPendedBillErrors | `IEnumerable<EbillErrorCondition> GetPendedBillErrors(long billId)` | Executes an ORM query ([SQL-131](../../sql/SQL-131-ebill-query-provider-get-pended-bill-errors.md)) against [EBILL_ERROR_CONDITION](../../database-tables.md#ebill_error_condition), [EBILL](../../database-tables.md#ebill). |
| GetPendedErrors | `IEnumerable<EbillErrorCondition> GetPendedErrors(Ebill bill)` | Executes an ORM query ([SQL-132](../../sql/SQL-132-ebill-query-provider-get-pended-errors.md)) against [EBILL_ERROR_CONDITION](../../database-tables.md#ebill_error_condition), [EBILL_PROVIDER](../../database-tables.md#ebill_provider), [EBILL_PATIENT](../../database-tables.md#ebill_patient), [EBILL](../../database-tables.md#ebill). |
| GetBillAssignmentRule | `EbillAssignmentRule GetBillAssignmentRule(string ruleCode)` | Executes an ORM query ([SQL-133](../../sql/SQL-133-ebill-query-provider-get-bill-assignment-rule.md)) against [EBILL_ASSIGNMENT_RULE](../../database-tables.md#ebill_assignment_rule). |
| GetConfidentialBillAssignment | `EbillAssignmentRule GetConfidentialBillAssignment()` | Retrieves confidential bill assignment.* |
| GetProviderErrorBillAssignment | `EbillAssignmentRule GetProviderErrorBillAssignment()` | Retrieves provider error bill assignment.* |
| GetClaimErrorBillAssignment | `EbillAssignmentRule GetClaimErrorBillAssignment()` | Retrieves claim error bill assignment.* |
| GetCleanBillAssignment | `EbillAssignmentRule GetCleanBillAssignment()` | Retrieves clean bill assignment.* |
| GetBillSetTypeCode | `EbillSetTypeCode GetBillSetTypeCode(string manualVersionNumber)` | Executes an ORM query ([SQL-134](../../sql/SQL-134-ebill-query-provider-get-bill-set-type-code.md)) against [EBILL_SET_TYPE_CODE](../../database-tables.md#ebill_set_type_code). |
| GetBillSetTypeCodeByCode | `EbillSetTypeCode GetBillSetTypeCodeByCode(string code)` | Executes an ORM query ([SQL-135](../../sql/SQL-135-ebill-query-provider-get-bill-set-type-code-by-code.md)) against [EBILL_SET_TYPE_CODE](../../database-tables.md#ebill_set_type_code). |
| GetEdiPlaceOfServiceCode | `EdiPlaceOfServiceCode GetEdiPlaceOfServiceCode(string ubBillTypeCode)` | Executes an ORM query ([SQL-136](../../sql/SQL-136-ebill-query-provider-get-edi-place-of-service-code.md)) against [EDI_PLACE_OF_SERVICE_CODE](../../database-tables.md#edi_place_of_service_code). |
| SetCompoundDrugForAllServiceLinesForTheBill | `void SetCompoundDrugForAllServiceLinesForTheBill(Ebill bill)` | Executes an ORM query ([SQL-137](../../sql/SQL-137-ebill-query-provider-set-compound-drug-for-all-service-lines-for-the-bill.md)) against [EBILL_SERVICE](../../database-tables.md#ebill_service), [EBILL](../../database-tables.md#ebill). |
| EbillQueryProvider(IRepositoryFactory factory) | `EbillQueryProvider(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/Ebilling/EbillQueryProvider.cs`
