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¶
- Single-code business process lookup.
clsClaimBusProcessCode.GetClaimBusProcessCode(dpi, code)retrieves one row from CL_CLAIM_BUS_PROCESS_CODE by exact code match (SQL-012).IsReserveon the resulting object compares the code to theRESERVEconstant ("1"), which is how Claim authority initialization decides whether to load reserve or payment business function limits. - Full business process list. The collection variant retrieves every row, ordered by description (SQL-013).
- Single-code business function lookup.
clsClaimBusFunctionCode.GetClaimBusFunctionCode(dpi, code)retrieves one row from CL_CLAIM_BUS_FUNCTION_CODE by exact code match (SQL-010). - Full business function list. The collection variant retrieves every row, ordered by description (SQL-011).
- Single-code authority purpose lookup.
clsClaimAuthPurposeCode.GetClaimAuthPurposeCode(dpi, code)retrieves one row from CL_CLAIM_AUTH_PURPOSE_CODE by exact code match (SQL-006). This backs theAuthorityPurposeread-only property exposed by both limit-row business objects. - Full authority purpose list. The collection variant retrieves every row, ordered by description (SQL-007).
- Single-code authority type lookup.
clsClaimAuthTypeCode.GetClaimAuthTypeCode(dpi, code)retrieves one row from CL_CLAIM_AUTH_TYPE_CODE by exact code match (SQL-008); theGrantAuthorityproperty onclsClaimEmpAuthTypeuses this to resolve the human-readable authority level. - Full authority type list. The collection variant retrieves every row, ordered by description (SQL-009).
- Cached business process code map.
GetBusinessProcessCodeMap()builds a static, in-processclsBusinessProcessCodeMaponce (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. - Cached business function code map.
GetBusinessFunctionCodeMap(dpi, refresh)builds (or rebuilds, ifrefreshisTrueor no cache exists yet) a staticclsBusinessFunctionCodeMapby running an inlineselect code, claim_bus_process_code, code_descr from cl_claim_bus_function_codeand mapping each row's numeric code to one of theBusinessFunctionsenum values via a hard-codedSelect 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-011 but is issued directly rather than through theCriteriapattern. - Cached authority purpose code map.
GetAuthorityPurposeCodeMap(dpi, refresh)follows the identical pattern againstcl_claim_auth_purpose_code, mapping to theAuthorityPurposesenum (OthersOnly = 1,All = 2,InitiateAndRelease = 3,AproveAndRelease = 4).*
Process flow¶
The following diagram visualizes the two lookup styles used by this operation.
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 Caseon the numeric code to assign enum values; any code value present in the database but not covered by aCaseis 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
Staticvariables, a change to the underlying code tables is not reflected in a running process untilrefresh:=Trueis 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 asql/SQL-*.mdpage.*
Related documentation¶
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.vbBusiness\SAIF.Business.Claim.Authority\clsClaimBusProcessCodeCollection.vbBusiness\SAIF.Business.Claim.Authority\clsClaimBusFunctionCode.vbBusiness\SAIF.Business.Claim.Authority\clsClaimBusFunctionCodeCollection.vbBusiness\SAIF.Business.Claim.Authority\clsClaimAuthPurposeCode.vbBusiness\SAIF.Business.Claim.Authority\clsClaimAuthPurposeCodeCollection.vbBusiness\SAIF.Business.Claim.Authority\clsClaimAuthTypeCode.vbBusiness\SAIF.Business.Claim.Authority\clsClaimAuthTypeCodeCollection.vbBusiness\SAIF.Business.Claim.Authority\mdlClaimAuthority.vb