---
title: SAIF.Domain business rules
summary: Enumerated business rules with per-rule trigger, enforcement, and outcomes.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Domain
reference_type: package
---

# SAIF.Domain business rules

This page captures the business rules enforced by SAIF.Domain, drawn from the ebilling assignment, indexing, CBP generation, EDI, audit, certificate-holder, Guidewire claim-mapping, and document-packet logic in this library. Origin for every rule is SAIF.Domain; no rule on this page is imported from a dependency package.

## DOM-BR-001 Bill assignment

| Field | Value |
| --- | --- |
| **Statement** | Each pended error on a bill is recorded as an audit note with TypeCode "BE" and Category "B" |
| **Trigger** | Bill assignment |
| **Enforcement** | `BillAssignment.AssignBillResponsibility` |
| **Outcome** | `AuditNote` created |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs` |
| **Operations** | OP-DOM-01 |

---

## DOM-BR-002 Assignment

| Field | Value |
| --- | --- |
| **Statement** | Pended errors on a claim whose worker is a conflict worker go to the confidential assignment rule |
| **Trigger** | Assignment |
| **Enforcement** | `BillAssignment.GetBillAssignmentRule` |
| **Outcome** | Confidential responsible party and status |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs` |
| **Operations** | OP-DOM-01 |

---

## DOM-BR-003 Assignment

| Field | Value |
| --- | --- |
| **Statement** | Pended errors that are not all provider errors go to the claim-error assignment rule |
| **Trigger** | Assignment |
| **Enforcement** | `BillAssignment.GetBillAssignmentRule` |
| **Outcome** | Claim-error party and status |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs` |
| **Operations** | OP-DOM-01 |

---

## DOM-BR-004 Assignment

| Field | Value |
| --- | --- |
| **Statement** | All pended errors being provider errors triggers the provider-error assignment |
| **Trigger** | Assignment |
| **Enforcement** | `BillAssignment.GetBillAssignmentRule` |
| **Outcome** | Provider-error party and status |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs` |
| **Operations** | OP-DOM-01 |

---

## DOM-BR-005 Assignment

| Field | Value |
| --- | --- |
| **Statement** | No pended errors results in the clean assignment |
| **Trigger** | Assignment |
| **Enforcement** | `BillAssignment.GetBillAssignmentRule` |
| **Outcome** | Clean party and status |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs` |
| **Operations** | OP-DOM-01 |

---

## DOM-BR-006 Assignment complete

| Field | Value |
| --- | --- |
| **Statement** | After assignment the ebill status becomes Assigned |
| **Trigger** | Assignment complete |
| **Enforcement** | `BillAssignment.AssignBillsResponsibily` |
| **Outcome** | Ebill status Assigned |
| **Tables** | [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-024](sql/SQL-024-ebill-status-update-assigned.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs` |
| **Operations** | OP-DOM-01 |

---

## DOM-BR-007 Exception

| Field | Value |
| --- | --- |
| **Statement** | Assignment failures are rethrown with the ebill id |
| **Trigger** | Exception |
| **Enforcement** | `BillAssignment.AssignBillsResponsibily` |
| **Outcome** | Exception "Ebill Id: {id}" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs` |
| **Operations** | OP-DOM-01 |

---

## DOM-BR-010 Patient indexing

| Field | Value |
| --- | --- |
| **Statement** | Claim number "UNKNOWN" is not indexable |
| **Trigger** | Patient indexing |
| **Enforcement** | `PatientIndexer.IndexPatientToClaim` |
| **Outcome** | Error "No claim number" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/PatientIndexer.cs` |
| **Operations** | OP-DOM-02 |

---

## DOM-BR-011 Patient indexing

| Field | Value |
| --- | --- |
| **Statement** | The claim number must be 7-8 characters, and an 8-character number must end in a letter |
| **Trigger** | Patient indexing |
| **Enforcement** | `PatientIndexer.IndexPatientToClaim` |
| **Outcome** | Error "Invalid claim number" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/PatientIndexer.cs` |
| **Operations** | OP-DOM-02 |

---

## DOM-BR-012 API exception

| Field | Value |
| --- | --- |
| **Statement** | A ClaimCenter API failure is an indexing error |
| **Trigger** | API exception |
| **Enforcement** | `PatientIndexer.IndexPatientToClaim` |
| **Outcome** | Error "An error occurred in CCClaimDataApi" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/PatientIndexer.cs` |
| **Operations** | OP-DOM-02 |

---

## DOM-BR-013 Null claim

| Field | Value |
| --- | --- |
| **Statement** | The claim must exist in ClaimCenter |
| **Trigger** | Null claim |
| **Enforcement** | `PatientIndexer.IndexPatientToClaim` |
| **Outcome** | Error "Claim not found" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/PatientIndexer.cs` |
| **Operations** | OP-DOM-02 |

---

## DOM-BR-014 Indexing

| Field | Value |
| --- | --- |
| **Statement** | The worker's birth date must equal the patient's birth date |
| **Trigger** | Indexing |
| **Enforcement** | `PatientIndexer.IndexPatientToClaim` |
| **Outcome** | Error "Claim has a missing or unmatched birth date" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/PatientIndexer.cs` |
| **Operations** | OP-DOM-02 |

---

## DOM-BR-015 Post-index check

| Field | Value |
| --- | --- |
| **Statement** | WCD status "void" or claim state "draft" is invalid |
| **Trigger** | Post-index check |
| **Enforcement** | `PatientIndexer.CheckIndexedPatientForClaimErrors` |
| **Outcome** | Error "Invalid claim status" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/PatientIndexer.cs` |
| **Operations** | OP-DOM-02 |

---

## DOM-BR-016 Post-index check

| Field | Value |
| --- | --- |
| **Statement** | Non-complying-employer claims are flagged |
| **Trigger** | Post-index check |
| **Enforcement** | `PatientIndexer.CheckIndexedPatientForClaimErrors` |
| **Outcome** | Error "NCE claim" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/PatientIndexer.cs` |
| **Operations** | OP-DOM-02 |

---

