Skip to content

Coverage combination management

A coverage combination connects two claims — one with coverage code A and one with coverage code B — that occur to the same worker on the same injury date. clsCoverageCombination maintains a single combination row, while clsCoverageCombinationCollection retrieves every combination row in the table for lookup or bulk-processing scenarios. Other library operations (loss-summary maintenance, in particular) use the Part-A/Part-B lookups to decide how to summarize Part-B-only claims.

Field Value
Operation ID OP-USC-01
Trigger Caller calls NewCoverageCombination(dataportal, partAClaimID, partBClaimID) to create, GetCoverageCombination(dataportal, claimID) or GetCoverageCombination(dataportal, partAClaimID, partBClaimID) to retrieve a single row, or clsCoverageCombinationCollection.GetCoverageCombinationCollection(dataportal) to retrieve all rows, then calls Save() or Delete()
Inputs PartAClaimID, PartBClaimID, ClaimID (alternate retrieval key)
Outputs Persisted or retrieved US_COVERAGE_COMBINATION row(s); boolean part-A/part-B membership results from the shared IsCoverageCombinationPartA / IsNotCoverageCombinationPartA / IsCoverageCombinationPartB / IsNotCoverageCombinationPartB properties
Primary components clsCoverageCombination, clsCoverageCombinationCollection
Entry point Business\SAIF.Business.UnitStat.Claim\Coverage Combination\clsCoverageCombination.vb, Business\SAIF.Business.UnitStat.Claim\Coverage Combination\clsCoverageCombinationCollection.vb

Steps

  1. Create. NewCoverageCombination(inDataportal, inPartAClaimID, inPartBClaimID) builds a Criteria object carrying the two claim IDs and marks it RetrieveType = NaturalKey; clsCoverageCombination.Create then requests the next Oracle sequence value via MyCriteria.DataPortalInfo.GetNextSeqNum("COVERAGE_COMBINATION_SEQ") (SQL-001, DUAL) and copies PartAClaimID/PartBClaimID from the criteria into the new object.
  2. Insert. BeforeInsert binds the generated CoverageCombinationSeqNum, PartAClaimID, PartBClaimID, and a freshly-set UpdateNum = 0, UpdateUser, and UpdateDate, then executes (SQL-002, US_COVERAGE_COMBINATION) (BR-004):
    INSERT INTO us_coverage_combination (
           coverage_combination_seq_num, parta_claim_id, partb_claim_id,
           update_num, update_date, update_user)
    VALUES (:CoverageCombinationSeqNum, :PartAClaimID, :PartBClaimID,
           :UpdateNum, :UpdateDate, :UpdateUser)
    
  3. AfterInsert: if rows affected <> 1, adds InsertError ("Insert Failed"); otherwise calls MarkOld().
  4. Retrieve a single combination. BeforeRetrieve builds the base select and appends one of two WHERE clauses depending on RetrieveType (SQL-017, US_COVERAGE_COMBINATION):
  5. by claim ID: Where PartA_Claim_ID = :ClaimID Or PartB_Claim_ID = :ClaimID
  6. by natural key: Where PartA_Claim_ID = :PartAClaimID And PartB_Claim_ID = :PartBClaimID
  7. AfterRetrieve: loads the first returned row into the object, if any, and calls MarkOld().
  8. Delete. BeforeDelete binds PartAClaimID and PartBClaimID and executes:
    DELETE us_coverage_combination
     Where PartA_Claim_ID = :PartAClaimID
       And PartB_Claim_ID = :PartBClaimID
    
  9. AfterDelete: if rows affected <> 1, adds a DB contention error message; otherwise calls MarkNew().
  10. Retrieve all combinations (collection). clsCoverageCombinationCollection.BeforeRetrieve selects every row with no WHERE clause (SQL-017, US_COVERAGE_COMBINATION):
    Select US_COVERAGE_COMBINATION.COVERAGE_COMBINATION_SEQ_NUM as CoverageCombinationSeqNum,
           US_COVERAGE_COMBINATION.PARTA_CLAIM_ID as PartaClaimID,
           US_COVERAGE_COMBINATION.PARTB_CLAIM_ID as PartbClaimID,
           US_COVERAGE_COMBINATION.UPDATE_NUM as UpdateNum,
           US_COVERAGE_COMBINATION.UPDATE_DATE as UpdateDate,
           US_COVERAGE_COMBINATION.UPDATE_USER as UpdateUser
    From US_COVERAGE_COMBINATION
    
  11. AfterRetrieve: instantiates a clsCoverageCombination per row, calls Load(...), and adds it to the collection.
  12. Part-A / Part-B membership lookups. IsCoverageCombinationPartA(dpi, claimId) retrieves the combination by claimId and compares its PartAClaimID to the input; IsNotCoverageCombinationPartA negates the result. IsCoverageCombinationPartB / IsNotCoverageCombinationPartB do the equivalent comparison against PartBClaimID. These are used elsewhere in the library (loss-summary maintenance) to detect a Part-B claim that is not part of any combination.
  13. On failure: if no combination row exists for the claim, the underlying GetCoverageCombination(dpi, claimId) call surfaces whatever the framework retrieval returns for a missing row.**

Process flow

flowchart TD
    Start([Caller requests coverage-combination operation]) --> Which{Create, retrieve,<br>or delete?}
    Which -->|Create| Seq[Get next Oracle sequence value]
    Seq --> Insert[Insert US_COVERAGE_COMBINATION row]
    Insert --> InsRows{RowsAffected = 1?}
    InsRows -->|No| InsErr([InsertError added])
    InsRows -->|Yes| InsOk([Marked old; combination persisted])
    Which -->|Retrieve single| RetKey{RetrieveType?}
    RetKey -->|ClaimID| RetByClaim[Select by PartA or PartB = ClaimID]
    RetKey -->|NaturalKey| RetByKey[Select by PartA and PartB]
    RetByClaim --> Loaded([Object loaded; marked old])
    RetByKey --> Loaded
    Which -->|Retrieve all| RetAll[Select all rows, no WHERE]
    RetAll --> Collection([Collection populated])
    Which -->|Delete| Del[Delete by PartA and PartB]
    Del --> DelRows{RowsAffected = 1?}
    DelRows -->|No| DelErr([DB contention error added])
    DelRows -->|Yes| DelOk([Marked new; row removed])

Failure and edge-case behavior

  • A rows-affected value of 0 on insert adds InsertError; on delete it adds a DB contention error — neither raises an exception, so callers must inspect the broken-rule/error collection after Save().
  • clsCoverageCombination has no update path: only create, delete, and retrieve are implemented. AddBusinessRules() is empty, so no property-level validation runs on this object.*
  • clsCoverageCombinationCollection.Criteria carries its own template copies of the create, insert, update, and delete SQL properties (SQL-001 sequence select, SQL-003 insert, SQL-018 update, SQL-023 delete) — but the collection's BeforeCreate, Create, AfterCreate, BeforeInsert, BeforeUpdate, and BeforeDelete overrides are all commented out, so none of these four statements ever executes; they are dead code left over from the CodeGen2 template.*
  • Only clsCoverageCombination's own delete path executes an active delete (SQL-022); the collection cannot delete rows itself.*
  • The collection's Create/BeforeCreate/AfterCreate overrides are also commented out, so the collection itself cannot be used to create new combination rows; only the single-object clsCoverageCombination.Create path does that.*

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\Coverage Combination\clsCoverageCombination.vb
  • Business\SAIF.Business.UnitStat.Claim\Coverage Combination\clsCoverageCombinationCollection.vb