Skip to content

Set claim context and retrieve

Public method on ClaimAppManager that establishes the current claim context and triggers retrieval and security enforcement.

Field Value
Operation ID OP-CLM-001
Trigger Caller supplies inClaimNumber As String or inClaimID As Decimal.
Inputs inClaimNumber As String or inClaimID As Decimal
Outputs None (side effect — updates Context, ClaimData, Message, and security-derived state)
Primary components ClaimAppManager.SetClaimContext
Entry point SAIF.Application.Claim\ClaimAppManager.vb

Steps

  1. Validate the input is non-trivial (string overload): checks inClaimNumber.Trim.Length > 0 and that it is not the literal menu-context label ("claim #") per BR-CLM-006.
  2. On failure: ClaimData is cleared, MarkContextNotSet() is called, and Message = ClaimAppConstants.PLEASEENTERCLAIM is shown.
  3. If valid, construct a new ClaimContext (New(inClaimNumber) or New(inClaimID, 0)) and call ChangeContext().
  4. ChangeContext() calls OnContextChanged().
  5. OnContextChanged() sets Message = ClaimAppConstants.CLAIMNOTFOUND per BR-CLM-007, calls GetClaimData(), and if the resulting ClaimData.IsValid, clears Message and calls MarkContextSet().
  6. GetClaimData() reads clsClaimData.GetData(DPI, Context.ClaimID) or clsClaimData.GetData(DPI, Context.ClaimNumber) depending on which context value is set — a Retrieve call into the externally-packaged SAIF.Business claim business object (SQL ID and table not traceable from this library; owned by SAIF.Business, out of scope)**.
  7. Only if ContextSet is true, ChangeContext() calls OnCheckSecurity().
  8. See Security enforcement, which enforces BR-CLM-001 through BR-CLM-005.
  9. ChangeContext() then calls OnRetrieve() — implemented by the concrete subclass outside this library; retrieval behavior beyond this point is subclass-specific and not traceable from this library's source**.
  10. Tech debt: SetClaimContext(inClaimID As Decimal) (the decimal overload) only calls MarkContextSet() directly and does not call ChangeContext()/OnCheckSecurity()/OnRetrieve() — an asymmetry versus the string overload per BR-CLM-006 that may be an intentional lightweight ID-only context set or an inconsistency**.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([SetClaimContext called]) --> Guard{Input valid?}
    Guard -->|No| Invalid([ClaimData cleared<br>MarkContextNotSet<br>Message: PLEASEENTERCLAIM])
    Guard -->|Yes| Change[ChangeContext]
    Change --> OCC[OnContextChanged:<br>GetClaimData]
    OCC --> Valid{ClaimData.IsValid?}
    Valid -->|No| NotFound([Message: CLAIMNOTFOUND])
    Valid -->|Yes| Set[MarkContextSet]
    Set --> Security[OnCheckSecurity]
    Security --> Retrieve[OnRetrieve<br>subclass-implemented]

Failure and edge-case behavior

  • Blank/placeholder claim number: rejected, see BR-CLM-006.
  • Claim not found after retrieval: reported, see BR-CLM-007.
  • Decimal-overload asymmetry (SetClaimContext(inClaimID) skips ChangeContext) — see step 5 above.

Note: Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Application.Claim\ClaimAppManager.vb
  • SAIF.Application.Claim\ClaimAppConstants.vb