---
title: "SQL-128: EbillQueryProvider.GetBillStatusCode"
summary: Read operation for `EbillQueryProvider.GetBillStatusCode`
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# SQL-128: EbillQueryProvider.GetBillStatusCode

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by `EbillQueryProvider.GetBillStatusCode`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-128 |
| **Operation type** | Read |
| **Execution method** | ORM (NHibernate LINQ) |
| **Database** | Oracle* |
| **Schema** | [unqualified]** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `EbillQueryProvider` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `GetBillStatusCode` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `billStatusCode` | Input | string | N/A | Method argument of `EbillQueryProvider.GetBillStatusCode` bound into the ORM expression; NHibernate generates the bind variable at runtime |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [EBILL_STATUS_CODE](../database-tables.md#ebill_status_code) | SELECT | `CODE`, `UPDATE_NUM`, `CODE_DESCR`, `UPDATE_USER`, `UPDATE_DATE` |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:165`. The repository is obtained at `Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:30`.

```csharp
// Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:30
billStatusRepository = Factory.GetRepository<EbillStatusCode>().Query();

// Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:165
return billStatusRepository.SingleOrDefault(s => s.Code == billStatusCode);
```

## Sample SQL

> **Inferred SQL:** This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

```sql
-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
SELECT
  ESC.CODE,
  ESC.UPDATE_NUM,
  ESC.CODE_DESCR,
  ESC.UPDATE_USER,
  ESC.UPDATE_DATE
FROM EBILL_STATUS_CODE ESC
WHERE ESC.CODE = :billStatusCode
-- NHibernate expects at most one row
```

Translation notes:

- Direct translation: an equality predicate on mapped columns. No navigation, joins or in-memory operators.

## Operations and processes

- [E-bill processing queries](../operations/e-bill-processing-queries.md)

## Business rules

- [SD-BR-050 E-bill status and assignment-rule code sets](../business-rules.md#sd-br-050-e-bill-status-and-assignment-rule-code-sets)
- [SD-BR-051 Bill included in clearinghouse response file by response-batch state](../business-rules.md#sd-br-051-bill-included-in-clearinghouse-response-file-by-response-batch-state)
- [SD-BR-052 Multiple prescription numbers mark all NDC lines as compound drug](../business-rules.md#sd-br-052-multiple-prescription-numbers-mark-all-ndc-lines-as-compound-drug)

## Sources
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:165`
