Skip to content

801 document management

Each Online 801 electronic submission can have one or more supporting documents (images) attached to it. cls801Document tracks the metadata for each document — file name, document type, and the sequence number that ties it back to CL_801_DOCUMENT — while the actual document content is managed elsewhere. Document delete is present in code but not operational.

Field Value
Operation ID OP-CE-11
Trigger cls801Document CRUD lifecycle (BeforeCreate, BeforeInsert, BeforeUpdate) and cls801DocumentCollection retrieval
Inputs ClaimID, ImageSeqNum, FileName, DocTypeCode, LastUpdateNum
Outputs Persisted CL_801_DOCUMENT row, or a retrieved/sorted document collection
Primary components cls801Document.BeforeCreate, cls801Document.BeforeInsert, cls801Document.BeforeUpdate, cls801DocumentCollection
Entry point Business\SAIF.Business.Claim.Entry\Online801\Submission\cls801Document.vb

Steps

  1. Reserve a document sequence number. BeforeCreate issues a scalar stored-procedure call to obtain the next ImageSeqNum value (SQL-003).
  2. Insert the document metadata row. BeforeInsert binds ClaimID, ImageSeqNum, FileName, and DocTypeCode, and issues the insert through PK82538_ONLINE_801_CLAIM.document_insert (SQL-011, CL_801_DOCUMENT).
  3. Update the document metadata row under version checking (BR-PROC-003). BeforeUpdate binds the caller-supplied LastUpdateNum alongside the updated fields, and the underlying procedure call rejects the update unless the supplied version matches the current row (SQL-023, CL_801_DOCUMENT).
  4. If the rows-affected value is not 1: add an UpdateError broken rule (BR-CE-011).
  5. Retrieve and sort documents for a claim. cls801DocumentCollection calls document_select (or document_select_by_imageseqnum for a single document) to load the document metadata rows tied to a claim, then sorts the collection for display.*
  6. Delete is prepared but not wired. cls801Document prepares delete parameters, but its criteria class throws InvalidSQLProperty for DeleteSQL, so calling delete on a document object does not reach a working document_delete procedure call.*

Process flow

flowchart TD
    Start([Caller manages an<br>Online 801 document]) --> Mode{Create, update,<br>or retrieve?}
    Mode -->|Create| Seq[Reserve next<br>ImageSeqNum]
    Seq --> Insert[Insert CL_801_DOCUMENT<br>via document_insert]
    Mode -->|Update| Update[Update row via<br>document_update, checking LastUpdateNum]
    Update --> Rows{RowsAffected = 1?}
    Rows -->|No| Conflict([Raise UpdateError])
    Rows -->|Yes| Done([Document updated])
    Mode -->|Retrieve| Select[Call document_select /<br>document_select_by_imageseqnum]
    Select --> Sort[Sort document collection]
    Sort --> Return([Return document<br>collection])
    Insert --> Return

Failure and edge-case behavior

  • Deleting Online 801 documents is not operational: the criteria class throws InvalidSQLProperty for DeleteSQL, so no document_delete procedure is wired despite delete parameters being prepared in cls801Document.*
  • document_select and document_select_by_imageseqnum are not individually catalogued as SQL-* documents in this run; they are traced from cls801DocumentCollection call sites rather than linked to a numbered SQL catalog entry.*
  • Version checking on update relies entirely on the caller supplying an accurate LastUpdateNum (BR-PROC-003); a stale value produces the same UpdateError broken rule as a genuine concurrent edit.

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\Online801\Submission\cls801Document.vb