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

# SQL-220: ReportQueryProvider.GetActiveAttendingPhysicianRecordsForClaim

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

## Classification

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

## Parameters

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

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [ATTENDING_PHYSICIAN](../database-tables.md#attending_physician) | SELECT | ATTENDING_PHYSICIAN_SEQ_NUM, UPDATE_NUM, EFF_DATE, EXP_DATE, MULTIPLE_PHYSICIANS_FLAG, EMERGENCY_ROOM_FLAG, PRIM_ATTENDING_PHYSICIAN_FLAG, UPDATE_USER, UPDATE_DATE, CLAIM_ID, PROVIDER_LOCATION_SEQ_NUM, PARENT_PROVIDER_LOC_SEQ_NUM, ATTENDING_PHYS_EXP_REASON_CODE |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Claims/Reports/ReportQueryProvider.cs:60-61`.

```csharp
public IEnumerable<AttendingPhysician> GetActiveAttendingPhysicianRecordsForClaim(long claimId)
{
    return Factory.GetRepository<AttendingPhysician>().Query()
        .Where(att => att.Claim.Id == claimId && att.ExpirationDate == null).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
  AP.ATTENDING_PHYSICIAN_SEQ_NUM,
  AP.UPDATE_NUM,
  AP.EFF_DATE,
  AP.EXP_DATE,
  AP.MULTIPLE_PHYSICIANS_FLAG,
  AP.EMERGENCY_ROOM_FLAG,
  AP.PRIM_ATTENDING_PHYSICIAN_FLAG,
  AP.UPDATE_USER,
  AP.UPDATE_DATE,
  AP.CLAIM_ID,
  AP.PROVIDER_LOCATION_SEQ_NUM,
  AP.PARENT_PROVIDER_LOC_SEQ_NUM,
  AP.ATTENDING_PHYS_EXP_REASON_CODE
FROM ATTENDING_PHYSICIAN AP
WHERE AP.CLAIM_ID = :claimId
  AND AP.EXP_DATE IS NULL
```

## Operations and processes

- [Other query providers](../operations/other-query-providers.md)

## Business rules

- [SD-BR-093 Active report record has a null expiration date](../business-rules.md#sd-br-093-active-report-record-has-a-null-expiration-date)

## Sources
- `Data/SAIF.Data/Queries/Claims/Reports/ReportQueryProvider.cs:60`
