---
title: Number claim / manual claim validation
summary: Assigns the next system-generated SAIF claim number or validates and normalizes a manually entered claim number, including its check digit.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Business.Claim.Entry
reference_type: package
operation_id: OP-CE-05
trigger: Caller calls NumberClaim or ValidManualClaim before saving a claim
---

# Number claim / manual claim validation

Every claim needs a `SaifClaimNum` before it is considered complete. Most claims are numbered automatically from a sequence; a smaller set of claims (e.g., re-keyed or corrected claims) receive a manually entered claim number that must be validated, normalized to a fixed length, and given a fresh check digit before it is accepted.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-CE-05 |
| **Trigger** | Caller calls `NumberClaim` (system-assigned) or `ValidManualClaim` (manual entry) prior to `Save()` |
| **Inputs** | For `NumberClaim`: none required beyond the claim object itself. For `ValidManualClaim`: a candidate manual claim number string |
| **Outputs** | Assigned/validated `SaifClaimNum` with a recalculated check digit, or a broken-rule entry rejecting the manual number |
| **Primary components** | `clsClaimEntry.NumberClaim`, `clsClaimEntry.ValidManualClaim` |
| **Entry point** | `Business\SAIF.Business.Claim.Entry\clsClaimEntry.vb` |

## Steps

1. **System numbering path (`NumberClaim`).** The method accepts an optional `inClaimNumber` argument that is declared but never read inside the method body; regardless of what is passed, the method proceeds to obtain the next value from the claim-number sequence ([SQL-002](../sql/SQL-002.md)).*
   - The sequence value is combined with a computed check digit to form the final `SaifClaimNum`.
2. **Manual numbering path (`ValidManualClaim`).** The caller-supplied string is checked for uniqueness against existing claims and, if numeric, against the maximum allowed value of `7799999` ([BR-CE-003](../business-rules.md#br-ce-003-manual-claim-number-must-not-already-exist-and-must-not-exceed-7799999-if-numeric)).
   - If the number already exists, or is numeric and exceeds `7799999`: reject the input and add a broken rule; the claim's `SaifClaimNum` is left unchanged.
   - If the number passes both checks: proceed to step 3.
3. **Normalize and re-check-digit the accepted manual number** ([BR-CE-014](../business-rules.md#br-ce-014-accepted-manual-claim-numbers-are-truncated-to-seven-characters-with-a-recalculated-check-digit)). The accepted string is truncated to seven characters and a fresh check digit is computed and appended, producing the final `SaifClaimNum` stored on the claim.
4. **Return the assigned/validated claim number** to the caller for use in subsequent save operations.

## Process flow

```mermaid
flowchart TD
	Start([Caller requests claim number]) --> Path{System or manual?}
	Path -->|System| Sequence[Fetch next value from<br>claim-number sequence]
	Sequence --> CheckDigit1[Compute check digit]
	CheckDigit1 --> Return([Return SaifClaimNum])
	Path -->|Manual| Exists{Number already exists<br>or exceeds 7799999<br>if numeric?}
	Exists -->|Yes| Reject([Reject: add broken rule])
	Exists -->|No| Truncate[Truncate to 7 characters]
	Truncate --> CheckDigit2[Recalculate check digit]
	CheckDigit2 --> Return
```

## Failure and edge-case behavior

- `NumberClaim`'s `inClaimNumber` parameter is dead code — it is accepted but never referenced in the method body, so callers cannot influence the system-assigned number through this argument.*
- A manual claim number that is non-numeric bypasses the `7799999` ceiling check entirely, since that check is only applied `If IsNumeric(...)`; only the existence check applies to non-numeric input ([BR-CE-003](../business-rules.md#br-ce-003-manual-claim-number-must-not-already-exist-and-must-not-exceed-7799999-if-numeric)).
- Truncating an accepted manual number to seven characters before recalculating the check digit means the persisted claim number's final digit is derived from the truncated value, not the original caller input, which could silently change the number if the caller supplied more than seven characters ([BR-CE-014](../business-rules.md#br-ce-014-accepted-manual-claim-numbers-are-truncated-to-seven-characters-with-a-recalculated-check-digit)).

## Related documentation

- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.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.Claim.Entry\clsClaimEntry.vb`
