Skip to content

Serialize import metadata

This operation converts a populated clsImageImport data-transfer object into the fixed-order, newline-delimited KEY=VALUE string contract that downstream consumers (such as SAIF.Services.Printing) send onward as an outbound imaging request payload. It is the only operation this library implements.

Field Value
Operation ID OP-SII-01
Trigger A caller (e.g. clsPrint.ImportInfo) invokes ToString() on a populated clsImageImport instance
Inputs A populated clsImageImport instance — string, numeric, and date properties such as BatID, ClaimID, ClaimNum, CommentText, ImageFileCode, DocumentDate, DocumentDateDays, NPages, PolicyNum, AffiliationId, LegalCaseId, and related task/imaging fields
Outputs A single newline-delimited (vbCrLf-separated) string of KEY=VALUE lines, one per property, in fixed declaration order
Primary components clsImageImport.ToString
Entry point Services\SAIF.Services.Imaging.Import\clsImageImport.vb

Steps

  1. Create a new Text.StringBuilder to accumulate the output.
  2. Append fixed-order lines for string-backed fields — BATID, CLAIMID, CLAIMNUM, CommentText, CreateUser, DiscoveryFlag, DisplayField1–DisplayField3, ImageFileCode, ImageCategoryCode, ImageDocumentTypeCode, ImageDeleteFlag, ImageIndexFlag, ImageDocumentNameCode, ExternalViewCode, SystemGeneratedFlag, AgencyID, ProducerID, GroupAssociationCode, Spec, TaskCategory, TaskMailIDList, TaskPriority, TaskSecurity, TaskText, PolicyAccount, PolicySecuredFlag, LegalCaseNum, LegalCopyToClaimFlag, and LegalDistributionFlag — appending each property's raw value with no blank-suppression logic.
  3. For DocumentDate, ReceivedDate, and TaskDate, emit the value formatted as MM-dd-yyyy only when the value is strictly between Date.MinValue and Date.MaxValue; otherwise emit the key with a blank value (BR-002).
  4. If the date is at either sentinel bound: append the key with an empty value instead of a formatted date.
  5. For DocumentDateDays, ImageSeqNum, NPages, PolicyNum, AffiliationId, and LegalCaseId, emit the numeric value only when it is greater than zero; otherwise emit the key with a blank value (BR-001).
  6. If the numeric value is zero or negative: append the key with an empty value instead of the number.
  7. Return the completed string via Result.ToString.

Process flow

The following diagram visualizes the serialization control flow, including the two conditional formatting branches applied while building the output.

flowchart TD
    Start([Caller invokes ToString]) --> Build[Create StringBuilder]
    Build --> AppendStrings[Append fixed-order string fields]
    AppendStrings --> Dates{Date between<br>MinValue and MaxValue?}
    Dates -->|Yes| FormatDates[Append MM-dd-yyyy]
    Dates -->|No| BlankDates[Append blank date value]
    FormatDates --> Numbers{Numeric value greater than 0?}
    BlankDates --> Numbers
    Numbers -->|Yes| AppendNumbers[Append numeric value]
    Numbers -->|No| BlankNumbers[Append blank numeric value]
    AppendNumbers --> Finish([Return completed string])
    BlankNumbers --> Finish

Failure and edge-case behavior

  • Empty or default string properties are still emitted as keys with blank values; there is no omission of unset string fields.
  • Date properties at the Date.MinValue/Date.MaxValue sentinel bounds serialize as blank rather than as a formatted date (BR-002).
  • Zero or negative numeric properties serialize as blank rather than as 0 or a negative value (BR-001).
  • The method performs no validation of field combinations, string lengths, or required values before returning the payload; malformed or incomplete data is serialized as-is.

Sources

  • Services\SAIF.Services.Imaging.Import\clsImageImport.vb