Skip to content

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 by exact code match (SQL-012). IsReserve on the resulting object compares the code to the RESERVE constant ("1"), which is how Claim authority initialization 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).
  3. Single-code business function lookup. clsClaimBusFunctionCode.GetClaimBusFunctionCode(dpi, code) retrieves one row from CL_CLAIM_BUS_FUNCTION_CODE by exact code match (SQL-010).
  4. Full business function list. The collection variant retrieves every row, ordered by description (SQL-011).
  5. 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 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).
  7. Single-code authority type lookup. clsClaimAuthTypeCode.GetClaimAuthTypeCode(dpi, code) retrieves one row from CL_CLAIM_AUTH_TYPE_CODE by exact code match (SQL-008); 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).
  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-011 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.

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

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