---
title: Authority reference code lookups
summary: Loads and caches the code tables that back business process, business function, and authority purpose values used throughout claim authority validation.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-30
library: SAIF.Business.Claim.Authority
reference_type: package
operation_id: OP-006
trigger: Any read of a business process, business function, or authority purpose code map or business object
---

# Authority reference code lookups

Four small, largely read-only reference objects — `clsClaimBusProcessCode`, `clsClaimBusFunctionCode`, `clsClaimAuthPurposeCode`, and `clsClaimAuthTypeCode` — back the fixed code lists (business process, business function, authority purpose, and authority type) that every other operation in this library relies on to interpret and validate stored codes. `mdlClaimAuthority` additionally exposes process-wide, statically cached code maps (`GetBusinessProcessCodeMap`, `GetBusinessFunctionCodeMap`, `GetAuthorityPurposeCodeMap`) that wrap the business function and authority purpose collections with a typed enum lookup, matching the "cached reference lookups" pattern used for similar code-table objects elsewhere in the claim domain.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-006 |
| **Trigger** | `clsClaimXxxCode.GetClaimXxxCode(dpi, code)` (single-object lookup by code); `clsClaimXxxCodeCollection` retrieve (full list); `mdlClaimAuthority.GetBusinessProcessCodeMap` / `GetBusinessFunctionCodeMap(dpi, refresh)` / `GetAuthorityPurposeCodeMap(dpi, refresh)` (cached enum-keyed maps) |
| **Inputs** | `IDataPortalInfo` only — these are process-wide reference lookups, not employee- or claim-scoped |
| **Outputs** | Individual code business objects (`Code`, `CodeDescr`, `UpdateDate`/`UpdateNum`/`UpdateUser` where applicable); full collections ordered by description; cached, enum-keyed code maps |
| **Primary components** | `clsClaimBusProcessCode.GetClaimBusProcessCode`, `clsClaimBusFunctionCode.GetClaimBusFunctionCode`, `clsClaimAuthPurposeCode.GetClaimAuthPurposeCode`, `clsClaimAuthTypeCode.GetClaimAuthTypeCode`, `mdlClaimAuthority.GetBusinessProcessCodeMap/GetBusinessFunctionCodeMap/GetAuthorityPurposeCodeMap` |
| **Entry point** | `Business\SAIF.Business.Claim.Authority\mdlClaimAuthority.vb` and the four `clsClaim*Code.vb` / `*CodeCollection.vb` files |

## Steps

