---
title: Location lookups
summary: Resolve location and contact records using fixed location codes and contact-type precedence.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
operation_id: OP-SD-19
trigger: Location resolution requests.
---

# Location lookups

Resolve location and contact records using fixed location codes and contact-type precedence.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SD-19 |
| **Trigger** | Location resolution requests. |
| **Inputs** | Policy/claim id, state |
| **Outputs** | Location data |
| **Primary components** | `LocationQueryProvider` |
| **Entry point** | `Data/SAIF.Data/Queries/Policies/LocationQueryProvider.cs` |

## Steps

1. Apply location codes BUS/POL/CLM and contact-type precedence (CLM, then CON) ([SD-BR-062](../business-rules.md#sd-br-062-location-code-and-contact-type-precedence), [SQL-167](../sql/SQL-167-location-query-provider-get-location.md), [SQL-168](../sql/SQL-168-location-query-provider-get-policy-locations.md), [SQL-169](../sql/SQL-169-location-query-provider-get-primary-location.md), [SQL-170](../sql/SQL-170-location-query-provider-get-policy-mailing-location.md), [SQL-171](../sql/SQL-171-location-query-provider-get-location-contacts.md), [SQL-172](../sql/SQL-172-location-query-provider-get-polcy-claim-location-with-default.md), [SQL-173](../sql/SQL-173-location-query-provider-get-claim-location-contact-with-default.md), [SQL-174](../sql/SQL-174-location-query-provider-get-office-code.md), [SQL-175](../sql/SQL-175-location-query-provider-get-oregon-business-locations.md)). Data: `LOCATION`, `CONTACT`.
2. Oregon business locations use `State == "OR"` ([SD-BR-062](../business-rules.md#sd-br-062-location-code-and-contact-type-precedence)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Location resolution requests.]) --> S1["`LocationQueryProvider`"]
	S1 --> S2{"Rules satisfied?"}
	S2 -->|Yes| EndOk([Result returned])
	S2 -->|No| EndErr([Exception / empty result])
```

## Failure and edge-case behavior
- No CLM contact: falls back to CON per the precedence order.

## 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/Policies/LocationQueryProvider.cs`
- `Data/SAIF.Data/Queries/Locations/LocationQueryProvider.cs:19`
- `Data/SAIF.Data/Queries/Locations/LocationQueryProvider.cs:25`
- `Data/SAIF.Data/Queries/Locations/LocationQueryProvider.cs:33`
