Image collection retrieval¶
Image collection retrieval builds a dynamic, filterable query over the IMAGE/IMGSYS tables and their code tables, returning up to 300 rows for the imaging list/search UI. A related helper, clsExternalImageInfo, retrieves the externally-viewable document type/category metadata (with localized descriptions) used to drive external-facing document pickers.
| Field | Value |
|---|---|
| Operation ID | OP-IMG-05 |
| Trigger | Caller sets filter criteria on clsImageCollection.Criteria and retrieves the collection, or calls clsExternalImageInfo.GetExternalDocumentInfo |
| Inputs | Filter criteria: category codes, document types, file types, claim IDs, date ranges, EAIP period, external view code, batch ID, discovery flag, security level number; for external info: file code and culture code |
| Outputs | A clsImageCollection of IMAGE rows joined with code descriptions (capped at 300 rows), or a List(Of ExternalImageInfo) of externally-viewable document type/category metadata |
| Primary components | clsImageCollection.BeforeRetrieve, clsImageCollection.Criteria.FormatRequest, clsExternalImageInfo.GetExternalDocumentInfo |
| Entry point | Business\SAIF.Business.Imaging\clsImageCollection.vb, Business\SAIF.Business.Imaging\clsExternalImageInfo.vb |
Steps¶
- Caller provides filter criteria to
clsImageCollection.Criteria(category codes, document types, file types, claim IDs, date ranges, EAIP period, external view code, batch ID, etc.). - Default filter values. The criteria defaults
DiscoveryFlag = "N"(clsConstants.No) andSecurityLevelNum = 0unless the caller overrides them. - Build the dynamic WHERE clause.
Criteria.FormatRequestappends optional filter predicates to the base SQL depending on which criteria were supplied — e.g.,AND nvl(IMAGE.IMAGE_DELETE_CODE,' ') = ' 'is always applied to exclude soft-deleted images, andAND IMAGE.DISCOVERY_FLAG = :DiscoveryFlagis added based on the resolved discovery flag.* - Retrieve the collection.
BeforeRetrieveexecutes SQL-021, a dynamically-assembled SELECT joining IMGSYS, IMAGE, and multiple code tables (IMAGE_CATEGORY_CODE, IMAGE_DOCUMENT_TYPE_CODE). - Cap the result set. The default List-mode query wraps the assembled SQL in
where rownum <= 300, limiting results to 300 rows regardless of how many rows match the filter. - Retrieve external document info.
clsExternalImageInfo.GetExternalDocumentInfoexecutes SQL-016, joining IMAGE_FILE_CODE, IMAGE_CATEGORY_CODE, and IMAGE_DOCUMENT_TYPE_CODE (with optional localized_GCODEvariants by culture code), filtered to currently-effective document types for the given file code. - Post-process external info. Callers use
GetExternalDocumentTypes,GetExternalDocumentCategories,GetDocumentTypeCodes, andGetDocumentCategoryCodesto group and filter the retrieved list in memory for cascading drop-downs (document type → category → specific type code).
Process flow¶
The following diagram visualizes the image collection retrieval flow.
flowchart TD
Start([Caller sets filter criteria]) --> Defaults[Apply defaults:<br>DiscoveryFlag = N,<br>SecurityLevelNum = 0]
Defaults --> Format[FormatRequest builds<br>dynamic WHERE clause]
Format --> Retrieve[BeforeRetrieve: SELECT<br>IMGSYS/IMAGE/code tables]
Retrieve --> Cap[Cap to 300 rows<br>rownum <= 300]
Cap --> Done([Return image collection])
StartExt([Caller requests external<br>document info]) --> QueryExt[GetExternalDocumentInfo]
QueryExt --> Group[Group/filter in memory:<br>types, categories, codes]
Group --> DoneExt([Return cascading<br>drop-down data])
Failure and edge-case behavior¶
- The 300-row cap (
rownum <= 300) means callers with broader filter criteria than expected will silently receive a truncated result set rather than an error or a count indicator.* - Soft-deleted images (
IMAGE_DELETE_CODE <> ' ') are always excluded from the collection regardless of other filter criteria. SecurityLevelNumdefaults to0; a value of-1is used internally as a sentinel to indicate "no security filter applied".*
Related documentation¶
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.Imaging\clsImageCollection.vbBusiness\SAIF.Business.Imaging\clsExternalImageInfo.vb