1. **Single-code business process lookup.** `clsClaimBusProcessCode.GetClaimBusProcessCode(dpi, code)` retrieves one row from [CL_CLAIM_BUS_PROCESS_CODE](../database-tables.md#cl_claim_bus_process_code) by exact code match ([SQL-012](../sql/SQL-012-saif-business-claim-authority.md)). `IsReserve` on the resulting object compares the code to the `RESERVE` constant (`"1"`), which is how [Claim authority initialization](claim-authority-initialization.md) decides whether to load reserve or payment business function limits.
2. **Full business process list.** The collection variant retrieves every row, ordered by description ([SQL-013](../sql/SQL-013-saif-business-claim-authority.md)).
3. **Single-code business function lookup.** `clsClaimBusFunctionCode.GetClaimBusFunctionCode(dpi, code)` retrieves one row from [CL_CLAIM_BUS_FUNCTION_CODE](../database-tables.md#cl_claim_bus_function_code) by exact code match ([SQL-010](../sql/SQL-010-saif-business-claim-authority.md)).
4. **Full business function list.** The collection variant retrieves every row, ordered by description ([SQL-011](../sql/SQL-011-saif-business-claim-authority.md)).
5. **Single-code authority purpose lookup.** `clsClaimAuthPurposeCode.GetClaimAuthPurposeCode(dpi, code)` retrieves one row from [CL_CLAIM_AUTH_PURPOSE_CODE](../database-tables.md#cl_claim_auth_purpose_code) by exact code match ([SQL-006](../sql/SQL-006-saif-business-claim-authority.md)). This backs the `AuthorityPurpose` read-only property exposed by both limit-row business objects.
6. **Full authority purpose list.** The collection variant retrieves every row, ordered by description ([SQL-007](../sql/SQL-007-saif-business-claim-authority.md)).
7. **Single-code authority type lookup.** `clsClaimAuthTypeCode.GetClaimAuthTypeCode(dpi, code)` retrieves one row from [CL_CLAIM_AUTH_TYPE_CODE](../database-tables.md#cl_claim_auth_type_code) by exact code match ([SQL-008](../sql/SQL-008-saif-business-claim-authority.md)); the `GrantAuthority` property on `clsClaimEmpAuthType` uses this to resolve the human-readable authority level.
8. **Full authority type list.** The collection variant retrieves every row, ordered by description ([SQL-009](../sql/SQL-009-saif-business-claim-authority.md)).
9. **Cached business process code map.** `GetBusinessProcessCodeMap()` builds a static, in-process `clsBusinessProcessCodeMap` once (hard-coded to the two known codes, `"1"` → `Reserves`, `"2"` → `Payments`) rather than querying the database; subsequent calls reuse the same static instance for the life of the process.
10. **Cached business function code map.** `GetBusinessFunctionCodeMap(dpi, refresh)` builds (or rebuilds, if `refresh` is `True` or no cache exists yet) a static `clsBusinessFunctionCodeMap` by running an inline `select code, claim_bus_process_code, code_descr from cl_claim_bus_function_code` and mapping each row's numeric code to one of the `BusinessFunctions` enum values via a hard-coded `Select Case`.* This inline query is not one of the cataloged SQL statements for this library — it duplicates the same table already covered by [SQL-010](../sql/SQL-010-saif-business-claim-authority.md)/[SQL-011](../sql/SQL-011-saif-business-claim-authority.md) but is issued directly rather than through the `Criteria` pattern.
11. **Cached authority purpose code map.** `GetAuthorityPurposeCodeMap(dpi, refresh)` follows the identical pattern against `cl_claim_auth_purpose_code`, mapping to the `AuthorityPurposes` enum (`OthersOnly = 1`, `All = 2`, `InitiateAndRelease = 3`, `AproveAndRelease = 4`).*

## Process flow

The following diagram visualizes the two lookup styles used by this operation.

```mermaid
flowchart TD
	Start([Caller needs a code<br>or code map]) --> Style{Direct object lookup<br>or cached enum map?}
	Style -->|Single code| SingleRetrieve[Retrieve one row by code]
	Style -->|Full list| CollectionRetrieve[Retrieve all rows,<br>ordered by description]
	Style -->|Cached map| CacheCheck{Cache populated<br>and refresh not requested?}
	CacheCheck -->|Yes| ReturnCache([Return cached map])
	CacheCheck -->|No| InlineQuery[Run inline SELECT;<br>map rows to enum via Select Case]
	InlineQuery --> BuildCache[Populate static cache]
	BuildCache --> ReturnCache
	SingleRetrieve --> Done([Business object returned])
	CollectionRetrieve --> Done
```

## Failure and edge-case behavior

- The business process code map is hard-coded and never queries the database; if a third business process code were ever added to `CL_CLAIM_BUS_PROCESS_CODE`, the map would not recognize it without a code change.*
- The business function and authority purpose maps use a `Select Case` on the numeric code to assign enum values; any code value present in the database but not covered by a `Case` is silently skipped rather than raising an error, so it would not appear in the cached map at all.*
- Because the function/purpose maps are cached in `Static` variables, a change to the underlying code tables is not reflected in a running process until `refresh:=True` is passed explicitly.
- No SQL catalog entry exists for the inline queries in `mdlClaimAuthority.vb` (steps 10–11); they are documented here from the source text rather than linked to a `sql/SQL-*.md` page.*

## 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.

## Sources
- `Business\SAIF.Business.Claim.Authority\clsClaimBusProcessCode.vb`
- `Business\SAIF.Business.Claim.Authority\clsClaimBusProcessCodeCollection.vb`
- `Business\SAIF.Business.Claim.Authority\clsClaimBusFunctionCode.vb`
- `Business\SAIF.Business.Claim.Authority\clsClaimBusFunctionCodeCollection.vb`
- `Business\SAIF.Business.Claim.Authority\clsClaimAuthPurposeCode.vb`
- `Business\SAIF.Business.Claim.Authority\clsClaimAuthPurposeCodeCollection.vb`
- `Business\SAIF.Business.Claim.Authority\clsClaimAuthTypeCode.vb`
- `Business\SAIF.Business.Claim.Authority\clsClaimAuthTypeCodeCollection.vb`
- `Business\SAIF.Business.Claim.Authority\mdlClaimAuthority.vb`
