---
title: Manage recovery participants
summary: Maintains the third-party person, firm, and companion-claim records attached to a recovery case.
status: draft
owner: SAIF
last_reviewed: 2026-07-30
library: SAIF.Business.Claim.ThirdParty
reference_type: package
operation_id: OP-TP-02
trigger: clsThrdparty.GetThrdparty / clsThrdPartyFirm.GetThrdPartyFirm / clsThrdpartyCompanionClaim.GetThrdpartyCompanionClaim followed by property edits and Save()
---

# Manage recovery participants

Recovery participants are the third parties (`clsThrdparty`), their associated firms (`clsThrdPartyFirm`), and any companion claims (`clsThrdpartyCompanionClaim`) attached to a case. Each type is an independent BOF entity keyed by `CaseSeqNum`, but `clsThrdparty` owns and cascades saves to its own firm collection, and `clsThrdpartyCompanionClaim` can pull claim/worker information from another claim before it is saved.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-TP-02 |
| **Trigger** | Retrieval or creation of a `clsThrdparty`, `clsThrdPartyFirm`, or `clsThrdpartyCompanionClaim` instance, followed by property edits and `Save()` |
| **Inputs** | `CaseSeqNum`, person name/birth date/phone/fax/address fields, firm company name/type/phone/fax/address fields, companion claim number |
| **Outputs** | Persisted `THRDPARTY_CASE`-scoped person, firm, and companion-claim rows; resolved carrier/attorney/plaintiff/co-counsel firm sequence numbers; populated companion-claim worker name and confidentiality flag |
| **Primary components** | `clsThrdparty.Save`, `clsThrdparty.SaveFirms`, `clsThrdPartyFirm.AddBusinessRules`, `clsThrdpartyCompanionClaim.GetNewClaimInfo` |
| **Entry point** | `Business\SAIF.Business.Claim.ThirdParty\clsThrdparty.vb` |

## Steps

