---
title: Initialize claim data portal
summary: Prepares the claim data portal, default messaging, and lazily-created imaging client for a ClaimAppManager instance.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-30
library: SAIF.Application.Claim
reference_type: package
operation_id: OP-AC-06
trigger: AppManagerBase's construction/initialization sequence calls OnInitialize and OnCreateDataLayer
---

# Initialize claim data portal

This operation prepares a `ClaimAppManager` instance for use: it sets the database user context, seeds a default prompt message, and provisions the Oracle data portal the manager will use for all subsequent claim retrieval and save operations. It also documents the lazily-created imaging API client available on the manager.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-AC-06 |
| **Trigger** | The `AppManagerBase` initialization sequence invokes `OnInitialize()` and `OnCreateDataLayer()` as part of manager construction |
| **Inputs** | Security principal supplied to the manager's constructor; environment configuration (`imagingapiurl`) |
| **Outputs** | `DataLayer.DBUser` set to `"CLM"`; default `Message`; provisioned `ClaimDPI` Oracle portal; lazily-created `ImagingClient` on first access |
| **Primary components** | `ClaimAppManager.OnInitialize`, `ClaimAppManager.OnCreateDataLayer`, `ClaimAppManager.ClaimImageApiClient`, `ApplicationDataAccess`, `ImagingClient` |
| **Entry point** | `Application\SAIF.Application.Claim\ClaimAppManager.vb` |

## Steps

1. `OnInitialize()` sets `DataLayer.DBUser = "CLM"` and `Message = ClaimAppConstants.PLEASEENTERCLAIM` as the manager's starting prompt before any context has been set.

   > **Origin**: `OnInitialize()` overrides the initialization hook defined by `AppManagerBase` in `SAIF.Application`. That library is documented in the previous format, so no per-operation page exists; see [Application context initialization](../../saif-application/operations/application-context-initialization.md) in the `SAIF.Application` documentation set.
2. `OnCreateDataLayer()` attempts to provision the claim data portal:
   - Calls `DataLayer.CreateOraclePortal(ClaimAppConstants.DPIClaimKey)` (portal key `"ClaimDPI"`).
     - Sub-step: `CreateOraclePortal` registers a keyed `IDataPortalInfo` entry through `ApplicationDataAccess`'s portal-registration logic.

       > **Origin**: Portal registration is implemented by `ApplicationDataAccess` in `SAIF.Application`. That library is documented in the previous format, so no per-operation page exists; see [Multi-database portal registration](../../saif-application/operations/multi-database-portal-registration.md) in the `SAIF.Application` documentation set.
   - On failure (`Catch ex As Exception`): calls `MarkContextNotSet()`, calls `MarkNoAccess()`, and throws a new `ApplicationException("Unable to Establish Database Connection", ex)`, wrapping the original exception.
3. `ClaimImageApiClient` is a read-only property, not part of the `OnInitialize`/`OnCreateDataLayer` sequence itself: on first access, if the private backing field is `Nothing`, it creates `New ImagingClient(EnvironmentService.GetConfigSetting("imagingapiurl"))` and caches it for the life of the manager instance.
   - If `imagingapiurl` is not configured in the environment service, `ImagingClient`'s construction behavior with a missing/empty URL is not visible in this library's source.**

## Process flow

The following diagram visualizes portal provisioning and the failure path.

```mermaid
flowchart TD
	Start([Manager construction begins]) --> Init[OnInitialize:<br>DBUser = CLM,<br>Message = PLEASEENTERCLAIM]
	Init --> CreatePortal[OnCreateDataLayer:<br>CreateOraclePortal ClaimDPI]
	CreatePortal --> Result{Portal created?}
	Result -->|Yes| Ready([Manager ready for<br>context and retrieval])
	Result -->|No| Fail[MarkContextNotSet;<br>MarkNoAccess]
	Fail --> Throw([Throw ApplicationException:<br>Unable to Establish Database Connection])
	Ready --> Imaging{ClaimImageApiClient<br>accessed?}
	Imaging -->|Yes, first access| CreateImaging[Create ImagingClient<br>from imagingapiurl config]
	Imaging -->|No| Skip([Imaging client not created])
```

## Failure and edge-case behavior

- A failure to create the Oracle portal marks the manager out of context and denies access before throwing `ApplicationException`, so callers that catch the exception should also expect `NoAccess`/not-set state on the manager.
- The wrapped `ApplicationException` message ("Unable to Establish Database Connection") is generic; the original exception is preserved as the inner exception for diagnostic purposes.
- `ClaimImageApiClient` is created lazily and only once per manager instance; if `imagingapiurl` is missing or invalid, the failure surfaces only when a caller first accesses `ClaimImageApiClient`, not during `OnInitialize()`/`OnCreateDataLayer()`.*

## Related documentation

- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources

- `Application\SAIF.Application.Claim\ClaimAppManager.vb`
- `Application\SAIF.Application.Claim\ClaimAppConstants.vb`