## DOM-BR-020 Provider indexing

| Field | Value |
| --- | --- |
| **Statement** | The billing provider's tax ID must exist |
| **Trigger** | Provider indexing |
| **Enforcement** | `ProviderIndexer` / `ProviderIndexerV2` |
| **Outcome** | Error "Provider Tax Id not found" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexer.cs` |
| **Operations** | OP-DOM-03, OP-DOM-04 |

---

## DOM-BR-021 Provider indexing

| Field | Value |
| --- | --- |
| **Statement** | A bill is institutional when any bill has SetType "INST"; institutional filtering uses provider types NU/HO/HH |
| **Trigger** | Provider indexing |
| **Enforcement** | `ProviderIndexer` / `ProviderIndexerV2` |
| **Outcome** | Filtered candidate list |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexer.cs` |
| **Operations** | OP-DOM-03, OP-DOM-04 |

---

## DOM-BR-022 Address match

| Field | Value |
| --- | --- |
| **Statement** | Addresses match on Line1 and City (trimmed, case-insensitive) and on the zip padded to 5 |
| **Trigger** | Address match |
| **Enforcement** | `ProviderIndexer` |
| **Outcome** | Match / no match |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexer.cs` |
| **Operations** | OP-DOM-03 |

---

## DOM-BR-023 Address match

| Field | Value |
| --- | --- |
| **Statement** | The facility address takes precedence over the physical address; with no physical match the bill fails |
| **Trigger** | Address match |
| **Enforcement** | `ProviderIndexer` |
| **Outcome** | Error "Physical location not found for billing provider" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexer.cs` |
| **Operations** | OP-DOM-03 |

---

## DOM-BR-024 Payment resolution

| Field | Value |
| --- | --- |
| **Statement** | With no payment address, the matched location must have no active PAY address |
| **Trigger** | Payment resolution |
| **Enforcement** | `ProviderIndexer` |
| **Outcome** | Errors "Multiple physical locations found without a payment address" / "Physical location having no payment address not found" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexer.cs` |
| **Operations** | OP-DOM-03 |

---

## DOM-BR-025 Payment resolution

| Field | Value |
| --- | --- |
| **Statement** | With a payment address, the physical and payment matches must intersect by location |
| **Trigger** | Payment resolution |
| **Enforcement** | `ProviderIndexer` |
| **Outcome** | Errors "Multiple physical locations found with matching payment address" / "Payment address not found" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexer.cs` |
| **Operations** | OP-DOM-03 |

---

## DOM-BR-026 V2 indexing

| Field | Value |
| --- | --- |
| **Statement** | Correspondence and expired addresses are excluded from matching |
| **Trigger** | V2 indexing |
| **Enforcement** | `ProviderIndexerV2` |
| **Outcome** | Filtered list |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexerV2.cs` |
| **Operations** | OP-DOM-04 |

---

## DOM-BR-027 V2 indexing

| Field | Value |
| --- | --- |
| **Statement** | Provider-type filter: Pharmacy=PH, Dental=DE, Hospital=HO/NU/HH, Professional=all others |
| **Trigger** | V2 indexing |
| **Enforcement** | `ProviderIndexerV2` |
| **Outcome** | Filtered list |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexerV2.cs` |
| **Operations** | OP-DOM-04 |

---

## DOM-BR-028 V2 indexing

| Field | Value |
| --- | --- |
| **Statement** | A biller with physical, payment and facility addresses uses the PaymentAndFacility and ThreeAddressNoFacilityMatches rules; otherwise PaymentAndFacility, PhysicalAndPayment, PhysicalAndFacility, PhysicalOnly and PhysicalOnlyMatchPhysicalWithPayment |
| **Trigger** | V2 indexing |
| **Enforcement** | `ProviderIndexerV2` |
| **Outcome** | Rule set selected |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexerV2.cs` |
| **Operations** | OP-DOM-04 |

---

## DOM-BR-029 Matching

| Field | Value |
| --- | --- |
| **Statement** | The first unique rule match wins; if none, retry with the Line1+Line2 concatenation when any Line2 exists |
| **Trigger** | Matching |
| **Enforcement** | `ProviderMatcher` |
| **Outcome** | Location chosen |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderMatcher.cs` |
| **Operations** | OP-DOM-04 |

---

## DOM-BR-029a Matching

| Field | Value |
| --- | --- |
| **Statement** | No match is an error |
| **Trigger** | Matching |
| **Enforcement** | `ProviderIndexerV2` |
| **Outcome** | Error "Provider location match not found" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/ProviderIndexerV2.cs` |
| **Operations** | OP-DOM-04 |

---

## DOM-BR-030 Status change

| Field | Value |
| --- | --- |
| **Statement** | A bill status maps to a code (COM, ENT, PEN, AUD, APP, DIS, EXT, REV, SUS); an unknown status throws |
| **Trigger** | Status change |
| **Enforcement** | `Bill.ModifyStatus` &rarr; `BillStatusCode.GetStatusCode` |
| **Outcome** | Exception on an unknown status |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs` |
| **Operations** | OP-DOM-01, OP-DOM-13, OP-DOM-16 |

---

## DOM-BR-040 Service indexing

| Field | Value |
| --- | --- |
| **Statement** | For set type PHAR, use the NPI identity location, else the organizational NPI; take the max location ID |
| **Trigger** | Service indexing |
| **Enforcement** | `BillServiceIndexer` |
| **Outcome** | Rendering location set |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/BillServiceIndexer.cs` |
| **Operations** | OP-DOM-05 |

---

## DOM-BR-041 Service indexing

| Field | Value |
| --- | --- |
| **Statement** | For a service-provider-restricted provider type, use the billing location as the rendering location |
| **Trigger** | Service indexing |
| **Enforcement** | `BillServiceIndexer` |
| **Outcome** | Location set |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/BillServiceIndexer.cs` |
| **Operations** | OP-DOM-05 |

---

## DOM-BR-042 Service indexing

