﻿---
title: SAIF.Business.Claim.Bill architecture
summary: SAIF.Business.Claim.Bill architecture.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-28
library: SAIF.Business.Claim.Bill
reference_type: package
---

# SAIF.Business.Claim.Bill architecture

SAIF.Business.Claim.Bill is the claim-domain medical-bill business library for bill persistence, audited service adjustments, MCO billing, payment requests, support lookups, and imaging-based bill retrieval.

## Responsibilities
- Persist medical bills, bill services, diagnoses, procedures, statuses, and payment requests.
- Maintain audited services, adjustments, and audit messages.
- Support MCO billing scenarios and national drug validation.
- Expose supporting-data lookups for audit categories, diagnosis codes, service codes, and provider-related billing data.
- Configure and call the imaging API for bill-image operations.

## Component boundaries
- Core BOF business objects own bill, service, diagnosis, adjustment, and status lifecycle operations.
- Audit-support modules and services provide read-oriented support data and validation helpers.
- `clsCallImageApi` is the integration boundary to the imaging client and environment-service configuration.
- View libraries provide read-only claim/provider context instead of being reimplemented locally.
- The library is a reusable base for the automated-audit extension library.

## Interaction model
Claim-bill workflows retrieve or save bill aggregates through BOF criteria objects and Oracle tables, enrich those workflows with audit-support lookups and national-drug validation, and optionally call the imaging API for bill documents. The library combines direct table CRUD, read-only support queries, and one supporting stored-procedure path inside the same package.

## Inherited framework context (from Legends CLI)
- `IBusinessCriteria` supplies the CRUD SQL contract used by bill, service, diagnosis, adjustment, and payment-request criteria objects.*
- `IDataPortalInfo` provides the portal abstraction used for scalar execution, result-set retrieval, and database sequence access behind bill workflows.*
- `clsBusinessBase` contributes edit lifecycle behavior and the shared rules-manager model used by mutable bill objects.*
- `clsBusinessCollectionBase` contributes traversal, deleted-item tracking, and validation-state aggregation for bill collections.*

## Architecture diagram
The following diagram shows the high-level medical-bill component architecture.

```mermaid
flowchart TD
    Consumer["Claim bill consumer"] --> Core["Bill core business objects"]
    Core --> Audit["Audit support and lookups"]
    Core --> Imaging["clsCallImageApi"]
    Core --> ViewClaim["SAIF.Business.View.Claim"]
    Core --> ViewProvider["Provider view data"]
    Core --> DPI["IDataPortalInfo"]
    Audit --> DPI
    DPI --> Oracle["Oracle CBP / claim tables"]
    Imaging --> ImagingApi["Imaging API"]
```

## Sequence diagram
The following diagram shows a representative bill retrieval and enrichment sequence.

```mermaid
sequenceDiagram
    participant Consumer
    participant Bill as clsBill
    participant DPI as IDataPortalInfo
    participant Oracle
    participant Image as clsCallImageApi
    Consumer->>Bill: Retrieve or save bill
    Bill->>DPI: Execute bill criteria SQL
    DPI->>Oracle: CRUD / lookup queries
    Oracle-->>DPI: Bill, service, and audit data
    DPI-->>Bill: Hydrated bill aggregate
    opt Bill image required
        Bill->>Image: Request image endpoint
        Image-->>Bill: Imaging client response
    end
    Bill-->>Consumer: Bill result
```

## Design constraints
- The library is strongly coupled to Oracle CBP billing tables and supporting lookups.
- Imaging operations require `imagingApiUrl` from the environment service plus Oracle provider registration in config.
- Audit-support data and mutable bill objects coexist in one package, so change impact crosses read-only and CRUD paths.
- Downstream automated-audit components extend this library rather than duplicating core bill persistence.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Database tables](database-tables.md)
- [SQL catalog](sql/index.md)
- [Procedures](procedures/index.md)
- [Configuration](configuration.md)
- [API reference](api/index.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
- `Business\SAIF.Business.Claim.Bill\SAIF.BOF.Business.Claim.Bill.vbproj`
- `Business\SAIF.Business.Claim.Bill\SAIF.BOF.Business.Claim.Bill.nuspec`
- `Business\SAIF.Business.Claim.Bill\packages.config`
- `Business\SAIF.Business.Claim.Bill\clsCBPBillPaymentRequest.vb`
- `Business\SAIF.Business.Claim.Bill\clsCallImageApi.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsBill.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsAudit.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsAuditedService.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsAuditedServiceAdjustment.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsAuditMessage.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsBillDiagnosis.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsBillProcedure.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsBillService.vb`
- `Business\SAIF.Business.Claim.Bill\Core\clsBillStatus.vb`
- `Business\SAIF.Business.Claim.Bill\MCOSupport\clsMCOBill.vb`
- `Business\SAIF.Business.Claim.Bill\AuditSupport\Services\clsNationalDrug.vb`
- `Business\SAIF.Business.Claim.Bill\AuditSupport\mdlCBPSupportingData.vb`