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¶
- Retrieve active benefit schedules for the claim where
REMAINING_PAYMENT_COUNT > 0(SQL-011, CL_BENEFIT_SCHEDULE). - For each schedule row, retrieve the associated benefit payment (SQL-012, CL_BENEFIT_PAYMENT).
- Call
ClaimServices.hasReleasedScheduledPayment(...)(externalSAIF.Businesspackage) to determine whether a released scheduled payment exists.** - If a released payment exists: execute the update path.
- Execute
UpdateSchedSQL, settingRemainingPaymentCount = 1(SQL-039, CL_BENEFIT_PAYMENT). - If
RowsAffected = 0: add error#PAYUPD#(BR-009) and returnFalse. - Otherwise: record
StopStatus.Released.
- Execute
- 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 returnFalse. - Otherwise: record
StopStatus.Deleted.
- Execute
ReturnTask()composes a human-readable task description from theCallingApplication,CallingFunction, andStopStatusenums 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 returnsFalsewithout further processing. - A zero-row delete raises
#PAYDEL#and returnsFalsewithout further processing. - The near-identical
clsBenefitScheduleclass (excluded from the compiled build) duplicates this logic using SQL-016, SQL-017, SQL-041, SQL-042, SQL-056, and SQL-057.*
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. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
- SAIF.Business.Claim/clsActiveBenefitSchedule.vb