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

# SQL-106: EbillHealthInformationQueryProvider.GetDrgCode

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

## Classification

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

## Parameters

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

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [EBILL_HEALTH_INFORMATION](../database-tables.md#ebill_health_information) | SELECT | `EBILL_HEALTH_INFO_SEQ_NUM`, `UPDATE_NUM`, `EBILL_HEALTH_INFO_SUB_NUM`, `EBILL_HEALTH_INFO_CODE`, `CBP_HEALTH_INFO_SUB_NUM`, `PROCEDURE_DATE`, `UPDATE_USER`, `UPDATE_DATE`, `EBILL_SEQ_NUM`, `EBILL_HEALTH_INFO_TYPE_CODE` |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Claims/Ebilling/EbillHealthInformationQueryProvider.cs:31`

The repository is a class field initialised from `Factory.GetRepository<EbillHealthInformation>()` at `Data/SAIF.Data/Queries/Claims/Ebilling/EbillHealthInformationQueryProvider.cs:15`.

```csharp
// Data/SAIF.Data/Queries/Claims/Ebilling/EbillHealthInformationQueryProvider.cs:15
repository = Factory.GetRepository<EbillHealthInformation>().Query();

// Data/SAIF.Data/Queries/Claims/Ebilling/EbillHealthInformationQueryProvider.cs:31
var healthinfo = repository.SingleOrDefault(x => x.Bill.Id == billId && x.Type.Code == "DR");
```

## 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
  EHI.EBILL_HEALTH_INFO_SEQ_NUM,
  EHI.UPDATE_NUM,
  EHI.EBILL_HEALTH_INFO_SUB_NUM,
  EHI.EBILL_HEALTH_INFO_CODE,
  EHI.CBP_HEALTH_INFO_SUB_NUM,
  EHI.PROCEDURE_DATE,
  EHI.UPDATE_USER,
  EHI.UPDATE_DATE,
  EHI.EBILL_SEQ_NUM,
  EHI.EBILL_HEALTH_INFO_TYPE_CODE
FROM EBILL_HEALTH_INFORMATION EHI
WHERE EHI.EBILL_SEQ_NUM = :billId
  AND EHI.EBILL_HEALTH_INFO_TYPE_CODE = 'DR'
-- NHibernate expects at most one row
```

Translation notes:

- Only `InformationCode` (`EBILL_HEALTH_INFO_CODE`) is used by the caller (L33). The whole entity is still materialized.

## Operations and processes

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

## Business rules

- [SD-BR-055 DRG code identified by health information type](../business-rules.md#sd-br-055-drg-code-identified-by-health-information-type)

## Sources
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillHealthInformationQueryProvider.cs:31`
