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

# BillAuditEngine.AuditResults

`BillAuditEngine.AuditResults` is a public enum in `SAIF.Business.Claim.Bill.AutomatedAudit` that reports the outcome of a single call to `BillAuditEngine.AuditBill()`. The engine sets `AuditResult` to the value matching the first stage of the audit pipeline that failed (bill validation, status check, bill/service edits, audit generation, the automated audit check, or the final save), or to `Success` if every stage passed. Callers inspect this value (surfaced via the `AuditResult` property) to determine whether the bill was actually audited and, if not, at which stage processing stopped.

## Purpose
- Communicates the specific stage of `AuditBill()` that stopped a bill from completing the automated audit, distinguishing business-rule rejections (invalid bill/status, failed edits, failed audit check) from processing failures (failed generation/save, environment errors).
- Lets calling code decide whether a bill should be retried, corrected and resubmitted, or escalated, based on which stage failed.
- `AuditBill()` returns `False` only for `EnvironmentError`, `FailAuditGeneration`, and `FailAuditSave` — all other non-`Success` values are treated as a completed (but unsuccessful) audit and still return `True`.

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| Success | `Success = 0` | The bill passed validation, status check, bill/service edits, audit generation, the automated audit check, and the save — the default value set at the start of `AuditBill()` and left unchanged when every stage succeeds. |
| InvalidBill | `InvalidBill = 1` | `Bill.IsValid` returned `False`; the bill failed validation before auditing began and no data was saved. `AuditResultMessage` is populated from `Bill.ErrorMessages`. |
| InvalidStatus | `InvalidStatus = 2` | The bill's `CurrentBillStatus` was not `Audited` or `Approved` — the audit only proceeds for bills already in one of those statuses. |
| FailBillEdits | `FailBillEdits = 3` | `BillEditor.EditBill()` returned `False`; the bill itself failed its edit checks. Service data generated specifically for this audit attempt is removed. |
| FailServiceEdits | `FailServiceEdits = 4` | The bill's service-level edits (`PassServiceEdits`) failed, so the audit did not proceed to the audit-check stage. |
| FailAuditCheck | `FailAuditCheck = 5` | `BillAuditor.AuditBill()` returned `False`; the bill passed edits but failed the automated audit rules. `AuditResultMessage` is populated from `BillAuditor.ErrorMessages`. |
| FailAuditGeneration | `FailAuditGeneration = 6` | `GenerateAuditData()` failed before any database changes were made; this is a processing failure, not a business-rule rejection, so `AuditBill()` returns `False`. |
| FailAuditSave | `FailAuditSave = 7` | `SaveAuditData()` failed after the audit was generated and checked; the audit results could not be persisted, so `AuditBill()` returns `False`. |
| EnvironmentError | `EnvironmentError = 8` | An unhandled exception was caught during `AuditBill()` (e.g., database/connectivity failure); the exception is recorded in `m_AuditExceptions` and `AuditBill()` returns `False`. |
| Unknown | `Unknown = 9` | The default/uninitialized state of `m_AuditResult` before `AuditBill()` has been called for the current instance. |

## Behavioral notes
- `BillAuditEngine.AuditResults` 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`.
- The values are set in the order the corresponding checks run inside `AuditBill()`: bill validity, bill status, bill edits, service edits, the automated audit check, audit generation, and finally the save — so the enum value reported reflects the first failing stage, not necessarily the only one.

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

## Sources
- `Business\SAIF.Business.Claim.Bill.AutomatedAudit\BillAuditEngine.vb`
