---
title: "SQL-122: Retrieve CbpBillStatusCode via GetBillStatusCodes"
summary: Read operation against CbpBillStatusCode via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-122: Retrieve CbpBillStatusCode via GetBillStatusCodes

This ORM statement performs a read operation on `CbpBillStatusCode` via `IUnitOfWork.GetRepository<T>()`, executed from `Services/SAIF.Services/Claims/Bills/BillService.cs (L264)`.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `codesNotToDisplay` | Input | ** | N/A | `x.Code` IN (codesNotToDisplay) (`Contains`) → column CODE |

## Tables

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

## LINQ statement

Source: `Services/SAIF.Services/Claims/Bills/BillService.cs:263`

```csharp
// Services/SAIF.Services/Claims/Bills/BillService.cs:263-265
            var codesNotToDisplay = new List<string> { "PEN", "DIS" };
            var codes = unitOfWork.GetRepository<CbpBillStatusCode>().Query()
                .Where(x => !codesNotToDisplay.Contains(x.Code)).ToList();
```

## 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
-- Services/SAIF.Services/Claims/Bills/BillService.cs:264
SELECT
  CBSC.CODE,
  CBSC.UPDATE_NUM,
  CBSC.CODE_DESCR,
  CBSC.ACTIVE_FLAG,
  CBSC.EXT_IW_CODE_DESCR,
  CBSC.UPDATE_DATE,
  CBSC.UPDATE_USER
FROM CBP_BILL_STATUS_CODE CBSC
WHERE CBSC.CODE NOT IN (:codesNotToDisplay)
```

Translation notes:
- `codesNotToDisplay` is the local list `{"PEN","DIS"}` (L263) -> list bind.

## Operations and processes
- BillService.GetBillStatusCodes — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/Claims/Bills/BillService.cs (L264)`
