---
title: Provider reference data lookups
summary: Resolves the cached code and reference tables used to validate and display provider domain values — provider type, address/contact/identity/relationship/service codes, CBP services, and MCO plans.
status: draft
owner: SAIF
last_reviewed: 2026-07-30
library: SAIF.Business.Provider
reference_type: package
operation_id: OP-PRV-14
trigger: Any read of a provider code/reference list, or resolution of a code description during another operation's validation or display
---

# Provider reference data lookups

A cluster of small classes back the code lists and reference tables that every other provider-domain operation validates against or displays: provider type, address/contact/identity/ineligibility-reason/relationship/service codes, the CBP service catalog, and MCO plans. Most are simple full-CRUD code tables maintained by administrators; a few are read-only lookups layered over another table.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-PRV-14 |
| **Trigger** | Any read of a provider code/reference list, or resolution of a code description during another operation's validation or display |
| **Inputs** | Code value (and, for `clsCBPService`, an effective date) |
| **Outputs** | Code description and derived boolean flags; for the API helpers, a Contact Manager route call |
| **Primary components** | `clsProviderTypeCode`, `clsProviderType`, `clsProviderAddressCode`, `clsProviderContactCode`, `clsProviderIdentityCode`, `clsProviderIneligibilityReasonCode`, `clsProviderRelationshipCode`, `clsProviderServiceCode`, `clsCBPService`, `clsCBPServiceType`, `clsMCOPlan`, `clsProviderUtility` |
| **Entry point** | `Business\SAIF.Business.Provider\clsProviderTypeCode.vb` |

## Steps

