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

# SQL-071: ClaimQueryProvider.GetClaimStatusCode

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

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-071 |
| **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** | `GetClaimStatusCode` |

## Parameters

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

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [claim_status_code](../database-tables.md#claim_status_code) | SELECT | Code, CODE_DESCR, UPDATE_DATE, UPDATE_USER, UPDATE_NUM |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs:568`.

```csharp
return Factory.GetRepository<ClaimStatusCode>().Query().SingleOrDefault(x => x.Code == code);
```

## 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
  CSC.Code,
  CSC.CODE_DESCR,
  CSC.UPDATE_DATE,
  CSC.UPDATE_USER,
  CSC.UPDATE_NUM
FROM claim_status_code CSC
WHERE CSC.Code = :code
-- NHibernate expects at most one row
```

Translation notes:
- The table and Id column names are kept with their mapped casing. Unquoted Oracle identifiers are case-insensitive, so this resolves to `CLAIM_STATUS_CODE.CODE`.
- The filter is on the Id, so at most one row can match.

## Operations and processes

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

## Business rules

- [SD-BR-041 Latest claim status falls back to WCD status when no history](../business-rules.md#sd-br-041-latest-claim-status-falls-back-to-wcd-status-when-no-history)
- [SD-BR-042 Compensability status mapping](../business-rules.md#sd-br-042-compensability-status-mapping)
- [SD-BR-043 Original acceptance requires request type I with decision A](../business-rules.md#sd-br-043-original-acceptance-requires-request-type-i-with-decision-a)

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