Skip to content

Benefit-payment stop processing

Stops payments on active benefit schedules for a claim, either recording that a scheduled payment was released or deleting the payment row entirely, depending on whether a released scheduled payment exists.

Field Value
Operation ID benefit-payment-stop
Trigger Caller invokes ProcessBenefitPayment(claimId, callingApplication[, callingFunction])
Inputs ClaimID, CallingApplication, CallingFunction (optional)
Outputs Updated or deleted schedule/payment rows; StopStatus; boolean success
Primary components clsActiveBenefitSchedule.ProcessBenefitPayment
Entry point SAIF.Business.Claim/clsActiveBenefitSchedule.vb

Steps

  1. Retrieve active benefit schedules for the claim where REMAINING_PAYMENT_COUNT > 0 (SQL-011, CL_BENEFIT_SCHEDULE).
  2. For each schedule row, retrieve the associated benefit payment (SQL-012, CL_BENEFIT_PAYMENT).
  3. Call ClaimServices.hasReleasedScheduledPayment(...) (external SAIF.Business package) to determine whether a released scheduled payment exists.**
  4. If a released payment exists: execute the update path.
    • Execute UpdateSchedSQL, setting RemainingPaymentCount = 1 (SQL-039, CL_BENEFIT_PAYMENT).
    • If RowsAffected = 0: add error #PAYUPD# (BR-009) and return False.
    • Otherwise: record StopStatus.Released.
  5. Otherwise (no released payment): execute the delete path.
    • Execute DeletePaymentSQL, cascading-deleting the schedule/payment row (SQL-054, CL_BENEFIT_PAYMENT).
    • If RowsAffected = 0: add error #PAYDEL# (BR-010) and return False.
    • Otherwise: record StopStatus.Deleted.
  6. ReturnTask() composes a human-readable task description from the CallingApplication, CallingFunction, and StopStatus enums for downstream task creation.*

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([ProcessBenefitPayment called]) --> Retrieve["Retrieve active benefit<br>schedules"]
    Retrieve --> ForEach["For each schedule row:<br>retrieve benefit payment"]
    ForEach --> Check{hasReleasedScheduledPayment?}
    Check -->|Yes| UpdateSched[Update schedule<br>RemainingPaymentCount = 1]
    Check -->|No| DeletePayment[Delete benefit payment row]
    UpdateSched --> RowsA{RowsAffected = 0?}
    DeletePayment --> RowsB{RowsAffected = 0?}
    RowsA -->|Yes| ErrUpd([Error #PAYUPD#<br>return False])
    RowsA -->|No| Released([StopStatus.Released])
    RowsB -->|Yes| ErrDel([Error #PAYDEL#<br>return False])
    RowsB -->|No| Deleted([StopStatus.Deleted])

Failure and edge-case behavior

  • A zero-row update raises #PAYUPD# and returns False without further processing.
  • A zero-row delete raises #PAYDEL# and returns False without further processing.
  • The near-identical clsBenefitSchedule class (excluded from the compiled build) duplicates this logic using SQL-016, SQL-017, SQL-041, SQL-042, SQL-056, and SQL-057.*

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

  • SAIF.Business.Claim/clsActiveBenefitSchedule.vb