Loss summary maintenance¶
clsLossSummary is the persisted record of a claim's reportable loss totals. Beyond plain CRUD, it derives its medical and indemnity totals from the sum of its child LossCategories (each an US_LOSS_CATEGORY row with US_LOSS_CATEGORY_OFFSET children), applies a settlement/third-party-prediction floor to indemnity amounts, and determines whether a claim counts as "Part B only" by delegating to coverage-combination and claim-data lookups. Persisted totals always reflect the derived values rather than any raw amount a caller might otherwise set.
| Field | Value |
|---|---|
| Operation ID | OP-USC-03 |
| Trigger | NewLossSummary(dpi, claimID) to create, GetLossSummary(dpi, claimID) to retrieve, followed by Save() or Delete() |
| Inputs | ClaimID, ValueDate (optional override), child LossCategories collection |
| Outputs | Persisted or retrieved US_LOSS_SUMMARY row with derived TotalIncurredMedicalAmount, TotalIncurredIndemnityAmount, TotalPaidMedicalAmount, TotalPaidIndemnityAmount |
| Primary components | clsLossSummary, clsLossSummaryCollection |
| Entry point | Business\SAIF.Business.UnitStat.Claim\Loss Summary\clsLossSummary.vb, Business\SAIF.Business.UnitStat.Claim\Loss Summary\clsLossSummaryCollection.vb |
Steps¶
- Value-date resolution.
clsLossSummaryexposes aValueDateproperty that defaults to the current retrieval/valuation date but can be overridden by the caller before a valuation pass — the override lookup allows callers (chiefly loss valuation orchestration) to value a summary as of an arbitrary historical date rather than "now". - Coverage/claim delegation.
CoverageCodeandIsOnlyClaimPartBare computed by delegating to same-library helpers and an external claim-data object: IsOnlyClaimPartBcallsclsCoverageCombination.IsNotCoverageCombinationPartA(see Coverage combination management) to determine whether the claim is excluded from being a Part-A member, then inspects the claim's coverage code.-
The underlying claim coverage code and related claim attributes are retrieved via
clsClaimData.Origin:
-clsClaimDatais implemented inSAIF.Business.View.Claim, which is documented in its previous (pre-migration) format and has no corresponding per-operation anchor for this specific lookup. See SAIF.Business.View.Claim operations and processes. 3. Derived totals.TotalIncurredMedicalAmountandTotalPaidMedicalAmountsum the corresponding amounts across all childLossCategories.TotalIncurredIndemnityAmountandTotalPaidIndemnityAmountdo the same but additionally compute a floor from anySETL-category child offset whoseOffsetTypeCodeisTPN(third-party-prediction, non-lien): if the summed category total is below that floor, the floor is used instead; the final result is then clamped to a minimum of zero (BR-006). 4. Retrieve.BeforeRetrievebindsClaimIDand executes (SQL-011, DUAL — the retrieval select is built fromdualplus inline package-function calls rather than a direct table join):AfterRetrieve: loads the returned columns, retrieves the childLossCategoriescollection, and callsMarkOld(). 5. Insert / update.BeforeInsert(SQL-006) andBeforeUpdate(SQL-021) against US_LOSS_SUMMARY both bind the four derived total properties —TotalIncurredMedicalAmount,TotalIncurredIndemnityAmount,TotalPaidMedicalAmount,TotalPaidIndemnityAmount— as the parameter values forINCURRED_MEDICAL_AMOUNT,INCURRED_INDEMNITY_AMOUNT,PAID_MEDICAL_AMOUNT, andPAID_INDEMNITY_AMOUNTrespectively, rather than any raw backing-field amount a caller might have set directly (BR-007). -AfterInsert/AfterUpdate: standard rows-affected check; on success cascadesSave()to the childLossCategoriescollection and callsMarkOld(). 6. Delete.BeforeDeleteexecutes (SQL-026, US_LOSS_SUMMARY): -AfterDelete: standard rows-affected check; on success callsMarkNew(). 7. Validity quirk.clsLossSummary.IsValidoverwrites rather than combines its base validity: it executesValid = MyBase.IsValidfollowed immediately byValid = IsChildValid(LossCategories), so the object's final validity reflects only the child-collection check — the base class's own broken-rules result is computed but then discarded rather than being AND-combined with the child result.*
Process flow¶
flowchart TD
Start([Caller requests loss-summary operation]) --> Which{Create, retrieve,<br>update, or delete?}
Which -->|Retrieve| Ret[Select via dual + package functions]
Ret --> LoadCat[Retrieve child LossCategories]
LoadCat --> Loaded([clsLossSummary populated])
Which -->|Insert or Update| Derive[Compute derived totals from LossCategories]
Derive --> Floor{Indemnity total below<br>SETL/TPN floor?}
Floor -->|Yes| Clamp[Raise to floor, then clamp to >= 0]
Floor -->|No| ClampOnly[Clamp to >= 0]
Clamp --> Bind[Bind derived totals to SQL parameters]
ClampOnly --> Bind
Bind --> Exec[Execute insert or update]
Exec --> CascadeSave[Cascade Save to LossCategories]
CascadeSave --> Done([Persisted])
Which -->|Delete| Del[Delete by ClaimID]
Del --> DelDone([Deleted; marked new])
Failure and edge-case behavior¶
IsValiddiscarding the base-class validity result means any broken business rules registered directly againstclsLossSummaryitself (as opposed to its children) do not block a save through the normal validity gate; this is a real quirk in the object's dirty/valid tracking rather than intentional design, based on how the assignment sequence overwrites rather than combines results.*- The indemnity floor/clamp logic runs on every property read, not only at save time, so any UI or caller reading
TotalIncurredIndemnityAmountmid-edit sees the same floored/clamped value that will ultimately be persisted.* - A rows-affected value other than
1on insert, update, or delete adds the framework's standard error/broken-rule entry rather than throwing, consistent with the pattern used elsewhere in this library.*
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\clsLossSummary.vbBusiness\SAIF.Business.UnitStat.Claim\Loss Summary\clsLossSummaryCollection.vb