1. **Full-CRUD code tables.** `clsProviderTypeCode` ([PROVIDER_TYPE_CODE](../database-tables.md#provider_type_code)), `clsProviderAddressCode` ([PROVIDER_ADDRESS_CODE](../database-tables.md#provider_address_code)), `clsProviderContactCode` ([PROVIDER_CONTACT_CODE](../database-tables.md#provider_contact_code)), `clsProviderIdentityCode` ([PROVIDER_IDENTITY_CODE](../database-tables.md#provider_identity_code)), `clsProviderIneligibilityReasonCode` ([PROVIDER_INELIG_REASON_CD](../database-tables.md#provider_inelig_reason_cd)), `clsProviderRelationshipCode` ([PROVIDER_RELATIONSHIP_CODE](../database-tables.md#provider_relationship_code)), `clsProviderServiceCode` ([PROVIDER_SERVICE_CODE](../database-tables.md#provider_service_code)), and `clsMCOPlan` ([MCO_PLAN](../database-tables.md#mco_plan)) all follow the same standard BOF CRUD pipeline: `BeforeRetrieve`/`Insert`/`Update`/`Delete` set `UpdateUser`/`UpdateDate`, `AfterInsert` requires a rows-affected value of `1` or adds `"Insert Failed"`, and `AfterUpdate`/`AfterDelete` require `1` or add the DB contention error. None of these classes define any `AddBusinessRules()` entries — code-table maintenance carries no additional validation beyond the standard save pipeline.*
2. **Read-only derived views.**
   - `clsProviderType.GetProviderType(...)` is a read-only facade over [PROVIDER_TYPE_CODE](../database-tables.md#provider_type_code) that converts several `Y`/`N` flag columns into booleans: `IsClaimProfileAllowed`, `IsDiagnosisRequired`, `IsMandatoryMco`, `IsMedicalAudit`, `IsSelfRegistrationAllowed`, `IsServiceProvRestricted`.
   - `clsCBPService.GetCBPService(inCode, inEffDate)` reads `CBP_SERVICE_CODE` left-joined to `CBP_SERVICE_DESCRIPTION`, filtering the service code by `:EffDate BETWEEN CBP_SERVICE_CODE.EFF_DATE AND NVL(EXP_DATE, '31-Dec-2999')`, then orders matching descriptions by `SERVICE_DESCR_EFF_DATE DESC` and fills only the **first** row — meaning the effective date parameter constrains the service code's validity window but the description returned is always the newest one on file, not necessarily the one effective as of the requested date.*
   - `clsCBPServiceType.GetCBPServiceType(inCode)` is a simple read-only lookup over `CBP_SERVICE_TYPE_CODE`.
3. **Utility SQL helpers (`clsProviderUtility`, no object CRUD).**
   - `GetProviderByProviderLocSeqNum` resolves `PROVIDER_LOCATION.PROVIDER_SEQ_NUM` — used throughout the maintenance operations to populate DTOs sent to Contact Manager.
   - `GetPlanNameByid` resolves `MCO_PLAN.MCO_SHORT_DESCR`.
   - `GetPrimaryLocationFlagByProviderLocSeqNum` resolves `PROVIDER_LOCATION.PRIMARY_LOCATION_FLAG`, treating only the literal value `"Y"` as `True`.
   - `GetSpecialityDescriptionByCode` resolves `PROVIDER_TYPE_CODE.CODE_DESCR`.
   - `GetTaxIdByProviderSeqNum` joins [PROVIDER](../database-tables.md#provider) to [PROVIDER_TAX_ID](../database-tables.md#provider_tax_id) and returns a trimmed display TIN or an empty string if none is found.
4. **Standalone address/availability API wrappers.** `clsAddressApi` (used by the [Maintain provider address](maintain-provider-address.md) operation) and `clsAvailabilityApi` both target Provider API routes under `provider/{0}/...`. `clsAvailabilityApi.UpdateAvailabilty` (its method name, misspelled in source) builds an `AvailabilityDto` update request to route `provider/{0}/availability`; no caller of `clsAvailabilityApi` was found elsewhere in this library, so it appears to be either unused in this repository snapshot or invoked exclusively from a consuming application outside this library.*

## Process flow

```mermaid
flowchart TD
	Start([Another operation needs a code description<br>or reference lookup]) --> Which{Which reference type?}
	Which -->|Code table| CRUD[Full CRUD via standard<br>BOF save pipeline; no business rules]
	Which -->|Provider type view| TypeView[Read PROVIDER_TYPE_CODE;<br>derive boolean flags]
	Which -->|CBP service| CBPLookup[Read CBP_SERVICE_CODE +<br>CBP_SERVICE_DESCRIPTION;<br>latest description only]
	Which -->|Utility helper| UtilLookup[Single-purpose SQL read<br>e.g. provider ID, plan name, tax ID]
	CRUD --> Done([Description/flags returned to caller])
	TypeView --> Done
	CBPLookup --> Done
	UtilLookup --> Done
```

## Failure and edge-case behavior

- `clsCBPService.GetCBPService` returns the most recently effective description for a service code rather than the description effective as of the requested date, which could misrepresent historical service descriptions if they changed over time.*
- `clsProviderUtility.GetPrimaryLocationFlagByProviderLocSeqNum` treats any value other than the exact string `"Y"` as `False`, including nulls or unexpected codes.
- `clsAvailabilityApi` has no identified caller in this repository snapshot; its behavior should be verified against consuming applications before relying on it.**
- None of the code-table classes enforce uniqueness or referential-integrity rules beyond what the database itself enforces — `AddBusinessRules()` is empty on all of them.*

## Related documentation

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

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources

- `Business\SAIF.Business.Provider\clsProviderTypeCode.vb`
- `Business\SAIF.Business.Provider\clsProviderType.vb`
- `Business\SAIF.Business.Provider\clsProviderAddressCode.vb`
- `Business\SAIF.Business.Provider\clsProviderContactCode.vb`
- `Business\SAIF.Business.Provider\clsProviderIdentityCode.vb`
- `Business\SAIF.Business.Provider\clsProviderIneligibilityReasonCode.vb`
- `Business\SAIF.Business.Provider\clsProviderRelationshipCode.vb`
- `Business\SAIF.Business.Provider\clsProviderServiceCode.vb`
- `Business\SAIF.Business.Provider\clsCBPService.vb`
- `Business\SAIF.Business.Provider\clsCBPServiceType.vb`
- `Business\SAIF.Business.Provider\clsMCOPlan.vb`
- `Business\SAIF.Business.Provider\clsProviderUtility.vb`
- `Business\SAIF.Business.Provider\Api\clsAddressApi.vb`
- `Business\SAIF.Business.Provider\Api\clsAvailabilityApi.vb`