| Field | Value |
| --- | --- |
| **Statement** | Rendering lookup by NPI + works-for + date must return exactly one location |
| **Trigger** | Service indexing |
| **Enforcement** | `BillServiceIndexer` |
| **Outcome** | Errors "Multiple locations found for rendering provider" / "Rendering provider NPI or works-for relationship not found" |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/BillServiceIndexer.cs` |
| **Operations** | OP-DOM-05 |

---

## DOM-BR-043 Service indexing

| Field | Value |
| --- | --- |
| **Statement** | After service indexing the ebill status is Indexed |
| **Trigger** | Service indexing |
| **Enforcement** | `BillServiceIndexer` |
| **Outcome** | Status Indexed |
| **Tables** | [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-025](sql/SQL-025-ebill-status-update-indexed.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/Indexing/BillServiceIndexer.cs` |
| **Operations** | OP-DOM-05 |

---

## DOM-BR-050 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Ebill type is I if INST and a place of service is found, O if INST without one, otherwise S |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | BillTypeCode |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-051 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Admit and discharge dates only apply to type I |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Dates set or null |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-052 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Statement from/thru dates default to the min/max service date |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Dates set |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-053 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Worker tax ID 999999999 becomes null; 9 digits are formatted xxx-xx-xxxx |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | WorkerTaxId |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-054 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | First name is truncated to 20 characters; claim-API worker names override the bill's |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Names |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-055 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | PriorityNumber = 3 and IsRebill = false for generated bills |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Values set |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-056 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Service code: institutional selects revenue code, else service code; non-institutional selects NDC, else revenue code, else service code |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Code chosen |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-057 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | A non-institutional service with an NDC is type Pharmacy |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Service type |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-058 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Quantity precision over 2 decimals is truncated and logged as a non-pending error |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Error condition (not pended) |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-059 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Dental ("D") services require a valid tooth code |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Error condition |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-060 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Service location: institutional inpatient vs outpatient; otherwise `UbBillTypeCode.Substring(1,2)` |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Location code |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-061 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Diagnosis pointers only for Standard (S) bills |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Pointers set |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-062 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | The prescribing provider falls back to the rendering NPI |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Provider set |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-063 Complete

| Field | Value |
| --- | --- |
| **Statement** | After CBP generation the ebill status is CbpSetup |
| **Trigger** | Complete |
| **Enforcement** | `GenerateCbpBills.Generate` |
| **Outcome** | Status |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-064 CBP generation

