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

# BillQueryProvider

Query provider exposing 26 data-access operation(s) (`BillExists`, `GetBill`, `GetBillAmounts`, `GetBillIdsForClaim`, `GetBillServiceCode`, `GetBillServiceCodeStateless` and 20 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 26 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 |
| --- | --- | --- |
| BillExists | `bool BillExists(long billId)` | Executes an ORM query ([SQL-024](../../sql/SQL-024-bill-query-provider-bill-exists.md)) against [CBP_BILL](../../database-tables.md#cbp_bill). |
| GetBill | `CbpBill GetBill(long billId)` | Executes an ORM query ([SQL-025](../../sql/SQL-025-bill-query-provider-get-bill.md)) against [CBP_BILL](../../database-tables.md#cbp_bill). |
| GetBillsForClaim | `IEnumerable<CbpBill> GetBillsForClaim(long claimId)` | Executes an ORM query ([SQL-026](../../sql/SQL-026-bill-query-provider-get-bills-for-claim.md)) against [CBP_BILL](../../database-tables.md#cbp_bill). |
| GetBillIdsForClaim | `IEnumerable<long> GetBillIdsForClaim(long claimId)` | Executes an ORM query ([SQL-027](../../sql/SQL-027-bill-query-provider-get-bill-ids-for-claim.md)) against [CBP_BILL](../../database-tables.md#cbp_bill). |
| GetBillTypes | `IEnumerable<CbpBillTypeCode> GetBillTypes()` | Executes an ORM query ([SQL-028](../../sql/SQL-028-bill-query-provider-get-bill-types.md)) against [CBP_BILL_TYPE_CODE](../../database-tables.md#cbp_bill_type_code). |
| GetBillStatusCode | `CbpBillStatusCode GetBillStatusCode(string status)` | Executes an ORM query ([SQL-029](../../sql/SQL-029-bill-query-provider-get-bill-status-code.md)) against [CBP_BILL_STATUS_CODE](../../database-tables.md#cbp_bill_status_code). |
| GetBillStatusHistory | `IEnumerable<CbpBillStatus> GetBillStatusHistory(long billId)` | Executes an ORM query ([SQL-030](../../sql/SQL-030-bill-query-provider-get-bill-status-history.md)) against [CBP_BILL_STATUS](../../database-tables.md#cbp_bill_status), [CBP_BILL](../../database-tables.md#cbp_bill). |
| GetRegeneratedBillEntrySourceCode | `CbpBillEntrySourceCode GetRegeneratedBillEntrySourceCode()` | Executes an ORM query ([SQL-031](../../sql/SQL-031-bill-query-provider-get-regenerated-bill-entry-source-code.md)) against [CBP_BILL_ENTRY_SOURCE_CODE](../../database-tables.md#cbp_bill_entry_source_code). |
| GetBillAmounts | `decimal GetBillAmounts(long claimId, string paymentCategory, IList<string> billTypes)` | Executes an ORM query ([SQL-032](../../sql/SQL-032-bill-query-provider-get-bill-amounts.md)) against [CBP_BILL](../../database-tables.md#cbp_bill). |
| GetStrippedCbpDiagnosis | `string GetStrippedCbpDiagnosis(string diagnosisInformation, string icdVersion)` | Executes an ORM query ([SQL-034](../../sql/SQL-034-bill-query-provider-get-stripped-cbp-diagnosis.md)) against [CBP_DIAGNOSIS](../../database-tables.md#cbp_diagnosis). |
| GetCbpDiagnosis | `CbpDiagnosis GetCbpDiagnosis(string diagnosisInformation, string icdVersion)` | Executes an ORM query ([SQL-035](../../sql/SQL-035-bill-query-provider-get-cbp-diagnosis.md)) against [CBP_DIAGNOSIS](../../database-tables.md#cbp_diagnosis). |
| GetCbpDiagnosisTypeCode | `CbpDiagnosisTypeCode GetCbpDiagnosisTypeCode(EbillHealthInformation diagnosis)` | Executes an ORM query ([SQL-036](../../sql/SQL-036-bill-query-provider-get-cbp-diagnosis-type-code.md)) against [CBP_DIAGNOSIS_TYPE_CODE](../../database-tables.md#cbp_diagnosis_type_code). |
| GetEbillEntrySourceCode | `CbpBillEntrySourceCode GetEbillEntrySourceCode()` | Executes an ORM query ([SQL-037](../../sql/SQL-037-bill-query-provider-get-ebill-entry-source-code.md)) against [CBP_BILL_ENTRY_SOURCE_CODE](../../database-tables.md#cbp_bill_entry_source_code). |
| GetCbpBillTypeCode | `CbpBillTypeCode GetCbpBillTypeCode(string billtype)` | Executes an ORM query ([SQL-038](../../sql/SQL-038-bill-query-provider-get-cbp-bill-type-code.md)) against [CBP_BILL_TYPE_CODE](../../database-tables.md#cbp_bill_type_code). |
| GetCbpServiceCodeNotExpired | `CbpServiceCode GetCbpServiceCodeNotExpired(string serviceCode)` | Executes an ORM query ([SQL-039](../../sql/SQL-039-bill-query-provider-get-cbp-service-code-not-expired.md)) against [CBP_SERVICE_CODE](../../database-tables.md#cbp_service_code). |
| GetCbpServiceCodeExpired | `CbpServiceCode GetCbpServiceCodeExpired(string serviceCode)` | Executes an ORM query ([SQL-040](../../sql/SQL-040-bill-query-provider-get-cbp-service-code-expired.md)) against [CBP_SERVICE_CODE](../../database-tables.md#cbp_service_code). |
| GetCbpServiceZCode | `CbpServiceCode GetCbpServiceZCode(string serviceCode)` | Executes an ORM query ([SQL-041](../../sql/SQL-041-bill-query-provider-get-cbp-service-zcode.md)) against [CBP_SERVICE_CODE](../../database-tables.md#cbp_service_code), [CBP_SERVICE_TYPE_CODE](../../database-tables.md#cbp_service_type_code). |
| GetCbpServiceZDecDescription | `CbpServiceDescription GetCbpServiceZDecDescription(string serviceCode)` | Executes an ORM query ([SQL-042](../../sql/SQL-042-bill-query-provider-get-cbp-service-zdec-description.md)) against [CBP_SERVICE_DESCRIPTION](../../database-tables.md#cbp_service_description), [CBP_SERVICE_CODE](../../database-tables.md#cbp_service_code), [CBP_SERVICE_TYPE_CODE](../../database-tables.md#cbp_service_type_code). |
| GetCbpServiceZDecDescriptionStateless | `CbpServiceDescriptionStateless GetCbpServiceZDecDescriptionStateless(string serviceCode)` | Executes an ORM query ([SQL-043](../../sql/SQL-043-bill-query-provider-get-cbp-service-zdec-description-stateless.md)) against [CBP_SERVICE_DESCRIPTION](../../database-tables.md#cbp_service_description). |
| GetBillServiceTypeCode | `CbpServiceTypeCode GetBillServiceTypeCode(string serviceTypeCode)` | Executes an ORM query ([SQL-044](../../sql/SQL-044-bill-query-provider-get-bill-service-type-code.md)) against [CBP_SERVICE_TYPE_CODE](../../database-tables.md#cbp_service_type_code). |
| GetBillServiceCode | `CbpServiceCode GetBillServiceCode(string serviceCode, string serviceTypeCode)` | Executes an ORM query ([SQL-045](../../sql/SQL-045-bill-query-provider-get-bill-service-code.md)) against [CBP_SERVICE_CODE](../../database-tables.md#cbp_service_code), [CBP_SERVICE_TYPE_CODE](../../database-tables.md#cbp_service_type_code). |
| GetBillServiceCodeStateless | `CbpServiceCodeStateless GetBillServiceCodeStateless(string serviceCode, string serviceTypeCode)` | Executes an ORM query ([SQL-046](../../sql/SQL-046-bill-query-provider-get-bill-service-code-stateless.md)) against [CBP_SERVICE_CODE](../../database-tables.md#cbp_service_code). |
| GetNationalDrug | `CbpNationalDrug GetNationalDrug(string nationalDrugCode)` | Executes an ORM query ([SQL-047](../../sql/SQL-047-bill-query-provider-get-national-drug.md)) against [CBP_NATIONAL_DRUG](../../database-tables.md#cbp_national_drug). |
| GetDispenseAsWritten | `PharmacyDispenseAsWrittenCode GetDispenseAsWritten(string dispenseAsWritten)` | Executes an ORM query ([SQL-048](../../sql/SQL-048-bill-query-provider-get-dispense-as-written.md)) against [CL_PHARMACY_DAW_CODE](../../database-tables.md#cl_pharmacy_daw_code). |
| GetCbpProcedureCode | `CbpProcedureCode GetCbpProcedureCode(string code, string icdVersion)` | Executes an ORM query ([SQL-049](../../sql/SQL-049-bill-query-provider-get-cbp-procedure-code.md)) against [CBP_PROCEDURE_CODE](../../database-tables.md#cbp_procedure_code). |
| GetIcdVersion | `IcdVersionCode GetIcdVersion(string icdVersion)` | Executes an ORM query ([SQL-050](../../sql/SQL-050-bill-query-provider-get-icd-version.md)) against [`IcdVersionCode` (map file not compiled; table unknown**)](../../database-tables.md#icdversioncode). |
| BillQueryProvider(IRepositoryFactory factory, IServiceCodeQueryProvider serviceCodeQueryProvider, IAuditNoteQueryProvider auditNoteQueryProvider, IProviderQueryProvider providerQueryProvider, IAuditQueryProvider auditQueryProvider) | `BillQueryProvider(IRepositoryFactory factory, IServiceCodeQueryProvider serviceCodeQueryProvider, IAuditNoteQueryProvider auditNoteQueryProvider, IProviderQueryProvider providerQueryProvider, IAuditQueryProvider auditQueryProvider)` | 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/BillQueryProvider.cs`
