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

# SQL-067: ClaimQueryProvider.GetPharmacyEligibilityReport

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

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `claimId` | Input | long | N/A | Method argument of `ClaimQueryProvider.GetPharmacyEligibilityReport` bound into the ORM expression; NHibernate generates the bind variable at runtime |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CL_PHARMACY_ELIGIBILITY_REPORT](../database-tables.md#cl_pharmacy_eligibility_report) | SELECT | CLAIM_ID, UPDATE_DATE, UPDATE_NUM, UPDATE_USER, TRANSMIT_DATE, MEDIMPACT_TRANSMIT_DATE, ELIGIBILITY_EFF_DATE, PREV_ELIGIBILITY_EFF_DATE, PREV_ELIGIBILITY_STATUS_CODE, ELIGIBILITY_STATUS_CODE |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs:420-421`.

```csharp
return Factory.GetRepository<PharmacyEligibilityReport>().Query()
    .FirstOrDefault(x => x.ClaimId == claimId);
```

## 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 *
FROM (
  SELECT
    CPER.CLAIM_ID,
    CPER.UPDATE_DATE,
    CPER.UPDATE_NUM,
    CPER.UPDATE_USER,
    CPER.TRANSMIT_DATE,
    CPER.MEDIMPACT_TRANSMIT_DATE,
    CPER.ELIGIBILITY_EFF_DATE,
    CPER.PREV_ELIGIBILITY_EFF_DATE,
    CPER.PREV_ELIGIBILITY_STATUS_CODE,
    CPER.ELIGIBILITY_STATUS_CODE
  FROM CL_PHARMACY_ELIGIBILITY_REPORT CPER
  WHERE CPER.CLAIM_ID = :claimId
)
WHERE ROWNUM <= 1
```

Translation notes:
- `CLAIM_ID` is both the Id and the `ClaimId` Map, so it is emitted once.
- The filter is on the key column, so at most one row can match.

## Operations and processes

- [Claim status and compensability](../operations/claim-status-and-compensability.md)


## Sources
- `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs:420`
