---
title: SQL-014: Parent provider relationships by location
summary: Parent provider relationships by location retrieval query.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-24
library: SAIF.Business.View.Provider
reference_type: package
---

# SQL-014: Parent provider relationships by location

This statement supports the ``clsProviderRelationshipCollection`` retrieval path by reading provider-domain data from Oracle tables and projecting the result into business objects or DTO lists.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-014 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | Text |
| **Business object** | ``clsProviderRelationshipCollection`` |
| **Criteria property** | ``RetrieveSQL`` |
| **Lifecycle method** | `BeforeRetrieve` (`GetParentProviderRelationshipCollection`) |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:ProviderLocationID` | Input | Decimal | N/A | Retrieves parent provider-location relationships for the selected child location. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [PROVIDER_LOCATION](../database-tables.md#provider_location) | SELECT | PROVIDER_LOCATION_SEQ_NUM, PROVIDER_SEQ_NUM, PROVIDER_TYPE_CODE |
| [PROVIDER_RELATIONSHIP](../database-tables.md#provider_relationship) | SELECT | PROVIDER_LOCATION_SEQ_NUM, PARENT_PROVIDER_LOC_SEQ_NUM, PROVIDER_RELATIONSHIP_CODE |

## Sample SQL

```sql
SELECT
  PR.Provider_Location_Seq_Num AS PRProviderLocationID,
  PR.PARENT_PROVIDER_LOC_SEQ_NUM AS ParentProviderLocationID,
  PR.EFF_DATE AS StartDate,
  PR.EXP_DATE AS TerminationDate,
  PR.PROVIDER_RELATIONSHIP_CODE AS ProviderRelationshipCode,
  parentPL.APPROVED_FLAG AS IsApproved,
  parentPL.APPROVED_USER AS ApprovedUser,
  parentPL.BUSINESS_FLAG AS IsBusiness,
  parentPL.BUSINESS_NAME AS BusinessName,
  parentPL.FAX_NUM AS FaxNum,
  parentPL.FIRST_NAME AS FirstName,
  parentPL.INELIGIBILITY_FLAG AS IsIneligible,
  parentPL.LAST_NAME AS LastName,
  parentPL.MIDDLE_NAME AS MiddleName,
  parentPL.PAYEE_NAME AS PayeeName,
  parentPL.PHONE_AREA_CODE AS PhoneAreaCode,
  parentPL.PHONE_NUM AS PhoneNum,
  parentPL.PHONE_NUM_EXT AS PhoneNumExt,
  parentPL.POSSIBLE_FRAUD_FLAG AS IsPossibleFraud,
  parentPL.PRIMARY_LOCATION_FLAG AS IsPrimaryLocation,
  parentPL.PROVIDER_LOCATION_SEQ_NUM AS ProviderLocationID,
  parentPL.PROVIDER_SEQ_NUM AS ProviderID,
  parentPL.PROVIDER_TYPE_CODE AS ProviderTypeCode,
  parentPL.RECENT_ACTIVITY_FLAG AS HasRecentActivity,
  parentPL.TOLL_FREE_FAX_NUM AS TollFreeFaxNum,
  parentPL.TOLL_FREE_PHONE_NUM AS TollFreePhoneNum,
  parentPL.UPDATE_DATE AS UpdateDate,
  parentPL.UPDATE_NUM AS UpdateNum,
  parentPL.UPDATE_USER AS UpdateUser,
  parentPL.WEB_SITE_ADDRESS AS WebSiteAddress,
  parentPL.CRITICAL_ACCESS_HOSPITAL_FLAG AS IsCriticalAccessHospital,
  parentPL.EMAIL_ADDR AS EmailAddress
FROM provider_location pl
JOIN provider_relationship pr ON pr.provider_location_seq_num = PL.provider_location_seq_num
LEFT JOIN provider_location parentPL ON parentPL.provider_location_seq_num = pr.parent_provider_loc_seq_num
WHERE pl.provider_location_seq_num = :ProviderLocationID
ORDER BY parentPL.BUSINESS_NAME
```

## Operations and processes
- [Retrieve parent provider relationships](../operations/provider-relationship-retrieval.md)

## Related documentation
- [Index](../index.md)
- [Overview](../overview.md)
- [Architecture](../architecture.md)
- [Dependencies](../dependencies.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Database tables](../database-tables.md)
- [SQL catalog](../sql/index.md)
- [API reference](../api/index.md)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.
## Sources
- `Business\SAIF.Business.View.Provider\clsProviderRelationshipCollection.vb`
