---
title: Attending physician resolution
summary: Resolve the attending physician's location for a claim, combining physician and facility contacts.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
operation_id: OP-SD-13
trigger: Caller requests the attending physician location for a claim.
---

# Attending physician resolution

Resolve the attending physician's location for a claim, combining physician and facility contacts.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SD-13 |
| **Trigger** | Caller requests the attending physician location for a claim. |
| **Inputs** | Claim id |
| **Outputs** | Location, or throws |
| **Primary components** | `ClaimQueryProvider.GetAttendingPhysician` |
| **Entry point** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |

## Steps

1. Load attending physician contacts for the claim that are active and not terminated ([SQL-057](../sql/SQL-057-claim-query-provider-get-attending-physician.md)). Data: `AttendingPhysician` (`ATTENDING_PHYSICIAN`), `Location` (`LOCATION`).
2. If there is a physician without a facility, throw `ApplicationException` ([SD-BR-040](../business-rules.md#sd-br-040-physician-without-facility-is-invalid)).
3. If the physician equals the facility, or only a facility exists, use the facility location. If both exist, use the physician location with the facility as its parent ([SD-BR-040](../business-rules.md#sd-br-040-physician-without-facility-is-invalid)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Caller requests the attending physician location for a<br>claim."]) --> S1["`ClaimQueryProvider.GetAttendingPhysician`"]
	S1 --> S2{"Rules satisfied?"}
	S2 -->|Yes| EndOk([Result returned])
	S2 -->|No| EndErr([Exception / empty result])
```

## Failure and edge-case behavior
- Physician without a facility: throws `ApplicationException`.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)


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