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

# SQL-132: EbillQueryProvider.GetPendedErrors

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

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-132 |
| **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** | `GetPendedErrors` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `billPatientProviderId` | Input | long | N/A | Evaluated client-side from `bill.Patient.Provider.Id`; the name is derived from the member path to avoid a collision |
| `billPatientId` | Input | long | N/A | Evaluated client-side from `bill.Patient.Id` |
| `billId` | Input | long | N/A | Evaluated client-side from `bill.Id` |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [EBILL_ERROR_CONDITION](../database-tables.md#ebill_error_condition) | SELECT | `EBILL_ERROR_CONDITION_SEQ_NUM`, `UPDATE_NUM`, `ERROR_TEXT`, `PENDED_BILL_FLAG`, `PROVIDER_ERROR_FLAG`, `EBILL_SERVICE_SUB_NUM`, `UPDATE_USER`, `UPDATE_DATE`, `EBILL_SEQ_NUM`, `EBILL_PROVIDER_SEQ_NUM`, `EBILL_PATIENT_SEQ_NUM` |

## LINQ statement

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

```csharp
// Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:31
errorRepository = Factory.GetRepository<EbillErrorCondition>().Query();

// Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:257
return errorRepository
    .Where(x =>
        (x.Provider.Id == bill.Patient.Provider.Id || x.Patient.Id == bill.Patient.Id ||
         x.Bill.Id == bill.Id) &&
        x.IsPendedBill)
    .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
SELECT
  EEC.EBILL_ERROR_CONDITION_SEQ_NUM,
  EEC.UPDATE_NUM,
  EEC.ERROR_TEXT,
  EEC.PENDED_BILL_FLAG,
  EEC.PROVIDER_ERROR_FLAG,
  EEC.EBILL_SERVICE_SUB_NUM,
  EEC.UPDATE_USER,
  EEC.UPDATE_DATE,
  EEC.EBILL_SEQ_NUM,
  EEC.EBILL_PROVIDER_SEQ_NUM,
  EEC.EBILL_PATIENT_SEQ_NUM
FROM EBILL_ERROR_CONDITION EEC
WHERE (EEC.EBILL_PROVIDER_SEQ_NUM = :billPatientProviderId
    OR EEC.EBILL_PATIENT_SEQ_NUM = :billPatientId
    OR EEC.EBILL_SEQ_NUM = :billId)
  AND EEC.PENDED_BILL_FLAG = 'Y'
```

Translation notes:

- Before the query runs, the in-memory walk of `bill.Patient.Provider` may trigger lazy-load SELECTs of `EBILL_PATIENT`/`EBILL_PROVIDER` rows by primary key, if those proxies are not initialized yet. The walk is a side effect of the partial evaluator, not part of this statement, so no SQL for it is written here.

## 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:257`
