Skip to content

Run case search and predictions

This operation groups the analytical and lookup surfaces of the library: case search (clsThrdpartyCaseSearch(Collection)) filters open/pending cases by adjuster and status criteria; predictions (clsThrdpartyPrediction(Collection/Detail)) project recoverable amounts per lien category and are the only class in this group with save behavior and business rules; statute dates (clsThirdpartyStatuteDate), unit-stat predictions (clsThirdpartyUnitStatPrediction), and claim conditions (clsThrdpartyClaimCondition(Collection)) are read-only supporting lookups.

Field Value
Operation ID OP-TP-07
Trigger clsThrdpartyCaseSearchCollection criteria-based search; clsThrdpartyPrediction.GetThrdpartyPrediction/NewThrdpartyPrediction followed by Save(); direct reads of statute date, unit-stat prediction, and claim condition
Inputs Search criteria (adjuster, status, case type), LienSeqNum, prediction percent factor or amount, prediction status code, claim ID
Outputs Filtered case-search collection; persisted THRDPARTY_PREDICTION/THRDPARTY_PREDICTION_DETAIL rows; read-only statute-date, unit-stat prediction, and claim-condition projections
Primary components clsThrdpartyCaseSearchCollection, clsThrdpartyPrediction.AddBusinessRules, clsThrdpartyPrediction.ValidDispersement
Entry point Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyCaseSearchCollection.vb

Steps

  1. Run a case search. clsThrdpartyCaseSearchCollection builds a criteria-driven query and retrieves matching cases (SQL-048, THRDPARTY_CASE); no business rules are registered on the search collection — filtering is expressed entirely through the criteria object and package query.*
  2. Create or retrieve a prediction. Retrieval reads predictions by lien/case (SQL-044, THRDPARTY_PREDICTION).
  3. Validate the prediction (IsValid), most checks active only while the prediction is dirty:
  4. Lien sequence number must be non-zero unless the prediction is being deleted (BR-031).
  5. Prediction percent factor must fall between 0 and 100 (BR-031).
  6. When the prediction is entered as a flat amount (CalcAmountType = Amount), it cannot exceed the sum of the projected and lienable-paid category totals (BR-031).
  7. When the prediction is entered as a flat amount, it cannot be negative (BR-031).
  8. For a final prediction, if total incurred is positive and the calculated incurred percent is below 50%, the prediction status is forced to pending and a warning is raised that supervisor approval is needed; otherwise the status is set to not-required (BR-032).
  9. Dispersement validation (ValidDispersement) recomputes the prediction-detail category total and, when the prediction is percent-driven, cross-checks lienable-paid and projected category totals against the percent factor to confirm the details still reconcile to the prediction amount (BR-032).
  10. Persist the prediction and its detail rows via insert (SQL-021, SQL-020) or update (SQL-075, SQL-074) against THRDPARTY_PREDICTION and THRDPARTY_PREDICTION_DETAIL.
  11. On a rows-affected value other than 1: an insert/update error message is added.
  12. Read statute dates. clsThirdpartyStatuteDate retrieves a read-only projection of statute-of-limitations dates for reporting (SQL-047); no business rules are registered.*
  13. Read unit-stat predictions. clsThirdpartyUnitStatPrediction retrieves a read-only unit-stat forecast used to schedule the "Unit Stat Prediction Due" task in Maintain recovery case (SQL-067); no business rules are registered.*
  14. Read claim conditions. clsThrdpartyClaimCondition(Collection) retrieves a read-only list of medical/claim conditions associated with a claim, used to contextualize recovery predictions (SQL-036); no business rules are registered.*

Process flow

The following diagram visualizes prediction validation, the only write-capable path in this operation.

flowchart TD
    Start([Caller creates or edits<br>a prediction]) --> Basic[Validate lien seq number,<br>percent factor]
    Basic --> AmountType{CalcAmountType?}
    AmountType -->|Amount| AmountRules[Validate amount <= projected<br>+ lienable paid; amount >= 0]
    AmountType -->|PercentFactor| SkipAmount[Skip flat-amount checks]
    AmountRules --> Approval{Final prediction?}
    SkipAmount --> Approval
    Approval -->|Yes, incurred% < 50| WarnApproval([Warning: pending<br>supervisor approval])
    Approval -->|Yes, incurred% >= 50| NotRequired[Status set to NOTR]
    Approval -->|No| Dispersement[Validate detail totals<br>reconcile to prediction amount]
    WarnApproval --> Dispersement
    NotRequired --> Dispersement
    Dispersement --> Ok{All rules pass?}
    Ok -->|No| Fail([Broken rules returned])
    Ok -->|Yes| Save[Insert or update prediction<br>and detail rows]
    Save --> Rows{RowsAffected = 1?}
    Rows -->|No| Contention([Insert/Update error added])
    Rows -->|Yes| Done([Prediction persisted])

Failure and edge-case behavior

  • The supervisor-approval-needed check (ValidPercentNeedsApproval) mutates PredictionStatusCode as a side effect of validation rather than only reporting pass/fail, so re-running IsValid can change the object's state.*
  • Case search, statute-date, unit-stat prediction, and claim-condition classes have no registered business rules — they are pure read/reporting projections with no BOF-level validation of their own.*
  • A rows-affected value other than 1 on prediction insert or update is treated as a DB contention failure rather than an exception (BR-005).
  • The dispersement check only fully cross-validates category totals when the prediction is percent-driven; flat-amount predictions rely solely on the projected/lienable-paid ceiling check.*

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

Sources

  • Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyCaseSearch.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyCaseSearchCollection.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyPrediction.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyPredictionCollection.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyPredictionDetail.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyPredictionDetailCollection.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThirdpartyStatuteDate.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThirdpartyUnitStatPrediction.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyClaimCondition.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyClaimCondtionCollection.vb