---
title: Claim notes retrieval
summary: Loads claim note rows for a claim, primarily through the claim data API, with a legacy stored-procedure path retained in source.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Business.View.Claim
reference_type: package
operation_id: OP-VC-04
trigger: Caller reads `clsClaimData.ClaimNotes(isInternalUser)`, which retrieves `clsClaimNoteList`
---

# Claim notes retrieval

This operation loads claim note rows for a claim. The live path used by `clsClaimData.ClaimNotes` is API-backed: `clsClaimNoteList` calls the claim conditions/notes API and maps each returned note into a `clsClaimNoteData` instance via `Load`. A separate, older static method on `clsClaimNoteData` (`GetClaimNotes`) retrieves a note through the Oracle stored procedure `pk82281_claim_note.select_by_claimnum`; it is not called from `clsClaimData` and its Oracle package was not found during source review, so it is retained here as a documented but likely unused legacy path.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-VC-04 |
| **Trigger** | Caller reads `clsClaimData.ClaimNotes(inIsInternalUser)`, or directly calls `clsClaimNoteList` retrieval, or calls the legacy `clsClaimNoteData.GetClaimNotes` |
| **Inputs** | Claim ID; internal-user flag (`Y`/`N`) for view filtering; for the legacy path, SAIF claim number and internal-user flag |
| **Outputs** | `clsClaimNoteList` of `clsClaimNoteData` rows (create user, activity date, external-view flag, comment text) |
| **Primary components** | `clsClaimNoteList.BeforeRetrieve`/`AfterRetrieve`, `clsClaimNoteData.Load`, `clsClaimNoteData.GetClaimNotes` (legacy) |
| **Entry point** | `Business\SAIF.Business.View.Claim\clsClaimNoteList.vb`, `Business\SAIF.Business.View.Claim\clsClaimNoteData.vb` |

## Steps

1. **Select the notes route.** `clsClaimNoteList.BeforeRetrieve` sets the API route to the claim-notes endpoint for the given claim ID.
2. **Call the notes API.** The framework dispatches the API request and returns a `ResponseData(Of ClaimNotes)` envelope.
3. **Map note rows.** `AfterRetrieve` checks `StatusCode = HTTP 200` and, when there are notes, constructs one `clsClaimNoteData` per `Note` row using `Load(dataPortalInfo, row)`, which copies create user, activity date, external-view flag, and comment text.
   - On a non-200 status: an error message is added (`"An Error occurred when CCClaimDataApi was called"`) and no notes are added to the collection.
4. **Return the note list.** The populated `clsClaimNoteList` is returned to the caller (e.g. exposed as `clsClaimData.ClaimNotes`).
5. **Legacy stored-procedure path (not called from `clsClaimData`).** `clsClaimNoteData.GetClaimNotes(dataPortalInfo, saifClaimNumber, isInternalUser)` retrieves a single `clsClaimNoteData` through `pk82281_claim_note.select_by_claimnum` ([SQL-006](../sql/SQL-006.md)).
   - Oracle source for this package was not found during source review, so this call path may be dead or environment-specific code.**

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Caller reads ClaimNotes]) --> Route[Set claim-notes API route]
	Route --> Call[Call claim notes API]
	Call --> Status{API status 200?}
	Status -->|No| Err([Error message added; no notes returned])
	Status -->|Yes| Map[Map each Note row to clsClaimNoteData]
	Map --> Done([Return populated clsClaimNoteList])
	Legacy([Legacy: GetClaimNotes<br>stored-procedure path]) -.not invoked by clsClaimData.-> Done
```

## Failure and edge-case behavior

- A non-200 API status yields an empty note list plus an error message rather than a thrown exception, so callers must check for added error messages if they need to distinguish "no notes" from "retrieval failed".
- The legacy stored-procedure retrieval path (`GetClaimNotes`, `pk82281_claim_note.select_by_claimnum`) has no confirmed caller inside this library and its Oracle package was not found in source, so it may be dead or environment-specific code.**

## Related documentation

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

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources

- `Business\SAIF.Business.View.Claim\clsClaimNoteList.vb`
- `Business\SAIF.Business.View.Claim\clsClaimNoteData.vb`