| Field | Value |
| --- | --- |
| **Statement** | Service type code is P/D/R/serviceType/U; an invalid NDC is flagged |
| **Trigger** | CBP generation |
| **Enforcement** | `GenerateCbpBills.GetCbpBillServiceTypeCode` |
| **Outcome** | Error "Nation Drug Code not Valid" |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-016](sql/SQL-016-cbp-bill-insert.md), [SQL-017](sql/SQL-017-cbp-bill-service-cascade-insert.md), [SQL-032](sql/SQL-032-ebill-status-update-cbp-setup.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/GenerateCBPBills.cs` |
| **Operations** | OP-DOM-06 |

---

## DOM-BR-070 Error recording

| Field | Value |
| --- | --- |
| **Statement** | Error-condition flags: provider errors are pended + provider-error; patient errors are pended + not provider-error; bill-service errors use the isPending parameter; bill-service-provider errors are pended + provider-error |
| **Trigger** | Error recording |
| **Enforcement** | `ErrorConditionHandler` |
| **Outcome** | `EbillErrorCondition` row |
| **Tables** | [EBILL_ERROR_CONDITION](database-tables.md#ebill_error_condition) |
| **SQL** | [SQL-014](sql/SQL-014-ebill-error-condition-insert.md) |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Ebilling/ErrorConditionHandler.cs` |
| **Operations** | OP-DOM-02..07 |

---

## DOM-BR-080 Code lookup

| Field | Value |
| --- | --- |
| **Statement** | Prefer a non-expired service code, then an expired one |
| **Trigger** | Code lookup |
| **Enforcement** | `ServiceCodeManager` |
| **Outcome** | Code |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/ServiceCodeManager.cs` |
| **Operations** | OP-DOM-06, OP-DOM-08 |

---

## DOM-BR-081 Code lookup

| Field | Value |
| --- | --- |
| **Statement** | Type code is Unknown when there is no service date or the date is outside the effective/expiration range |
| **Trigger** | Code lookup |
| **Enforcement** | `ServiceCodeManager` |
| **Outcome** | Unknown type |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/ServiceCodeManager.cs` |
| **Operations** | OP-DOM-08 |

---

## DOM-BR-090 Batch create

| Field | Value |
| --- | --- |
| **Statement** | New batches start with status "NEW" |
| **Trigger** | Batch create |
| **Enforcement** | `Batch` |
| **Outcome** | Status NEW |
| **Tables** | [EBILL_BATCH](database-tables.md#ebill_batch) |
| **SQL** | [SQL-003](sql/SQL-003-batch-insert.md), [SQL-004](sql/SQL-004-batch-insert-with-clearinghouse.md), [SQL-005](sql/SQL-005-batch-insert-clearinghouse-default-dates.md), [SQL-023](sql/SQL-023-ebill-batch-status-update.md) |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Ebilling/Batch.cs` |
| **Operations** | OP-DOM-09 |

---

## DOM-BR-091 GetBatch

| Field | Value |
| --- | --- |
| **Statement** | A retrieved batch must exist and match the expected status and type |
| **Trigger** | GetBatch |
| **Enforcement** | `Batch.GetBatch` |
| **Outcome** | `InvalidBatchException` |
| **Tables** | [EBILL_BATCH](database-tables.md#ebill_batch) |
| **SQL** | [SQL-003](sql/SQL-003-batch-insert.md), [SQL-004](sql/SQL-004-batch-insert-with-clearinghouse.md), [SQL-005](sql/SQL-005-batch-insert-clearinghouse-default-dates.md), [SQL-023](sql/SQL-023-ebill-batch-status-update.md) |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Ebilling/Batch.cs` |
| **Operations** | OP-DOM-09 |

---

## DOM-BR-092 Status set

| Field | Value |
| --- | --- |
| **Statement** | Batch statuses: COMP, EXTR, IMAGE, INDEX, EOB, DLOAD, ACK, SETUP |
| **Trigger** | Status set |
| **Enforcement** | `Batch` setters |
| **Outcome** | Status code |
| **Tables** | [EBILL_BATCH](database-tables.md#ebill_batch) |
| **SQL** | [SQL-003](sql/SQL-003-batch-insert.md), [SQL-004](sql/SQL-004-batch-insert-with-clearinghouse.md), [SQL-005](sql/SQL-005-batch-insert-clearinghouse-default-dates.md), [SQL-023](sql/SQL-023-ebill-batch-status-update.md) |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Ebilling/Batch.cs` |
| **Operations** | OP-DOM-09 |

---

## DOM-BR-100 837 parse

| Field | Value |
| --- | --- |
| **Statement** | The ISA date must equal the batch submission date |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | File fails |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-101 837 parse

| Field | Value |
| --- | --- |
| **Statement** | A bill must have a PWK document |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | Error "Error: Bill has no documents" |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-102 837 parse

| Field | Value |
| --- | --- |
| **Statement** | The LIN qualifier must be N4 |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | Error |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-103 837 parse

| Field | Value |
| --- | --- |
| **Statement** | An N4 segment must follow an N3 |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | Error |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-104 837 parse

| Field | Value |
| --- | --- |
| **Statement** | PRV "BI" creates the billing provider with default TaxId 999999999; taxonomy truncated to 10 characters |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | Provider created |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-105 837 parse

| Field | Value |
| --- | --- |
| **Statement** | Recognised REF qualifiers: D9, EI, SY, Y4 (claim number truncated to 20), 1W, 6R, XZ |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | Fields set |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-106 837 parse

| Field | Value |
| --- | --- |
| **Statement** | The first PWK document's type comes from the set type; an unknown document type fails the file |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | File fails |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-107 837 parse

| Field | Value |
| --- | --- |
| **Statement** | For 005010X222A1, the bill is pharmacy when every LX has a LIN |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | Pharmacy set type |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-108 837 parse

| Field | Value |
| --- | --- |
| **Statement** | Service code limited to 5 characters |
| **Trigger** | 837 parse |
| **Enforcement** | `File837Extractor.ProcessFile` |
| **Outcome** | Truncation |
| **Tables** | [EBILL_SERVICE](database-tables.md#ebill_service) |
| **SQL** | [SQL-015](sql/SQL-015-ebill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File837Extractor.cs` |
| **Operations** | OP-DOM-10 |

---

## DOM-BR-110 277 build

| Field | Value |
| --- | --- |
| **Statement** | 277 status: PEN maps to 2 (no claim) or 3; DIS maps to 4; otherwise 1 |
| **Trigger** | 277 build |
| **Enforcement** | `File277CaBuilder.Build277ResponseFile` |
| **Outcome** | Status category |
| **Tables** | [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-030](sql/SQL-030-ebill-status-update-277-response.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File277CaBuilder.cs` |
| **Operations** | OP-DOM-11 |

---

## DOM-BR-111 277 build

| Field | Value |
| --- | --- |
| **Statement** | LastResponseBatch is set only when the status is not PEND |
| **Trigger** | 277 build |
| **Enforcement** | `File277CaBuilder.Build277ResponseFile` |
| **Outcome** | Batch reference |
| **Tables** | [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-030](sql/SQL-030-ebill-status-update-277-response.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/File277CaBuilder.cs` |
| **Operations** | OP-DOM-11 |

---

## DOM-BR-120 EOB generation

| Field | Value |
| --- | --- |
| **Statement** | Non-payment EOBs are grouped by provider + status date with payment method "NON" |
| **Trigger** | EOB generation |
| **Enforcement** | `EobBuilder.GenerateEobs` |
| **Outcome** | EOB groups |
| **Tables** | [EBILL_EOB_ADJUSTMENT](database-tables.md#ebill_eob_adjustment), [EBILL_EOB_REMITTANCE_ADVICE](database-tables.md#ebill_eob_remittance_advice), [PROVIDER_LOCATION](database-tables.md#provider_location), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-010](sql/SQL-010-eob-mco-fee-adjustment-insert.md), [SQL-011](sql/SQL-011-eob-mco-remittance-advice-insert.md), [SQL-012](sql/SQL-012-eob-service-adjustment-insert.md), [SQL-013](sql/SQL-013-eob-remittance-advice-insert.md), [SQL-020](sql/SQL-020-provider-location-lookup-eob.md), [SQL-021](sql/SQL-021-ebill-lookup-for-eob.md), [SQL-029](sql/SQL-029-ebill-status-update-completed.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/EobBuilder.cs` |
| **Operations** | OP-DOM-12 |

---

## DOM-BR-121 EOB generation

| Field | Value |
| --- | --- |
| **Statement** | Ebills load in chunks of 900 (Oracle 1000 IN-list limit) |
| **Trigger** | EOB generation |
| **Enforcement** | `EobBuilder.GenerateEobs` |
| **Outcome** | Chunked queries |
| **Tables** | [EBILL_EOB_ADJUSTMENT](database-tables.md#ebill_eob_adjustment), [EBILL_EOB_REMITTANCE_ADVICE](database-tables.md#ebill_eob_remittance_advice), [PROVIDER_LOCATION](database-tables.md#provider_location), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-010](sql/SQL-010-eob-mco-fee-adjustment-insert.md), [SQL-011](sql/SQL-011-eob-mco-remittance-advice-insert.md), [SQL-012](sql/SQL-012-eob-service-adjustment-insert.md), [SQL-013](sql/SQL-013-eob-remittance-advice-insert.md), [SQL-020](sql/SQL-020-provider-location-lookup-eob.md), [SQL-021](sql/SQL-021-ebill-lookup-for-eob.md), [SQL-029](sql/SQL-029-ebill-status-update-completed.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/EobBuilder.cs` |
| **Operations** | OP-DOM-12 |

---

## DOM-BR-122 EOB generation

| Field | Value |
| --- | --- |
| **Statement** | A null PaymentMethodCode is logged and skipped |
| **Trigger** | EOB generation |
| **Enforcement** | `EobBuilder.GenerateEobs` |
| **Outcome** | Skipped |
| **Tables** | [EBILL_EOB_ADJUSTMENT](database-tables.md#ebill_eob_adjustment), [EBILL_EOB_REMITTANCE_ADVICE](database-tables.md#ebill_eob_remittance_advice), [PROVIDER_LOCATION](database-tables.md#provider_location), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-010](sql/SQL-010-eob-mco-fee-adjustment-insert.md), [SQL-011](sql/SQL-011-eob-mco-remittance-advice-insert.md), [SQL-012](sql/SQL-012-eob-service-adjustment-insert.md), [SQL-013](sql/SQL-013-eob-remittance-advice-insert.md), [SQL-020](sql/SQL-020-provider-location-lookup-eob.md), [SQL-021](sql/SQL-021-ebill-lookup-for-eob.md), [SQL-029](sql/SQL-029-ebill-status-update-completed.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/EobBuilder.cs` |
| **Operations** | OP-DOM-12 |

---

## DOM-BR-123 EOB generation

| Field | Value |
| --- | --- |
| **Statement** | MCO fee adjustments use the clearinghouse MCO reason and group codes |
| **Trigger** | EOB generation |
| **Enforcement** | `EobBuilder.GenerateEobs` |
| **Outcome** | Adjustment rows |
| **Tables** | [EBILL_EOB_ADJUSTMENT](database-tables.md#ebill_eob_adjustment), [EBILL_EOB_REMITTANCE_ADVICE](database-tables.md#ebill_eob_remittance_advice), [PROVIDER_LOCATION](database-tables.md#provider_location), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-010](sql/SQL-010-eob-mco-fee-adjustment-insert.md), [SQL-011](sql/SQL-011-eob-mco-remittance-advice-insert.md), [SQL-012](sql/SQL-012-eob-service-adjustment-insert.md), [SQL-013](sql/SQL-013-eob-remittance-advice-insert.md), [SQL-020](sql/SQL-020-provider-location-lookup-eob.md), [SQL-021](sql/SQL-021-ebill-lookup-for-eob.md), [SQL-029](sql/SQL-029-ebill-status-update-completed.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/EobBuilder.cs` |
| **Operations** | OP-DOM-12 |

---

## DOM-BR-124 EOB generation

| Field | Value |
| --- | --- |
| **Statement** | Service adjustments invert the amount; group code MA/PR maps to CO |
| **Trigger** | EOB generation |
| **Enforcement** | `EobBuilder.GenerateEobs` |
| **Outcome** | Adjustment rows |
| **Tables** | [EBILL_EOB_ADJUSTMENT](database-tables.md#ebill_eob_adjustment), [EBILL_EOB_REMITTANCE_ADVICE](database-tables.md#ebill_eob_remittance_advice), [PROVIDER_LOCATION](database-tables.md#provider_location), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-010](sql/SQL-010-eob-mco-fee-adjustment-insert.md), [SQL-011](sql/SQL-011-eob-mco-remittance-advice-insert.md), [SQL-012](sql/SQL-012-eob-service-adjustment-insert.md), [SQL-013](sql/SQL-013-eob-remittance-advice-insert.md), [SQL-020](sql/SQL-020-provider-location-lookup-eob.md), [SQL-021](sql/SQL-021-ebill-lookup-for-eob.md), [SQL-029](sql/SQL-029-ebill-status-update-completed.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/EobBuilder.cs` |
| **Operations** | OP-DOM-12 |

---

## DOM-BR-125 EOB generation

| Field | Value |
| --- | --- |
| **Statement** | Remittance advices are grouped by service and RARC |
| **Trigger** | EOB generation |
| **Enforcement** | `EobBuilder.GenerateEobs` |
| **Outcome** | RA rows |
| **Tables** | [EBILL_EOB_ADJUSTMENT](database-tables.md#ebill_eob_adjustment), [EBILL_EOB_REMITTANCE_ADVICE](database-tables.md#ebill_eob_remittance_advice), [PROVIDER_LOCATION](database-tables.md#provider_location), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-010](sql/SQL-010-eob-mco-fee-adjustment-insert.md), [SQL-011](sql/SQL-011-eob-mco-remittance-advice-insert.md), [SQL-012](sql/SQL-012-eob-service-adjustment-insert.md), [SQL-013](sql/SQL-013-eob-remittance-advice-insert.md), [SQL-020](sql/SQL-020-provider-location-lookup-eob.md), [SQL-021](sql/SQL-021-ebill-lookup-for-eob.md), [SQL-029](sql/SQL-029-ebill-status-update-completed.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/EobBuilder.cs` |
| **Operations** | OP-DOM-12 |

---

## DOM-BR-126 EOB regenerate

| Field | Value |
| --- | --- |
| **Statement** | Regenerating a rejected EOB sets its bills to Completed |
| **Trigger** | EOB regenerate |
| **Enforcement** | `EobBuilder.GenerateEobs` |
| **Outcome** | Status Completed |
| **Tables** | [EBILL_EOB_ADJUSTMENT](database-tables.md#ebill_eob_adjustment), [EBILL_EOB_REMITTANCE_ADVICE](database-tables.md#ebill_eob_remittance_advice), [PROVIDER_LOCATION](database-tables.md#provider_location), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-010](sql/SQL-010-eob-mco-fee-adjustment-insert.md), [SQL-011](sql/SQL-011-eob-mco-remittance-advice-insert.md), [SQL-012](sql/SQL-012-eob-service-adjustment-insert.md), [SQL-013](sql/SQL-013-eob-remittance-advice-insert.md), [SQL-020](sql/SQL-020-provider-location-lookup-eob.md), [SQL-021](sql/SQL-021-ebill-lookup-for-eob.md), [SQL-029](sql/SQL-029-ebill-status-update-completed.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Ebilling/EobBuilder.cs` |
| **Operations** | OP-DOM-12 |

---

## DOM-BR-130 Audit routing

| Field | Value |
| --- | --- |
| **Statement** | Audit queue is LEVEL2 when bill type is I, or type O with charges over 20000, or nurse review is required; otherwise LEVEL1 |
| **Trigger** | Audit routing |
| **Enforcement** | `Bill.AuditQueue` |
| **Outcome** | Queue |
| **Tables** | [CBP_BILL_STATUS](database-tables.md#cbp_bill_status) |
| **SQL** | [SQL-006](sql/SQL-006-bill-status-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs` |
| **Operations** | OP-DOM-13 |

---

## DOM-BR-131 Send to audit

| Field | Value |
| --- | --- |
| **Statement** | Sending to audit sets status Audited and adds a B/AU note |
| **Trigger** | Send to audit |
| **Enforcement** | `Bill.SendToAudit` |
| **Outcome** | Status and note |
| **Tables** | [CBP_BILL_STATUS](database-tables.md#cbp_bill_status) |
| **SQL** | [SQL-006](sql/SQL-006-bill-status-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs` |
| **Operations** | OP-DOM-13 |

---

## DOM-BR-132 Pend-approve

| Field | Value |
| --- | --- |
| **Statement** | Pend and approve use responsible party "SYSTEM" |
| **Trigger** | Pend/approve |
| **Enforcement** | `Bill.SendPend`, `Bill.Approve` |
| **Outcome** | Status change |
| **Tables** | [CBP_BILL_STATUS](database-tables.md#cbp_bill_status) |
| **SQL** | [SQL-006](sql/SQL-006-bill-status-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs` |
| **Operations** | OP-DOM-13 |

---

## DOM-BR-133 Payment option change

| Field | Value |
| --- | --- |
| **Statement** | Payment-option updates append "@" to the update user |
| **Trigger** | Payment option change |
| **Enforcement** | `Bill.ModifyPaymentOptions` |
| **Outcome** | UpdateUser |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs` |
| **Operations** | OP-DOM-13 |

---

## DOM-BR-134 Generate EOB

| Field | Value |
| --- | --- |
| **Statement** | EOB generation requires a claim |
| **Trigger** | Generate EOB |
| **Enforcement** | `Bill.GenrateEob` |
| **Outcome** | Exception when the claim is null |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs` |
| **Operations** | OP-DOM-13 |

---

## DOM-BR-135 Duplicate check

| Field | Value |
| --- | --- |
| **Statement** | A bill is a full duplicate when its non-duplicate service count is 0 |
| **Trigger** | Duplicate check |
| **Enforcement** | `Bill.IsFullDuplicate` |
| **Outcome** | Boolean |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs` |
| **Operations** | OP-DOM-13 |

---

## DOM-BR-140 Audit

| Field | Value |
| --- | --- |
| **Statement** | Disallow-all sets every service's allowed amount to 0 with adjustments |
| **Trigger** | Audit |
| **Enforcement** | `Audit.DisallowAllServices` |
| **Outcome** | Allowed = 0 |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Audits/Audit.cs` |
| **Operations** | OP-DOM-14 |

---

## DOM-BR-141 Audit

| Field | Value |
| --- | --- |
| **Statement** | Allow-all reverses DB/MD/TC adjustments for services whose original bill code is not "D", and recomputes the MCO fee (rate, rounded away from zero) |
| **Trigger** | Audit |
| **Enforcement** | `Audit.AllowAllServices` |
| **Outcome** | Amounts |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Audits/Audit.cs` |
| **Operations** | OP-DOM-14 |

---

## DOM-BR-142 Audit totals

| Field | Value |
| --- | --- |
| **Statement** | Adjustment = -(charged - allowed); paid = allowed - MCO fee |
| **Trigger** | Audit totals |
| **Enforcement** | `Audit` |
| **Outcome** | Totals |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Audits/Audit.cs` |
| **Operations** | OP-DOM-14 |

---

## DOM-BR-150 Note create

| Field | Value |
| --- | --- |
| **Statement** | Category C notes attach to the claim and are added to the repository; category B notes attach to the bill |
| **Trigger** | Note create |
| **Enforcement** | `AuditNote` |
| **Outcome** | Note placement |
| **Tables** | [CBP_NOTE](database-tables.md#cbp_note) |
| **SQL** | [SQL-001](sql/SQL-001-audit-note-insert.md), [SQL-002](sql/SQL-002-audit-note-cascade-insert.md), [SQL-033](sql/SQL-033-audit-note-delete.md) |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Bills/Notes/AuditNote.cs` |
| **Operations** | OP-DOM-15 |

---

## DOM-BR-160 Regenerate

| Field | Value |
| --- | --- |
| **Statement** | A regenerated bill starts at Entered with responsible party SYSTEM |
| **Trigger** | Regenerate |
| **Enforcement** | `BillRegenerator.Regenerate` |
| **Outcome** | Status Entered |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_SERVICE](database-tables.md#cbp_bill_service) |
| **SQL** | [SQL-007](sql/SQL-007-bill-regenerate-insert.md), [SQL-008](sql/SQL-008-bill-service-cascade-insert.md) |
| **Source** | `Domain/SAIF.Domain/Claims/Bills/BillRegenerator.cs` |
| **Operations** | OP-DOM-16 |

---

## DOM-BR-170 Holder save

| Field | Value |
| --- | --- |
| **Statement** | Certificate-holder text has Unicode replaced with ASCII |
| **Trigger** | Holder save |
| **Enforcement** | `CertificateHolder` |
| **Outcome** | Normalised text |
| **Tables** | [CERTIFICATE_HOLDER](database-tables.md#certificate_holder) |
| **SQL** | [SQL-009](sql/SQL-009-certificate-holder-insert.md), [SQL-026](sql/SQL-026-certificate-holder-update.md), [SQL-027](sql/SQL-027-certificate-holder-expire-update.md), [SQL-028](sql/SQL-028-certificate-holder-supersede-update.md) |
| **Source** | `Domain/SAIF.Domain/Model/Policies/Certificates/CertificateHolder.cs` |
| **Operations** | OP-DOM-17 |

---

## DOM-BR-171 Holder save

| Field | Value |
| --- | --- |
| **Statement** | State is set only when the address is non-empty |
| **Trigger** | Holder save |
| **Enforcement** | `CertificateHolder` |
| **Outcome** | State |
| **Tables** | [CERTIFICATE_HOLDER](database-tables.md#certificate_holder) |
| **SQL** | [SQL-009](sql/SQL-009-certificate-holder-insert.md), [SQL-026](sql/SQL-026-certificate-holder-update.md), [SQL-027](sql/SQL-027-certificate-holder-expire-update.md), [SQL-028](sql/SQL-028-certificate-holder-supersede-update.md) |
| **Source** | `Domain/SAIF.Domain/Model/Policies/Certificates/CertificateHolder.cs` |
| **Operations** | OP-DOM-17 |

---

## DOM-BR-172 Holder save

| Field | Value |
| --- | --- |
| **Statement** | CountryCode is "US" unless the address is foreign |
| **Trigger** | Holder save |
| **Enforcement** | `CertificateHolder` |
| **Outcome** | Country |
| **Tables** | [CERTIFICATE_HOLDER](database-tables.md#certificate_holder) |
| **SQL** | [SQL-009](sql/SQL-009-certificate-holder-insert.md), [SQL-026](sql/SQL-026-certificate-holder-update.md), [SQL-027](sql/SQL-027-certificate-holder-expire-update.md), [SQL-028](sql/SQL-028-certificate-holder-supersede-update.md) |
| **Source** | `Domain/SAIF.Domain/Model/Policies/Certificates/CertificateHolder.cs` |
| **Operations** | OP-DOM-17 |

---

## DOM-BR-180 Read

| Field | Value |
| --- | --- |
| **Statement** | Policy number below 18 means a non-policy account |
| **Trigger** | Read |
| **Enforcement** | `Claim.PolicyName` |
| **Outcome** | Name |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-181 Read

| Field | Value |
| --- | --- |
| **Statement** | OccupationalDisease "D" means an OD claim |
| **Trigger** | Read |
| **Enforcement** | `Claim.IsOdClaim` |
| **Outcome** | Flag |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-182 Read

| Field | Value |
| --- | --- |
| **Statement** | SaifPayrollSubCode "P" means a preferred worker |
| **Trigger** | Read |
| **Enforcement** | `Claim.IsPreferredWorker` |
| **Outcome** | Flag |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-183 Read

| Field | Value |
| --- | --- |
| **Statement** | Jurisdiction "2" means inmate, "1" means state |
| **Trigger** | Read |
| **Enforcement** | `Claim` |
| **Outcome** | Flags |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-184 Read

| Field | Value |
| --- | --- |
| **Statement** | OD injury date is the earlier of the disability date and the initial treatment date |
| **Trigger** | Read |
| **Enforcement** | `Claim.OdInjuryDate` |
| **Outcome** | Date |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-185 Read

| Field | Value |
| --- | --- |
| **Statement** | DCS F means full, P means partial |
| **Trigger** | Read |
| **Enforcement** | `Claim` |
| **Outcome** | Flags |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-186 Read

| Field | Value |
| --- | --- |
| **Statement** | Medical conditions exclude "not properly initiated" |
| **Trigger** | Read |
| **Enforcement** | `Claim.MedicalConditions` |
| **Outcome** | Filtered list |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-187 Read

| Field | Value |
| --- | --- |
| **Statement** | Guidewire reserves drop legal/other non-chargeable expenses, merge burial into death benefits, and throw on an untranslated category |
| **Trigger** | Read |
| **Enforcement** | `Claim.GetGwReserves` |
| **Outcome** | Reserves or exception |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-188 Read

| Field | Value |
| --- | --- |
| **Statement** | Last payment sums TD, VocTD and SupTD |
| **Trigger** | Read |
| **Enforcement** | `Claim.GetLastPayment` |
| **Outcome** | Amount |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-189 Read

| Field | Value |
| --- | --- |
| **Statement** | First closure date is the first status C that has not been removed |
| **Trigger** | Read |
| **Enforcement** | `Claim.FirstClosureDate` |
| **Outcome** | Date |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-190 Read

| Field | Value |
| --- | --- |
| **Statement** | "No row with the given identifier" is swallowed for the MyClaim last login |
| **Trigger** | Read |
| **Enforcement** | `Claim.MyClaimLastLogin` |
| **Outcome** | Null |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-191 Read

| Field | Value |
| --- | --- |
| **Statement** | Overpayment means RecoverableBalance > 0 |
| **Trigger** | Read |
| **Enforcement** | `Claim.IsOverpayment` |
| **Outcome** | Flag |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-193 Security attributes

| Field | Value |
| --- | --- |
| **Statement** | IsConflictClaim = Worker.IsWorkerConflict; IsSecureClaim = IsSecured |
| **Trigger** | Security attributes |
| **Enforcement** | `Claim.BuildSecurityAttributes` |
| **Outcome** | `SecureClaimAttributes` |
| **Source** | `Domain/SAIF.Domain/Model/Claims/Claim.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-194 Mapping

| Field | Value |
| --- | --- |
| **Statement** | Guidewire claim status NEW maps to N, OPEN/REOPEN to O, CLOSED to C, DENIED to D, VOID to V; anything else throws |
| **Trigger** | Mapping |
| **Enforcement** | `GuidewireToLegacyMapper` |
| **Outcome** | `InvalidDataException` |
| **Source** | `Domain/SAIF.Domain/Mappers/GuidewireToLegacyMapper.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-195 Mapping

| Field | Value |
| --- | --- |
| **Statement** | MCO status Yes maps to Y, No to N, Pending to P, default B |
| **Trigger** | Mapping |
| **Enforcement** | `GuidewireToLegacyMapper` |
| **Outcome** | Code |
| **Source** | `Domain/SAIF.Domain/Mappers/GuidewireToLegacyMapper.cs` |
| **Operations** | OP-DOM-18 |

---

## DOM-BR-200 Packet creation

| Field | Value |
| --- | --- |
| **Statement** | Child policies (relationship not WRAP) exclude 312R, 412R, AUDIT and 312IR documents from packets |
| **Trigger** | Packet creation |
| **Enforcement** | `PacketManager.CreatePackets` |
| **Outcome** | Excluded docs |
| **Tables** | [ENDORSE_CODE](database-tables.md#endorse_code) |
| **SQL** | [SQL-022](sql/SQL-022-endorse-code-lookup.md) |
| **Source** | `Domain/SAIF.Domain/Tasks/Documents/Packets/PacketManager.cs` |
| **Operations** | OP-DOM-19 |

---

## DOM-BR-201 Packet creation

| Field | Value |
| --- | --- |
| **Statement** | Documents group by policy + document date + release date, then by period |
| **Trigger** | Packet creation |
| **Enforcement** | `PacketManager.CreatePackets` |
| **Outcome** | Groups |
| **Tables** | [ENDORSE_CODE](database-tables.md#endorse_code) |
| **SQL** | [SQL-022](sql/SQL-022-endorse-code-lookup.md) |
| **Source** | `Domain/SAIF.Domain/Tasks/Documents/Packets/PacketManager.cs` |
| **Operations** | OP-DOM-19 |

---

## DOM-BR-202 Packet evaluation

| Field | Value |
| --- | --- |
| **Statement** | A packet requires: minimum document count, market type, parent/child relationship, included relationship types, secondary code, the required parent document, the same source key text, and child document inclusion |
| **Trigger** | Packet evaluation |
| **Enforcement** | `PacketGenerator` |
| **Outcome** | Packet created or not |
| **Tables** | [ENDORSE_CODE](database-tables.md#endorse_code) |
| **SQL** | [SQL-022](sql/SQL-022-endorse-code-lookup.md) |
| **Source** | `Domain/SAIF.Domain/Tasks/Documents/Packets/PacketGenerator.cs` |
| **Operations** | OP-DOM-19 |

---

## DOM-BR-203 Packet evaluation

| Field | Value |
| --- | --- |
| **Statement** | 38 packet definitions PKT001-PKT038 are hard-coded |
| **Trigger** | Packet evaluation |
| **Enforcement** | `PacketDefinition` |
| **Outcome** | Definitions |
| **Tables** | [ENDORSE_CODE](database-tables.md#endorse_code) |
| **SQL** | [SQL-022](sql/SQL-022-endorse-code-lookup.md) |
| **Source** | `Domain/SAIF.Domain/Tasks/Documents/Packets/PacketDefinition.cs` |
| **Operations** | OP-DOM-19 |

---

## DOM-BR-210 Image conversion

| Field | Value |
| --- | --- |
| **Statement** | Vignette IFN constants: 25362436 maps to "387/4", 25427970 maps to "388/2" |
| **Trigger** | Image conversion |
| **Enforcement** | `Image.ConvertIfnDs` |
| **Outcome** | Converted IDs |
| **Source** | `Domain/SAIF.Domain/Model/Imaging/Image.cs` |
| **Operations** | OP-DOM-20 |

---

## DOM-BR-211 Employee load

| Field | Value |
| --- | --- |
| **Statement** | An employee prefers the `IUserProfileService` application user, falling back to `WcisEmployee` |
| **Trigger** | Employee load |
| **Enforcement** | `Employee` |
| **Outcome** | Employee data |
| **Source** | `Domain/SAIF.Domain/Model/Employees/Employee.cs` |
| **Operations** | OP-DOM-20 |

---

## Notes
- [DOM-BR-029a](#dom-br-029a-matching) is a matcher/indexing edge-case rule numbered outside the main [DOM-BR-029](#dom-br-029-matching) sequence; the rule number 192 is not used (no Stage 1 rule was recorded for that number).
- Rules [DOM-BR-070](#dom-br-070-error-recording), [DOM-BR-080](#dom-br-080-code-lookup)/[DOM-BR-081](#dom-br-081-code-lookup), and [DOM-BR-030](#dom-br-030-status-change) are shared across multiple operations (see the Operations column on each rule).
- The `Tables`/`SQL` fields above are populated only for rules whose enforcement is directly tied to one or more of the 33 ORM operations cataloged in [SQL catalog](sql/index.md); rules enforced purely in memory (validation, derived-property, and mapping rules) omit these fields.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Database tables](database-tables.md)
- [SQL catalog](sql/index.md)
- [API reference](api/index.md)

## Sources
- `Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs`, `GenerateCBPBills.cs`, `File837Extractor.cs`, `File835Builder.cs`, `File277CaBuilder.cs`, `File837AckBuilder.cs`, `EdiBuildSegments.cs`, `EobBuilder.cs`, `ServiceCodeManager.cs`
- `Domain/SAIF.Domain/Claims/Ebilling/Indexing/PatientIndexer.cs`, `ProviderIndexer.cs`, `ProviderIndexerV2.cs`, `BillServiceIndexer.cs`, `ProviderMatcher.cs`
- `Domain/SAIF.Domain/Claims/Bills/BillRegenerator.cs`
- `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs`, `BillStatusCode.cs`
- `Domain/SAIF.Domain/Model/Claims/Bills/Audits/Audit.cs`
- `Domain/SAIF.Domain/Model/Claims/Bills/Notes/AuditNote.cs`
- `Domain/SAIF.Domain/Model/Claims/Claim.cs`
- `Domain/SAIF.Domain/Model/Claims/Ebilling/Batch.cs`, `ErrorConditionHandler.cs`
- `Domain/SAIF.Domain/Model/Employees/Employee.cs`
- `Domain/SAIF.Domain/Model/Imaging/Image.cs`
- `Domain/SAIF.Domain/Model/Policies/Certificates/CertificateHolder.cs`
- `Domain/SAIF.Domain/Mappers/GuidewireToLegacyMapper.cs`
- `Domain/SAIF.Domain/Tasks/Documents/Packets/PacketManager.cs`, `PacketGenerator.cs`, `PacketDefinition.cs`
