﻿---
title: "BillAuditEngine"
summary: "API reference for BillAuditEngine."
status: draft
owner: Technical Writer
last_reviewed: 2026-07-28
library: SAIF.Business.Claim.Bill.AutomatedAudit
reference_type: package
---

# BillAuditEngine

Coordinates the end-to-end automated audit of a claim bill, from bill retrieval and validation through audit generation, service editing, and save handling. It exposes the audit result, processed audit data, service counts, trail messages, and captured exceptions for the run.

## Purpose
- Audits a bill by ID with optional forced re-audit and read-only modes.
- Tracks the outcome message, processed audit data, and audited service count for the run.
- Exposes audit trail messages and captured exceptions for downstream review.

## Context
- Namespace: `SAIF.Business.Claim.Bill.AutomatedAudit`
- Assembly/package: `SAIF.Business.Claim.Bill.AutomatedAudit`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| AuditResults | `Enum AuditResults` | Exposes the nested enum `AuditResults`. |
| AuditBill | `Function AuditBill(ByVal inBillID As Decimal,Optional ByVal ForceCompleteReAudit As Boolean = False,Optional ByVal ReadOnlyMode As Boolean = False) As Boolean` | Executes AuditBill and returns the result. |
| New | `Sub New(ByVal inDPI As IDataPortalInfo)` | Performs the New operation. |
| IsForcedCompleteReAudit | `ReadOnly Property IsForcedCompleteReAudit As Boolean` | Returns True if the Bill was completely re-audited. |
| IsReadOnlyMode | `ReadOnly Property IsReadOnlyMode As Boolean` | Returns whether the engine is running in read only mode - will not save. |
| ProcessedAuditData | `ReadOnly Property ProcessedAuditData As clsBillAudit` | Returns the processed BillAudit Object. |
| AuditResult | `Property AuditResult() As AuditResults` | Returns the Result of the Audit. |
| AuditedServiceCount | `ReadOnly Property AuditedServiceCount As Integer` | Returns the number of services audited. |
| AuditResultMessage | `Property AuditResultMessage() As String` | Returns the message associated with the result. |
| AuditExceptions | `ReadOnly Property AuditExceptions() As IEnumerable(Of Exception)` | Returns a reference to any exceptions generated during the audit process. |
| TrailMessages | `ReadOnly Property TrailMessages() As IEnumerable(Of String)` | Returns the TrailMessages value. |
| SetAuditVerbose | `Sub SetAuditVerbose(ByVal inVerboseMode As Boolean)` | Performs the SetAuditVerbose operation. |
| SetAuditVerbose | `Sub SetAuditVerbose(ByVal inVerbosity As AuditVerbosity)` | Performs the SetAuditVerbose operation. |

## Inherited public members
Members in this section are inherited from `clsBusinessBase`.
| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| Rules | `Property Rules As clsRulesManager` | Exposes the BOF rules manager used to evaluate object validation rules.* | `saif-framework-core — clsBusinessBase` |
| BeginEdit | `Sub BeginEdit()` | Starts an edit session for n-level undo support.* | `saif-framework-core — clsBusinessBase` |
| CancelEdit | `Sub CancelEdit()` | Cancels the active edit session and reverts pending changes.* | `saif-framework-core — clsBusinessBase` |
| ApplyEdit | `Sub ApplyEdit()` | Commits the active edit session and accepts pending changes.* | `saif-framework-core — clsBusinessBase` |
## Behavioral notes
- `BillAuditEngine` is part of the documented `SAIF.Business.Claim.Bill.AutomatedAudit` public contract.
- Public members are declared in `Business\SAIF.Business.Claim.Bill.AutomatedAudit\BillAuditEngine.vb`.

## Constraints and usage notes
- Consumers should use the documented public members directly when integrating this type.

> **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.AutomatedAudit\BillAuditEngine.vb`