Loss valuation orchestration¶
clsLossValuation.ValueLossSummary is the central orchestration point of this library: given a claim ID, it determines the claim's cost basis, computes non-duplication (ND) reimbursement, and creates the offset rows (fraud recovery, refund, third-party prediction, and either voided-claim or ND-reimbursement offsets) that ultimately drive the Loss summary maintenance totals. Several helper classes (clsFraudRecovery, clsRefund, clsThirdPartyPrediction, clsNDReimbursement, clsVoidedClaimOffsets) each implement one stage of this pipeline via a shared CreateOffsets convention.
| Field | Value |
|---|---|
| Operation ID | OP-USC-05 |
| Trigger | clsLossValuation.ValueLossSummary(dpi, claimID) |
| Inputs | ClaimID |
| Outputs | A set of US_LOSS_CATEGORY_OFFSET rows attached to the claim's loss categories, ready to be summed by Loss summary maintenance |
| Primary components | clsLossValuation, clsFraudRecovery, clsRefund, clsThirdPartyPrediction, clsNDReimbursement, clsVoidedClaimOffsets |
| Entry point | Business\SAIF.Business.UnitStat.Claim\Loss Summary\clsLossValuation.vb |
Steps¶
- Load claim data and reserves.
ValueLossSummaryretrieves the claim's core data and reserve history to establish context for the rest of the pipeline.
Origin:
clsClaimDataandclsClaimReservesCollectionare implemented inSAIF.Business.View.Claim, documented in its previous (pre-migration) format with no matching per-operation anchor for these specific retrievals. See SAIF.Business.View.Claim operations and processes. 2. Determine claim cost basis.GetClaimCostsBasiscomputes the basis amounts used later for offset math. This method contains a comparison bug: the branch intended to distinguish "chargeable expense greater than reserve" from the opposite case repeats the same>operator in both branches of the conditional, so the "less than or equal" branch is unreachable/never taken as written — the intended<=case is masked by the duplicated>comparison.* 3. Determine valuation dates.GetValuationDatesandGetLastReserveChangeestablish the as-of dates used to bound the offset calculations that follow, delegating in part toUnitStatServices.Origin:
UnitStatServicesis implemented inSAIF.Business(migrated to the new format), but no operation on that page specifically matches this valuation-date helper. See SAIF.Business operations and processes. 4. Reset prior offsets. Before recomputing, the valuation pipeline resets/clears any previously-created offsets for the categories it is about to recompute, so repeated valuation runs do not stack duplicate offsets from prior passes.* 5. Compute ND reimbursement basis. The non-duplication reimbursement amount is computed from the cost basis and reserve data established in steps 1–3, feeding into the laterclsNDReimbursement.CreateOffsetscall (step 8, non-void branch only). 6. Create fraud-recovery offsets (always).clsFraudRecovery.CreateOffsetsis called unconditionally, delegating toGetFraudRecoveryDate(SQL-010,PK73304_LOSS_SUMMARY.get_fraud_recovery_date). However,CreateFullyFraudulentOffsetsandCreatePartialFraudulentOffsetsboth begin with an always-true early-return guard —If Not clmData.PolicyNumber = 2 Or Not clmData.PolicyNumber = 3 Then Return Trueis true for every possible single-valuedPolicyNumber(a policy number cannot simultaneously equal both 2 and 3, so at least oneNotterm is always true), so these two methods return immediately and never create an offset row in current code — they are effectively dead/no-op logic despite being called on every valuation.* 7. Create refund offsets (always).clsRefund.CreateOffsetsis called unconditionally, delegating toGetRefundDates(SQL-013,PK73304_LOSS_SUMMARY.get_refund_dates) to determine the applicable refund date window before creating offset rows. 8. Create third-party-prediction offsets (always).clsThirdPartyPrediction.CreateOffsetsis called unconditionally. It retrieves prediction data viaPK73304_LOSS_SUMMARY.get_thirdparty_prediction(SQL-014 / SQL-015, duplicate-named overloads for different parameter sets) and an inline lookup againstdual(SQL-016). It also consults case and lien/settlement data from a sibling library:Origin:
clsThrdpartyPredictionDetailCollectionandclsThrdpartyLienCategoryCollectionare implemented inSAIF.Business.Claim.ThirdParty(migrated to the new format). See Run case search and predictions and Manage liens and settlements.
CreateNonLienOffsets contains an unreachable branch: a condition guarding one of its offset-creation paths is structured so that the alternate path can never be reached given the values it is compared against, meaning only one of the two intended offset-creation code paths is ever exercised.*
9. Branch on claim status: void vs. active. After the three unconditional offset-creation calls above, ValueLossSummary branches on the claim's status code (BR-008):
- If claimData.StatusCode = "V" (Void): calls clsVoidedClaimOffsets.CreateOffsets only, which creates a single reversal-style offset from the claim's most recent payment (offset type VoidedClaims) rather than layering further amounts.
- Otherwise: calls clsNDReimbursement.CreateOffsets, which uses the ND reimbursement basis computed in step 5 (SQL-012, PK73304_LOSS_SUMMARY.get_final_denial_dates) to create the final layer of offsets for an active claim.
10. Downstream consumption. The offsets created in steps 6–9 are attached as US_LOSS_CATEGORY_OFFSET children of the claim's US_LOSS_CATEGORY rows and are summed (with the SETL/TPN floor logic) by Loss summary maintenance when the loss summary's derived totals are next computed or persisted.
Process flow¶
flowchart TD
Start([ValueLossSummary invoked]) --> Load[Load claim data and reserves]
Load --> Basis[Compute claim cost basis]
Basis --> Dates[Determine valuation dates]
Dates --> Reset[Reset prior offsets for recomputed categories]
Reset --> NDBasis[Compute ND reimbursement basis]
NDBasis --> Fraud[Create fraud-recovery offsets - unconditional, effectively no-op]
Fraud --> Refund[Create refund offsets - unconditional]
Refund --> ThirdParty[Create third-party-prediction offsets - unconditional]
ThirdParty --> StatusCheck{Claim status = Void?}
StatusCheck -->|Yes| Voided[Create voided-claim offset only]
StatusCheck -->|No| NDReimb[Create ND reimbursement offsets]
Voided --> Done([Offsets attached to loss categories])
NDReimb --> Done
Failure and edge-case behavior¶
GetClaimCostsBasis's duplicated>comparison means the branch intended for the "less than or equal to reserve" case is unreachable as written; downstream cost-basis values may not reflect the originally-intended logic for that scenario.*CreateFullyFraudulentOffsetsandCreatePartialFraudulentOffsetsnever execute their offset-creation logic due to an always-true early-return guard — fraud-recovery offsets from these two paths do not currently get created regardless of claim data, even though the surrounding orchestration calls them on every valuation.*CreateNonLienOffsets's unreachable branch means only one of its two intended offset-creation paths is exercised in current code.*- The void/active branch is mutually exclusive per BR-008: a voided claim never receives ND-reimbursement offsets, and an active claim never receives the voided-claim reversal offset.
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¶
Business\SAIF.Business.UnitStat.Claim\Loss Summary\clsLossValuation.vbBusiness\SAIF.Business.UnitStat.Claim\Loss Summary\clsFraudRecovery.vbBusiness\SAIF.Business.UnitStat.Claim\Loss Summary\clsRefund.vbBusiness\SAIF.Business.UnitStat.Claim\Loss Summary\clsThirdPartyPrediction.vbBusiness\SAIF.Business.UnitStat.Claim\Loss Summary\clsNDReimbursement.vbBusiness\SAIF.Business.UnitStat.Claim\Loss Summary\clsVoidedClaimOffsets.vb