---
title: Investigation case retrieval
summary: Retrieves individual investigation cases, active fraud cases, and cross-system case search results, combining inline SQL and the Investigation API.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Business.View.Claim
reference_type: package
operation_id: OP-VC-12
trigger: Caller retrieves `clsInvestigationInfo` by sequence number, calls `clsInvestigationInfoCollection.GetActiveFraudCases`/`FindCases`, or reads investigation header data
---

# Investigation case retrieval

This operation retrieves investigation case data related to claims, workers, policies, or providers. `clsInvestigationInfo` combines an inline-SQL retrieval of a single investigation (joined to its most recent note and status-history rows) with two Investigation API calls: a cross-system case search (`FindCases`) and an investigation header summary lookup. Static code-mapping helpers in `InvestigationCodemaps.vb` translate investigation type, status, subject-type, and identifier-type codes for callers, but are not themselves retrieval operations.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-VC-12 |
| **Trigger** | Caller calls `clsInvestigationInfo.GetInvestigationInfo`/`NewInvestigationInfo` (by sequence number), `clsInvestigationInfoCollection.GetActiveFraudCases`/`FindCases`, or `clsInvestigationInfo.GetInvestigationHeader` |
| **Inputs** | Investigation sequence number; or an identifier (claim number, policy number, SSN/tax ID, or provider) plus OFAC/in-progress inclusion flags for case search |
| **Outputs** | Populated `clsInvestigationInfo` (single case); `clsInvestigationInfoCollection` (active fraud cases or search results); `InvestigationHeader` summary |
| **Primary components** | `clsInvestigationInfo.GetInvestigationInfo`, `clsInvestigationInfo.Criteria.RetrieveSQL`, `clsInvestigationInfoCollection.GetActiveFraudCases`, `clsInvestigationInfo.GetInvestigationFindCases`, `clsInvestigationInfo.GetInvestigationHeader`, `clsInvestigationInfo.FillFindCases` |
| **Entry point** | `Business\SAIF.Business.View.Claim\clsInvestigationInfo.vb`, `Business\SAIF.Business.View.Claim\InvestigationApi\InvestigationFindCases.vb`, `Business\SAIF.Business.View.Claim\InvestigationApi\InvestigationHeader.vb`, `Business\SAIF.Business.View.Claim\InvestigationCodemaps.vb` |

## Steps

1. **Single-case retrieval by sequence number.** `GetInvestigationInfo(dataPortalInfo, investigationSeqNum)` retrieves via inline SQL filtered by `"Where inv.INVESTIGATION_SEQ_NUM = :InvSeqNum"`, joining `INVESTIGATION` to correlated subqueries against `INVESTIGATION_NOTE` and `INVESTIGATION_STATUS_HIST` for the latest note and status.
2. **Enrich with header API data.** `Load(dataPortalInfo, row)` fills the object from the SQL row, then calls `GetInvestigationHeader(investigationSeqNum, "Y")` against the Investigation API route `v1/Integration/Header/{0}/{1}` to layer in header summary fields.
   - On failure: if the header call throws, `result` is reset to a new, empty `InvestigationHeader()` rather than propagating the exception.
3. **Active fraud case search.** `clsInvestigationInfoCollection.GetActiveFraudCases` runs an inline SQL query restricted to fraud-typed, non-closed/cancelled/unassigned investigations ([BR-010](../business-rules.md#br-010-active-fraud-investigation-search-excludes-closed-cancelled-and-unassigned-cases)).
4. **Cross-system case search.** `FindCases(dataPortalInfo, identifier, includeOFAC, includeInProgress)` normalizes the identifier — parsing it as numeric when possible — and delegates to `GetInvestigationFindCases`.
   - If the identifier is numeric: it is passed as `inNum`; otherwise the character form defaults to `"0"` when blank.
5. **Call the Investigation API case search.** `GetInvestigationFindCases` calls the Investigation API route `v1/Cases/FindCases/{0}/{1}/{2}/{3}`.
   - On failure: the method catches the exception and returns an empty result list rather than propagating the error.
6. **Map search results.** `FillFindCases` copies each `InvestigationFindCases` row into a `clsInvestigationInfo`, mapping the OFAC flag (`"Y"` → `True`, otherwise `False`).
7. **Resolve code descriptions.** Callers use `InvestigationCodemaps` helpers (`GetInvestigationTypeCodes`, `GetInvestigationStatusCodes`, `GetSubjectTypeCodes`, `GetIdentifierTypeCodes`) to translate stored codes into enum values and descriptions from `investigation_type_code`, `investigation_status_code`, `subject_type_code`, and `identifier_type_code`.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Caller requests investigation data]) --> Which{Single case, fraud list,<br>or cross-system search?}
	Which -->|Single case by seq num| SqlLoad[Query INVESTIGATION plus<br>latest note and status]
	SqlLoad --> HeaderCall[Call investigation header API]
	HeaderCall --> HeaderOk{Header call succeeds?}
	HeaderOk -->|No| EmptyHeader[Use empty InvestigationHeader]
	HeaderOk -->|Yes| MergeHeader[Merge header fields]
	EmptyHeader --> DoneSingle([Return enriched clsInvestigationInfo])
	MergeHeader --> DoneSingle
	Which -->|Active fraud cases| FraudQuery[Query fraud-typed,<br>non-closed/cancelled/unassigned cases]
	FraudQuery --> DoneFraud([Return fraud-case collection])
	Which -->|Cross-system search| Normalize[Normalize identifier<br>numeric or character]
	Normalize --> SearchApi[Call FindCases API]
	SearchApi --> SearchOk{API call succeeds?}
	SearchOk -->|No| EmptyList([Return empty result list])
	SearchOk -->|Yes| MapResults[Map results via FillFindCases]
	MapResults --> DoneSearch([Return search-result collection])
```

## Failure and edge-case behavior

- A failed header-summary API call is swallowed and replaced with an empty `InvestigationHeader`, so single-case retrieval always succeeds structurally even if header enrichment silently fails.*
- A failed cross-system case search returns an empty list rather than surfacing the underlying exception to the caller, so a real API outage looks identical to "no matching cases" from the caller's perspective.
- `InvestigationCodemaps.vb` contains only static code-to-description/enum mapping logic; it is not itself a retrieval operation and has no independent failure modes beyond its own SQL reads.

## Related documentation

- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **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.View.Claim\clsInvestigationInfo.vb`
- `Business\SAIF.Business.View.Claim\InvestigationApi\InvestigationFindCases.vb`
- `Business\SAIF.Business.View.Claim\InvestigationApi\InvestigationHeader.vb`
- `Business\SAIF.Business.View.Claim\InvestigationCodemaps.vb`