1. **Retrieve or create the third party.** `clsThrdparty` is keyed by `CaseSeqNum`; retrieval reads the person row and any nested firm collection ([SQL-060](../sql/sql-060-pk82033_thirdparty-thrdparty_select.md), [SQL-061](../sql/sql-061-pk82033_thirdparty-thrdparty_select.md), [THRDPARTY_CASE](../database-tables.md#thrdparty_case)).
2. **Validate the third party (`IsValid`).**
   - Birth date, if entered, must fall between January 1, 1900 and today ([BR-014](../business-rules.md#br-014-third-party-person-requires-a-name-and-a-reasonable-birth-date)).
   - A last name is required unless the third party is itself a firm with a company name, or is linked to a firm in the firm collection that has a company name ([BR-014](../business-rules.md#br-014-third-party-person-requires-a-name-and-a-reasonable-birth-date)).
   - Phone and fax numbers, when the address is domestic (`ForeignAddressFlag = "N"`), must be at least twelve characters if entered at all ([BR-015](../business-rules.md#br-015-third-party-phone-and-fax-numbers-must-be-full-domestic-format-length)).
   - If a nested firm collection has been loaded, its broken rules are propagated to the third party.
3. **Save the firm collection (`SaveFirms` / `Save`).** Before the base save, `clsThrdparty` records whether the carrier or attorney firm sequence number was cleared, then delegates to `SaveChildObject(m_FirmCollection)` ([SQL-025](../sql/sql-025-pk82033_thirdparty-thrdparty_firm_insert.md), [SQL-080](../sql/sql-080-pk82033_thirdparty-thrdparty_firm_update.md), [THRDPARTY_FIRM](../database-tables.md#thrdparty_firm)):
   - On a successful child save, the code re-derives `ThrdpartyFirmSeqNum`, `CarrierFirmSeqNum`, and `AttorneyFirmSeqNum` by scanning the saved collection for `FirmType` equal to `clsThirdPartyConstants.THIRDPARTY_FIRM`, `CARRIER_FIRM`, or `ATTORNEY_FIRM`.
4. **Persist the third-party row** through `MyBase.Save()` (insert or update) — the update path binds all editable person, address, and phone/fax fields ([THRDPARTY_CASE](../database-tables.md#thrdparty_case)).
5. **Clean up transient firm removals.** After the base save, if the carrier or attorney firm sequence number was cleared during this call, the removed firm is taken out of the in-memory collection and the firm collection is re-saved to reflect the removal — mirroring the plaintiff/co-counsel cleanup in the case-header save.
6. **Validate and save the standalone firm (`clsThrdPartyFirm`).** Independently of the third-party aggregate, a firm row can be created or edited directly:
   - Company name is required ([BR-017](../business-rules.md#br-017-third-party-firm-requires-a-company-name-and-full-length-phonefax-numbers)).
   - Phone and fax numbers must be at least twelve characters if entered ([BR-017](../business-rules.md#br-017-third-party-firm-requires-a-company-name-and-full-length-phonefax-numbers)).
   - Save inserts ([SQL-025](../sql/sql-025-pk82033_thirdparty-thrdparty_firm_insert.md)) or updates ([SQL-080](../sql/sql-080-pk82033_thirdparty-thrdparty_firm_update.md)) the `THRDPARTY_FIRM`-scoped row, categorized by `FirmType` (`clsThirdPartyConstants.PLAINTIFF_FIRM`, `COCOUNSEL_FIRM`, `THIRDPARTY_FIRM`, `CARRIER_FIRM`, `ATTORNEY_FIRM`) ([BR-007](../business-rules.md#br-007-firm-associations-use-fixed-recovery-firm-categories)).
   - On a rows-affected value other than `1`: an `InsertError`/`UpdateError`/`DeleteError` message is added.
7. **Validate and save a companion claim (`clsThrdpartyCompanionClaim`).**
   - The companion claim number must resolve to a valid claim via `GetNewClaimInfo`, which issues a reader-based lookup by claim number ([SQL-039](../sql/sql-039-pk82033_thirdparty-companion_claim_select.md), [THRDPARTY_COMPANION_CLAIM](../database-tables.md#thrdparty_companion_claim)) and populates the worker name and claim security info from the returned reader ([BR-016](../business-rules.md#br-016-companion-claim-number-must-resolve-to-a-valid-claim-conflict-claims-warn-of-restricted-access)).
     - If the caller lacks conflict access and the resolved claim is marked confidential/conflict, the worker name is cleared rather than exposed.
   - If the resolved claim is a conflict claim, a warning is raised rather than a hard error, so the record can still be saved ([BR-016](../business-rules.md#br-016-companion-claim-number-must-resolve-to-a-valid-claim-conflict-claims-warn-of-restricted-access)).
   - Save inserts ([SQL-019](../sql/sql-019-pk82033_thirdparty-companion_claim_insert.md)) or updates ([SQL-073](../sql/sql-073-pk82033_thirdparty-companion_claim_update.md)) the `THRDPARTY_COMPANION_CLAIM` row keyed by `CaseSeqNum`/`CompanionSeqNum`, and deletes ([SQL-088](../sql/sql-088-pk82033_thirdparty-companion_claim_delete.md)) it when removed.
   - On a rows-affected value other than `1` for any of insert, update, or delete: the corresponding error message is added.

## Process flow

The following diagram visualizes how the third-party person, its firm collection, and companion claims are validated and saved.

```mermaid
flowchart TD
	Start([Caller retrieves or creates<br>third party / firm / companion claim]) --> Which{Which participant type?}
	Which -->|Third party| TPRules[Validate name, birth date,<br>phone, fax]
	TPRules --> TPOk{Valid?}
	TPOk -->|No| Fail([Broken rules returned])
	TPOk -->|Yes| TPFirms[Save nested firm collection;<br>re-derive carrier/attorney seq nums]
	TPFirms --> TPSave[Persist third-party row]
	Which -->|Standalone firm| FRules[Validate company name,<br>phone, fax]
	FRules --> FOk{Valid?}
	FOk -->|No| Fail
	FOk -->|Yes| FSave[Insert or update THRDPARTY_FIRM]
	Which -->|Companion claim| CLoad[GetNewClaimInfo resolves<br>claim by number]
	CLoad --> CRules{Claim found?}
	CRules -->|No| Fail
	CRules -->|Conflict claim| CWarn[Warning: confidential claim;<br>worker name withheld unless access granted]
	CRules -->|Yes| CSave[Insert, update, or delete<br>THRDPARTY_COMPANION_CLAIM]
	CWarn --> CSave
	TPSave --> Rows{RowsAffected = 1?}
	FSave --> Rows
	CSave --> Rows
	Rows -->|No| Contention([Insert/Update/Delete error added])
	Rows -->|Yes| Done([Changes persisted])
```

## Failure and edge-case behavior

- The third-party name rule accepts a firm's company name as a substitute for a personal last name, so a third party with no personal name can still validate if it is linked to a named firm ([BR-014](../business-rules.md#br-014-third-party-person-requires-a-name-and-a-reasonable-birth-date)).
- Companion-claim conflict handling clears the worker name in memory but still allows the save to proceed with a warning, relying on the caller to respect confidentiality when displaying the record.*
- The carrier/attorney and plaintiff/co-counsel firm-sequence-number cleanup logic in `clsThrdparty.Save` and `clsThirdPartyCase.Save` is duplicated across the two classes rather than shared.*
- A rows-affected value other than `1` on any insert, update, or delete is treated as a DB contention failure rather than an exception ([BR-005](../business-rules.md#br-005-recovery-save-operations-require-one-affected-row)).

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

## Related documentation

- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources

- `Business\SAIF.Business.Claim.ThirdParty\clsThrdparty.vb`
- `Business\SAIF.Business.Claim.ThirdParty\clsThrdPartyFirm.vb`
- `Business\SAIF.Business.Claim.ThirdParty\clsThrdpartyCompanionClaim.vb`
- `Business\SAIF.Business.Claim.ThirdParty\clsThirdPartyConstants.vb`
