---
title: SAIF.Data business rules
summary: Enumerated business rules with per-rule trigger, enforcement, and outcomes.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# SAIF.Data business rules

This page captures business rules enforced by this library's query providers, HTTP clients, and model helpers.

## SD-BR-001 Data client configuration created per SystemType and SystemName

| Field | Value |
| --- | --- |
| **Statement** | Data client configuration is created per SystemType/SystemName and may be customized by caller action |
| **Trigger** | `AddDataClients` call |
| **Enforcement** | `ContainerBuilderExtensions.AddDataClients` |
| **Outcome** | Singleton config registered |
| **Source** | `Data/SAIF.Data/Configuration/ContainerBuilderExtensions.cs` |
| **Operation(s)** | [Register data clients](operations/register-data-clients.md) |

---

## SD-BR-002 GET responses cached via Polly unless caching disabled

| Field | Value |
| --- | --- |
| **Statement** | GET responses are cached via Polly for `MaxCacheDuration` (default 30 s, originating `SAIF.Data.Guidewire`/`DataClientConfiguration`) unless `UseCache` is false |
| **Trigger** | Cached GET/POST |
| **Enforcement** | `HttpClientBase.GetAsyncCached<T>` |
| **Outcome** | Cached or NoOp execution |
| **Source** | `Data/SAIF.Data/Clients/HttpClientBase.cs` |
| **Operation(s)** | [Register data clients](operations/register-data-clients.md), [Authenticated/cached HTTP GET](operations/authenticatedcached-http-get.md) |

---

## SD-BR-003 Service base URL must come from environment configuration

| Field | Value |
| --- | --- |
| **Statement** | Service base URL must come from environment configuration key (`UrlKey`) |
| **Trigger** | Client construction |
| **Enforcement** | `HttpClientBase` (lazy client) |
| **Outcome** | BaseAddress set |
| **Source** | `Data/SAIF.Data/Clients/HttpClientBase.cs` |
| **Operation(s)** | [Authenticated/cached HTTP GET](operations/authenticatedcached-http-get.md), [Get e-bill EOB extract](operations/get-e-bill-eob-extract.md) |

---

## SD-BR-004 Credentials retrieved from secure setting decrypted with system hash

| Field | Value |
| --- | --- |
| **Statement** | Credentials retrieved from secure setting `AuthKey` decrypted with system hash; value format `user\|password` |
| **Trigger** | `AuthKey` set |
| **Enforcement** | `HttpClientBase` handler creation |
| **Outcome** | NetworkCredential applied |
| **Source** | `Data/SAIF.Data/Clients/HttpClientBase.cs` |
| **Operation(s)** | [Authenticated/cached HTTP GET](operations/authenticatedcached-http-get.md), [Get e-bill EOB extract](operations/get-e-bill-eob-extract.md) |

---

## SD-BR-010 Claim is valid only if CC API returns HTTP 200

| Field | Value |
| --- | --- |
| **Statement** | Claim is valid only if the Guidewire CC API returns HTTP 200 |
| **Trigger** | `ValidateClaim` |
| **Enforcement** | `CCClaimApiService.ValidateClaim` |
| **Outcome** | true/false |
| **Source** | `Data/SAIF.Data/Queries/Claims/CCClaimApiService.cs` |
| **Operation(s)** | [Validate claim / get claim](operations/validate-claim-get-claim.md) |

---

## SD-BR-011 Id of 0 returns null without calling the API

| Field | Value |
| --- | --- |
| **Statement** | An id of 0 returns null without calling the API |
| **Trigger** | `GetClaim`/`GetWorker*` |
| **Enforcement** | `CCClaimApiService` |
| **Outcome** | null |
| **Source** | `Data/SAIF.Data/Queries/Claims/CCClaimApiService.cs` |
| **Operation(s)** | [Validate claim / get claim](operations/validate-claim-get-claim.md) |

---

## SD-BR-012 Latest MCO selection precedence

| Field | Value |
| --- | --- |
| **Statement** | Latest MCO = effective date on or before today and (expiration on or after today or unset), newest first; empty location if none match |
| **Trigger** | `GetLatestMco` |
| **Enforcement** | `CCClaimApiService.GetLatestMco` |
| **Outcome** | `McoLocation` |
| **Source** | `Data/SAIF.Data/Queries/Claims/CCClaimApiService.cs` |
| **Operation(s)** | [Get latest MCO](operations/get-latest-mco.md) |

---

## SD-BR-013 Bill queue HTTP status mapping

| Field | Value |
| --- | --- |
| **Statement** | Bill queue HTTP status mapping (200/404/500) to ReturnCode/ImageId; restore returns 1/0 |
| **Trigger** | Queue calls |
| **Enforcement** | `CCClaimApiService.GetNextClaimBillFromQueue`, `RestoreClaimBillToQueue` |
| **Outcome** | Result codes |
| **Source** | `Data/SAIF.Data/Queries/Claims/CCClaimApiService.cs` |
| **Operation(s)** | [Bill queue processing](operations/bill-queue-processing.md) |

---

## SD-BR-020 Employee has claim security override only when override row matches claim and employee within EffDate to ExpDate window

| Field | Value |
| --- | --- |
| **Statement** | Employee has a claim security override only when an override row matches the claim and employee and today falls within [EffDate, ExpDate] |
| **Trigger** | Access check |
| **Enforcement** | `ClaimSecurityOverrideProvider.HasClaimSecurityOverride` |
| **Outcome** | bool (data-level authorization) |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimSecurityOverrideProvider.cs` |
| **Operation(s)** | [Claim security override check](operations/claim-security-override-check.md) |
| **Tables** | [CL_SECURITY_OVERRIDE](database-tables.md#cl_security_override) |
| **SQL** | [SQL-073](sql/SQL-073-claim-security-override-provider-has-claim-security-override.md) |

---

## SD-BR-021 Recoverable balance sums outstanding amount for non-amended overpayments

| Field | Value |
| --- | --- |
| **Statement** | Recoverable balance = sum of OutstandingAmount for the worker, not amended, status 1 or 3 |
| **Trigger** | Balance request |
| **Enforcement** | `OverpaymentQueryProvider.GetRecoverableBalance` |
| **Outcome** | decimal |
| **Source** | `Data/SAIF.Data/Queries/Claims/OverpaymentQueryProvider.cs` |
| **Operation(s)** | [Recoverable overpayment balance](operations/recoverable-overpayment-balance.md) |
| **Tables** | [CL_OVERPAYMENT](database-tables.md#cl_overpayment), [CL_CLAIM_PERSON](database-tables.md#cl_claim_person) |
| **SQL** | [SQL-190](sql/SQL-190-overpayment-query-provider-get-recoverable-balance.md) |

---

## SD-BR-030 Nurse review required if any audited service code flags it

| Field | Value |
| --- | --- |
| **Statement** | Nurse review is required if any audited service's service code flags it |
| **Trigger** | Audit review |
| **Enforcement** | `AuditQueryProvider.IsNurseReviewRequired` |
| **Outcome** | bool |
| **Source** | `Data/SAIF.Data/Queries/AuditQueryProvider.cs` |
| **Operation(s)** | [Bill audit evaluation](operations/bill-audit-evaluation.md) |
| **Tables** | [CBP_AUDIT](database-tables.md#cbp_audit), [CBP_BILL](database-tables.md#cbp_bill), [CBP_NATIONAL_DRUG](database-tables.md#cbp_national_drug), [CBP_SERVICE_CODE](database-tables.md#cbp_service_code), [CBP_AUDITED_SERVICE](database-tables.md#cbp_audited_service), [CBP_SERVICE_PHYSICAL_MEDICINE](database-tables.md#cbp_service_physical_medicine), [CBP_AUDIT_ADJUSTMENT_TYPE](database-tables.md#cbp_audit_adjustment_type) |
| **SQL** | [SQL-013](sql/SQL-013-audit-query-provider-get-audit.md), [SQL-014](sql/SQL-014-audit-query-provider-get-audit-for-bill.md), [SQL-015](sql/SQL-015-audit-query-provider-get-national-drug-code.md), [SQL-016](sql/SQL-016-audit-query-provider-is-nurse-review-required.md), [SQL-017](sql/SQL-017-audit-query-provider-is-nurse-review-required.md), [SQL-018](sql/SQL-018-audit-query-provider-get-non-duplicate-service-count.md), [SQL-019](sql/SQL-019-audit-query-provider-get-services.md), [SQL-020](sql/SQL-020-audit-query-provider-get-original-bills.md), [SQL-021](sql/SQL-021-audit-query-provider-get-physical-medicine-count.md), [SQL-022](sql/SQL-022-audit-query-provider-get-physical-medicine-count.md) |

---

## SD-BR-031 Duplicate services excluded from count

| Field | Value |
| --- | --- |
| **Statement** | Duplicate services (OriginalBillCode "D") are excluded from the count |
| **Trigger** | Count |
| **Enforcement** | `AuditQueryProvider.GetNonDuplicateServiceCount` |
| **Outcome** | int |
| **Source** | `Data/SAIF.Data/Queries/AuditQueryProvider.cs` |
| **Operation(s)** | [Bill audit evaluation](operations/bill-audit-evaluation.md) |
| **Tables** | [CBP_AUDIT](database-tables.md#cbp_audit), [CBP_BILL](database-tables.md#cbp_bill), [CBP_NATIONAL_DRUG](database-tables.md#cbp_national_drug), [CBP_SERVICE_CODE](database-tables.md#cbp_service_code), [CBP_AUDITED_SERVICE](database-tables.md#cbp_audited_service), [CBP_SERVICE_PHYSICAL_MEDICINE](database-tables.md#cbp_service_physical_medicine), [CBP_AUDIT_ADJUSTMENT_TYPE](database-tables.md#cbp_audit_adjustment_type) |
| **SQL** | [SQL-013](sql/SQL-013-audit-query-provider-get-audit.md), [SQL-014](sql/SQL-014-audit-query-provider-get-audit-for-bill.md), [SQL-015](sql/SQL-015-audit-query-provider-get-national-drug-code.md), [SQL-016](sql/SQL-016-audit-query-provider-is-nurse-review-required.md), [SQL-017](sql/SQL-017-audit-query-provider-is-nurse-review-required.md), [SQL-018](sql/SQL-018-audit-query-provider-get-non-duplicate-service-count.md), [SQL-019](sql/SQL-019-audit-query-provider-get-services.md), [SQL-020](sql/SQL-020-audit-query-provider-get-original-bills.md), [SQL-021](sql/SQL-021-audit-query-provider-get-physical-medicine-count.md), [SQL-022](sql/SQL-022-audit-query-provider-get-physical-medicine-count.md) |

---

## SD-BR-032 Unset thru-date treated as open-ended

| Field | Value |
| --- | --- |
| **Statement** | An unset thru-date is treated as open-ended (`DateTime.MaxValue`) |
| **Trigger** | Service query |
| **Enforcement** | `AuditQueryProvider.GetServices` |
| **Outcome** | Date range |
| **Source** | `Data/SAIF.Data/Queries/AuditQueryProvider.cs` |
| **Operation(s)** | [Bill audit evaluation](operations/bill-audit-evaluation.md) |
| **Tables** | [CBP_AUDIT](database-tables.md#cbp_audit), [CBP_BILL](database-tables.md#cbp_bill), [CBP_NATIONAL_DRUG](database-tables.md#cbp_national_drug), [CBP_SERVICE_CODE](database-tables.md#cbp_service_code), [CBP_AUDITED_SERVICE](database-tables.md#cbp_audited_service), [CBP_SERVICE_PHYSICAL_MEDICINE](database-tables.md#cbp_service_physical_medicine), [CBP_AUDIT_ADJUSTMENT_TYPE](database-tables.md#cbp_audit_adjustment_type) |
| **SQL** | [SQL-013](sql/SQL-013-audit-query-provider-get-audit.md), [SQL-014](sql/SQL-014-audit-query-provider-get-audit-for-bill.md), [SQL-015](sql/SQL-015-audit-query-provider-get-national-drug-code.md), [SQL-016](sql/SQL-016-audit-query-provider-is-nurse-review-required.md), [SQL-017](sql/SQL-017-audit-query-provider-is-nurse-review-required.md), [SQL-018](sql/SQL-018-audit-query-provider-get-non-duplicate-service-count.md), [SQL-019](sql/SQL-019-audit-query-provider-get-services.md), [SQL-020](sql/SQL-020-audit-query-provider-get-original-bills.md), [SQL-021](sql/SQL-021-audit-query-provider-get-physical-medicine-count.md), [SQL-022](sql/SQL-022-audit-query-provider-get-physical-medicine-count.md) |

---

## SD-BR-033 Audit note save allowed only under optimistic concurrency match

| Field | Value |
| --- | --- |
| **Statement** | Audit note save is allowed only if Id and UpdateNumber still match (optimistic concurrency); new notes are always allowed |
| **Trigger** | Save |
| **Enforcement** | `AuditNoteQueryProvider.IsAuditNoteNoContention` |
| **Outcome** | bool |
| **Source** | `Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs` |
| **Operation(s)** | [Audit note concurrency check](operations/audit-note-concurrency-check.md) |
| **Tables** | [CBP_NOTE](database-tables.md#cbp_note) |
| **SQL** | [SQL-012](sql/SQL-012-audit-note-query-provider-is-audit-note-no-contention.md) |

---

## SD-BR-034 Bill entry source classification

| Field | Value |
| --- | --- |
| **Statement** | Bill entry source "R" means regenerated and "E" means e-bill |
| **Trigger** | Bill queries |
| **Enforcement** | `BillQueryProvider` |
| **Outcome** | Classification |
| **Source** | `Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs` |
| **Operation(s)** | [Bill queries](operations/bill-queries.md) |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_TYPE_CODE](database-tables.md#cbp_bill_type_code), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [CBP_BILL_STATUS](database-tables.md#cbp_bill_status), [CBP_BILL_ENTRY_SOURCE_CODE](database-tables.md#cbp_bill_entry_source_code), [CBP_AUDITED_SERVICE](database-tables.md#cbp_audited_service), [CBP_DIAGNOSIS](database-tables.md#cbp_diagnosis), [CBP_DIAGNOSIS_TYPE_CODE](database-tables.md#cbp_diagnosis_type_code) |
| **SQL** | [SQL-024](sql/SQL-024-bill-query-provider-bill-exists.md), [SQL-025](sql/SQL-025-bill-query-provider-get-bill.md), [SQL-026](sql/SQL-026-bill-query-provider-get-bills-for-claim.md), [SQL-027](sql/SQL-027-bill-query-provider-get-bill-ids-for-claim.md), [SQL-028](sql/SQL-028-bill-query-provider-get-bill-types.md), [SQL-029](sql/SQL-029-bill-query-provider-get-bill-status-code.md), [SQL-030](sql/SQL-030-bill-query-provider-get-bill-status-history.md), [SQL-031](sql/SQL-031-bill-query-provider-get-regenerated-bill-entry-source-code.md), [SQL-032](sql/SQL-032-bill-query-provider-get-bill-amounts.md), [SQL-033](sql/SQL-033-bill-query-provider-get-bill-amounts.md) |

---

## SD-BR-035 Bill allowed total treats null as zero

| Field | Value |
| --- | --- |
| **Statement** | Bill allowed total treats a null amount as 0 |
| **Trigger** | Totals |
| **Enforcement** | `BillQueryProvider.GetBillAmounts` |
| **Outcome** | decimal |
| **Source** | `Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs` |
| **Operation(s)** | [Bill queries](operations/bill-queries.md) |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_TYPE_CODE](database-tables.md#cbp_bill_type_code), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [CBP_BILL_STATUS](database-tables.md#cbp_bill_status), [CBP_BILL_ENTRY_SOURCE_CODE](database-tables.md#cbp_bill_entry_source_code), [CBP_AUDITED_SERVICE](database-tables.md#cbp_audited_service), [CBP_DIAGNOSIS](database-tables.md#cbp_diagnosis), [CBP_DIAGNOSIS_TYPE_CODE](database-tables.md#cbp_diagnosis_type_code) |
| **SQL** | [SQL-024](sql/SQL-024-bill-query-provider-bill-exists.md), [SQL-025](sql/SQL-025-bill-query-provider-get-bill.md), [SQL-026](sql/SQL-026-bill-query-provider-get-bills-for-claim.md), [SQL-027](sql/SQL-027-bill-query-provider-get-bill-ids-for-claim.md), [SQL-028](sql/SQL-028-bill-query-provider-get-bill-types.md), [SQL-029](sql/SQL-029-bill-query-provider-get-bill-status-code.md), [SQL-030](sql/SQL-030-bill-query-provider-get-bill-status-history.md), [SQL-031](sql/SQL-031-bill-query-provider-get-regenerated-bill-entry-source-code.md), [SQL-032](sql/SQL-032-bill-query-provider-get-bill-amounts.md), [SQL-033](sql/SQL-033-bill-query-provider-get-bill-amounts.md) |

---

## SD-BR-036 Service code current only when expiration date is null

| Field | Value |
| --- | --- |
| **Statement** | A service code is current only when ExpirationDate is null |
| **Trigger** | Lookup |
| **Enforcement** | `BillQueryProvider.GetCbpServiceCodeNotExpired` |
| **Outcome** | Service code |
| **Source** | `Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs` |
| **Operation(s)** | [Bill queries](operations/bill-queries.md) |
| **Tables** | [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_TYPE_CODE](database-tables.md#cbp_bill_type_code), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [CBP_BILL_STATUS](database-tables.md#cbp_bill_status), [CBP_BILL_ENTRY_SOURCE_CODE](database-tables.md#cbp_bill_entry_source_code), [CBP_AUDITED_SERVICE](database-tables.md#cbp_audited_service), [CBP_DIAGNOSIS](database-tables.md#cbp_diagnosis), [CBP_DIAGNOSIS_TYPE_CODE](database-tables.md#cbp_diagnosis_type_code) |
| **SQL** | [SQL-024](sql/SQL-024-bill-query-provider-bill-exists.md), [SQL-025](sql/SQL-025-bill-query-provider-get-bill.md), [SQL-026](sql/SQL-026-bill-query-provider-get-bills-for-claim.md), [SQL-027](sql/SQL-027-bill-query-provider-get-bill-ids-for-claim.md), [SQL-028](sql/SQL-028-bill-query-provider-get-bill-types.md), [SQL-029](sql/SQL-029-bill-query-provider-get-bill-status-code.md), [SQL-030](sql/SQL-030-bill-query-provider-get-bill-status-history.md), [SQL-031](sql/SQL-031-bill-query-provider-get-regenerated-bill-entry-source-code.md), [SQL-032](sql/SQL-032-bill-query-provider-get-bill-amounts.md), [SQL-033](sql/SQL-033-bill-query-provider-get-bill-amounts.md) |

---

## SD-BR-040 Physician without facility is invalid

| Field | Value |
| --- | --- |
| **Statement** | A physician without a facility is invalid; location selection follows a facility/physician precedence |
| **Trigger** | Lookup |
| **Enforcement** | `ClaimQueryProvider.GetAttendingPhysician` |
| **Outcome** | Location or `ApplicationException` |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Attending physician resolution](operations/attending-physician-resolution.md) |
| **Tables** | [PROVIDER_LOCATION](database-tables.md#provider_location) |
| **SQL** | [SQL-057](sql/SQL-057-claim-query-provider-get-attending-physician.md) |

---

## SD-BR-041 Latest claim status falls back to WCD status when no history

| Field | Value |
| --- | --- |
| **Statement** | Latest claim status falls back to the WCD status when there is no history |
| **Trigger** | Lookup |
| **Enforcement** | `ClaimQueryProvider.GetLatestClaimStatus` |
| **Outcome** | Status |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim status and compensability](operations/claim-status-and-compensability.md) |
| **Tables** | [CL_CLAIM_STATUS_ACTIVITY](database-tables.md#cl_claim_status_activity), [CL_CLAIM_REQUEST_DECISION](database-tables.md#cl_claim_request_decision), [claim_status_code](database-tables.md#claim_status_code) |
| **SQL** | [SQL-058](sql/SQL-058-claim-query-provider-get-claim-status-date.md), [SQL-061](sql/SQL-061-claim-query-provider-get-claim-status-activity.md), [SQL-062](sql/SQL-062-claim-query-provider-get-claim-request-decisions.md), [SQL-063](sql/SQL-063-claim-query-provider-get-original-acceptance.md), [SQL-071](sql/SQL-071-claim-query-provider-get-claim-status-code.md) |

---

## SD-BR-042 Compensability status mapping

| Field | Value |
| --- | --- |
| **Statement** | Compensability "Claim Denied" maps to "D"; otherwise the first letter, upper-cased |
| **Trigger** | Lookup |
| **Enforcement** | `ClaimQueryProvider.GetCompensabilityStatus` |
| **Outcome** | Code |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim status and compensability](operations/claim-status-and-compensability.md) |
| **Tables** | [CL_CLAIM_STATUS_ACTIVITY](database-tables.md#cl_claim_status_activity), [CL_CLAIM_REQUEST_DECISION](database-tables.md#cl_claim_request_decision), [claim_status_code](database-tables.md#claim_status_code) |
| **SQL** | [SQL-058](sql/SQL-058-claim-query-provider-get-claim-status-date.md), [SQL-061](sql/SQL-061-claim-query-provider-get-claim-status-activity.md), [SQL-062](sql/SQL-062-claim-query-provider-get-claim-request-decisions.md), [SQL-063](sql/SQL-063-claim-query-provider-get-original-acceptance.md), [SQL-071](sql/SQL-071-claim-query-provider-get-claim-status-code.md) |

---

## SD-BR-043 Original acceptance requires request type I with decision A

| Field | Value |
| --- | --- |
| **Statement** | Original acceptance = request type "I" with decision "A" |
| **Trigger** | Lookup |
| **Enforcement** | `ClaimQueryProvider.GetOriginalAcceptance` |
| **Outcome** | Decision |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim status and compensability](operations/claim-status-and-compensability.md) |
| **Tables** | [CL_CLAIM_STATUS_ACTIVITY](database-tables.md#cl_claim_status_activity), [CL_CLAIM_REQUEST_DECISION](database-tables.md#cl_claim_request_decision), [claim_status_code](database-tables.md#claim_status_code) |
| **SQL** | [SQL-058](sql/SQL-058-claim-query-provider-get-claim-status-date.md), [SQL-061](sql/SQL-061-claim-query-provider-get-claim-status-activity.md), [SQL-062](sql/SQL-062-claim-query-provider-get-claim-request-decisions.md), [SQL-063](sql/SQL-063-claim-query-provider-get-original-acceptance.md), [SQL-071](sql/SQL-071-claim-query-provider-get-claim-status-code.md) |

---

## SD-BR-044 MCO enrollment date only when eligibility is Y

| Field | Value |
| --- | --- |
| **Statement** | MCO enrollment date is returned only when the eligibility status is "Y" (obsolete)* |
| **Trigger** | Lookup |
| **Enforcement** | `ClaimQueryProvider.GetMcoEnrollmentDate` |
| **Outcome** | Date or null |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim status and compensability](operations/claim-status-and-compensability.md) |

---

## SD-BR-045 Retired WCIS claim activity queries are unsupported

| Field | Value |
| --- | --- |
| **Statement** | Retired WCIS claim-activity queries are unsupported and throw |
| **Trigger** | Call |
| **Enforcement** | `ClaimQueryProvider.GetWorkReleaseStatus`, `GetLatestClaimTypeActivity`, `GetClaimTypeActivity`, `GetClaimStatusActivity`, `GetClaimRequestDecisions` |
| **Outcome** | `NotImplementedException` |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim status and compensability](operations/claim-status-and-compensability.md) |

---

## SD-BR-046 Time-loss financials filtered by check status and category

| Field | Value |
| --- | --- |
| **Statement** | Time-loss financials = payments with issued/cleared check status and temporary-disability or voc-TD category, excluding legal-fee line items |
| **Trigger** | Query |
| **Enforcement** | `ClaimQueryProvider.GetFinancialTransactionsQuery` |
| **Outcome** | Filtered list |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim financial transactions](operations/claim-financial-transactions.md) |

---

## SD-BR-047 Guidewire category code must map to a legacy category

| Field | Value |
| --- | --- |
| **Statement** | A Guidewire category code must map to a legacy category; an unmapped code throws |
| **Trigger** | Translate |
| **Enforcement** | `ClaimQueryProvider.TranslateCategoryCodeFromGw` |
| **Outcome** | Code or exception |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim financial transactions](operations/claim-financial-transactions.md) |

---

## SD-BR-048 Guidewire vocational status mapped to legacy code

| Field | Value |
| --- | --- |
| **Statement** | A Guidewire vocational status code is mapped to a legacy code |
| **Trigger** | Translate |
| **Enforcement** | `ClaimQueryProvider.TranslateGWVocationalStatusCodeToLegacy` |
| **Outcome** | Code |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim financial transactions](operations/claim-financial-transactions.md) |

---

## SD-BR-049 Missing tax id identified by a single space

| Field | Value |
| --- | --- |
| **Statement** | A missing tax id is identified by `PrimaryTaxId` equal to a single space |
| **Trigger** | Query |
| **Enforcement** | `ClaimQueryProvider.GetClaimsMissingTaxId` |
| **Outcome** | List |
| **Source** | `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs` |
| **Operation(s)** | [Claim data-quality queries](operations/claim-data-quality-queries.md) |
| **Tables** | [CL_INJURY_CLAIM](database-tables.md#cl_injury_claim), [CL_CLAIM_PERSON](database-tables.md#cl_claim_person) |
| **SQL** | [SQL-060](sql/SQL-060-claim-query-provider-get-claims-missing-tax-id.md) |

---

## SD-BR-050 E-bill status and assignment-rule code sets

| Field | Value |
| --- | --- |
| **Statement** | E-bill status codes (ACCPT, ASSGN, COMPL, DLOAD, EOBDS, EOBRJ, IMAGE, INDEX, NEW, PEND, REJCT, SETUP, EXTR) and assignment rules (CONF, PROV, CLAIM, CLEAN) are fixed constants |
| **Trigger** | Queries |
| **Enforcement** | `EbillQueryProvider` constants |
| **Outcome** | Classification |
| **Source** | `Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs` |
| **Operation(s)** | [E-bill processing queries](operations/e-bill-processing-queries.md) |
| **Tables** | [EBILL](database-tables.md#ebill), [EBILL_BATCH](database-tables.md#ebill_batch), [EBILL_CLEARINGHOUSE](database-tables.md#ebill_clearinghouse), [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [EBILL_EOB](database-tables.md#ebill_eob), [EBILL_RESPONSE_SET](database-tables.md#ebill_response_set), [EBILL_PATIENT](database-tables.md#ebill_patient) |
| **SQL** | [SQL-114](sql/SQL-114-ebill-query-provider-get-bill.md), [SQL-115](sql/SQL-115-ebill-query-provider-get-bill-by-clearinghouse-and-control-number.md), [SQL-116](sql/SQL-116-ebill-query-provider-get-bill-count-by-clearinghouse-control-number.md), [SQL-117](sql/SQL-117-ebill-query-provider-get-bills-for-response-file-for-clearinghouse.md), [SQL-118](sql/SQL-118-ebill-query-provider-get-bills-by-batch.md), [SQL-119](sql/SQL-119-ebill-query-provider-get-bills-by-eob.md), [SQL-120](sql/SQL-120-ebill-query-provider-get-bills-by-received-month.md), [SQL-121](sql/SQL-121-ebill-query-provider-get-ebill-response-set.md), [SQL-122](sql/SQL-122-ebill-query-provider-get-non-indexed-bills.md), [SQL-123](sql/SQL-123-ebill-query-provider-get-non-assigned-bills.md) |

---

## SD-BR-051 Bill included in clearinghouse response file by response-batch state

| Field | Value |
| --- | --- |
| **Statement** | A bill is included in the clearinghouse response file if it has no first response batch, or no last response batch and its status is not "PEN" |
| **Trigger** | Response file build |
| **Enforcement** | `EbillQueryProvider.GetBillsForResponseFileForClearinghouse` |
| **Outcome** | List |
| **Source** | `Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs` |
| **Operation(s)** | [E-bill processing queries](operations/e-bill-processing-queries.md) |
| **Tables** | [EBILL](database-tables.md#ebill), [EBILL_BATCH](database-tables.md#ebill_batch), [EBILL_CLEARINGHOUSE](database-tables.md#ebill_clearinghouse), [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [EBILL_EOB](database-tables.md#ebill_eob), [EBILL_RESPONSE_SET](database-tables.md#ebill_response_set), [EBILL_PATIENT](database-tables.md#ebill_patient) |
| **SQL** | [SQL-114](sql/SQL-114-ebill-query-provider-get-bill.md), [SQL-115](sql/SQL-115-ebill-query-provider-get-bill-by-clearinghouse-and-control-number.md), [SQL-116](sql/SQL-116-ebill-query-provider-get-bill-count-by-clearinghouse-control-number.md), [SQL-117](sql/SQL-117-ebill-query-provider-get-bills-for-response-file-for-clearinghouse.md), [SQL-118](sql/SQL-118-ebill-query-provider-get-bills-by-batch.md), [SQL-119](sql/SQL-119-ebill-query-provider-get-bills-by-eob.md), [SQL-120](sql/SQL-120-ebill-query-provider-get-bills-by-received-month.md), [SQL-121](sql/SQL-121-ebill-query-provider-get-ebill-response-set.md), [SQL-122](sql/SQL-122-ebill-query-provider-get-non-indexed-bills.md), [SQL-123](sql/SQL-123-ebill-query-provider-get-non-assigned-bills.md) |

---

## SD-BR-052 Multiple prescription numbers mark all NDC lines as compound drug

| Field | Value |
| --- | --- |
| **Statement** | More than one distinct prescription number among NDC lines marks all of those lines as compound drug |
| **Trigger** | Bill processing |
| **Enforcement** | `EbillQueryProvider.SetCompoundDrugForAllServiceLinesForTheBill` |
| **Outcome** | Flags set |
| **Source** | `Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs` |
| **Operation(s)** | [E-bill processing queries](operations/e-bill-processing-queries.md) |
| **Tables** | [EBILL](database-tables.md#ebill), [EBILL_BATCH](database-tables.md#ebill_batch), [EBILL_CLEARINGHOUSE](database-tables.md#ebill_clearinghouse), [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [EBILL_EOB](database-tables.md#ebill_eob), [EBILL_RESPONSE_SET](database-tables.md#ebill_response_set), [EBILL_PATIENT](database-tables.md#ebill_patient) |
| **SQL** | [SQL-114](sql/SQL-114-ebill-query-provider-get-bill.md), [SQL-115](sql/SQL-115-ebill-query-provider-get-bill-by-clearinghouse-and-control-number.md), [SQL-116](sql/SQL-116-ebill-query-provider-get-bill-count-by-clearinghouse-control-number.md), [SQL-117](sql/SQL-117-ebill-query-provider-get-bills-for-response-file-for-clearinghouse.md), [SQL-118](sql/SQL-118-ebill-query-provider-get-bills-by-batch.md), [SQL-119](sql/SQL-119-ebill-query-provider-get-bills-by-eob.md), [SQL-120](sql/SQL-120-ebill-query-provider-get-bills-by-received-month.md), [SQL-121](sql/SQL-121-ebill-query-provider-get-ebill-response-set.md), [SQL-122](sql/SQL-122-ebill-query-provider-get-non-indexed-bills.md), [SQL-123](sql/SQL-123-ebill-query-provider-get-non-assigned-bills.md) |

---

## SD-BR-053 E-bill batch type classification

| Field | Value |
| --- | --- |
| **Statement** | Batch type 837 is e-bill and 835 is payment advice |
| **Trigger** | Batch queries |
| **Enforcement** | `EbillBatchQueryProvider` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/Claims/Ebilling/EbillBatchQueryProvider.cs` |
| **Operation(s)** | [E-bill processing queries](operations/e-bill-processing-queries.md) |
| **Tables** | [EBILL_BATCH](database-tables.md#ebill_batch), [EBILL_CLEARINGHOUSE](database-tables.md#ebill_clearinghouse), [EBILL_BATCH_TYPE_CODE](database-tables.md#ebill_batch_type_code), [EBILL_BATCH_STATUS_CODE](database-tables.md#ebill_batch_status_code) |
| **SQL** | [SQL-078](sql/SQL-078-ebill-batch-query-provider-get-batch.md), [SQL-079](sql/SQL-079-ebill-batch-query-provider-get-batch.md), [SQL-080](sql/SQL-080-ebill-batch-query-provider-get-batch.md), [SQL-081](sql/SQL-081-ebill-batch-query-provider-get-batch.md), [SQL-082](sql/SQL-082-ebill-batch-query-provider-get-first-batch.md), [SQL-083](sql/SQL-083-ebill-batch-query-provider-get-first-batch.md), [SQL-084](sql/SQL-084-ebill-batch-query-provider-get-last-batch.md), [SQL-085](sql/SQL-085-ebill-batch-query-provider-get-last-batch.md), [SQL-086](sql/SQL-086-ebill-batch-query-provider-get-last-batch.md), [SQL-087](sql/SQL-087-ebill-batch-query-provider-get-batch-type.md) |

---

## SD-BR-054 Zero-pay EOB candidate criteria

| Field | Value |
| --- | --- |
| **Statement** | Zero-pay EOB candidates require status COM, an existing audit, an allowed-amount sum of 0, and no existing EOB |
| **Trigger** | EOB build |
| **Enforcement** | `EbillEobQueryProvider.GetCompletedZeroPaymentBillsForEob` |
| **Outcome** | List |
| **Source** | `Data/SAIF.Data/Queries/Claims/Ebilling/EbillEobQueryProvider.cs` |
| **Operation(s)** | [E-bill processing queries](operations/e-bill-processing-queries.md) |
| **Tables** | [EBILL](database-tables.md#ebill), [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [CBP_AUDIT](database-tables.md#cbp_audit), [EBILL_EOB](database-tables.md#ebill_eob), [EBILL_BATCH](database-tables.md#ebill_batch), [EBILL_CLEARINGHOUSE](database-tables.md#ebill_clearinghouse) |
| **SQL** | [SQL-100](sql/SQL-100-ebill-eob-query-provider-get-completed-zero-payment-bills-for-eob.md), [SQL-101](sql/SQL-101-ebill-eob-query-provider-get-completed-zero-payment-bills-for-eob.md), [SQL-102](sql/SQL-102-ebill-eob-query-provider-get-eobs-for-batch.md), [SQL-103](sql/SQL-103-ebill-eob-query-provider-get-eob.md) |

---

## SD-BR-055 DRG code identified by health information type

| Field | Value |
| --- | --- |
| **Statement** | The DRG code is the health-information entry with type "DR" |
| **Trigger** | Lookup |
| **Enforcement** | `EbillHealthInformationQueryProvider.GetDrgCode` |
| **Outcome** | Code |
| **Source** | `Data/SAIF.Data/Queries/Claims/Ebilling/EbillHealthInformationQueryProvider.cs` |
| **Operation(s)** | [E-bill processing queries](operations/e-bill-processing-queries.md) |
| **Tables** | [EBILL_HEALTH_INFORMATION](database-tables.md#ebill_health_information), [EBILL_HEALTH_INFO_TYPE_CODE](database-tables.md#ebill_health_info_type_code), [EBILL](database-tables.md#ebill) |
| **SQL** | [SQL-104](sql/SQL-104-ebill-health-information-query-provider-get-health-information.md), [SQL-105](sql/SQL-105-ebill-health-information-query-provider-get-health-info-type-by-code.md), [SQL-106](sql/SQL-106-ebill-health-information-query-provider-get-drg-code.md) |

---

## SD-BR-056 Active clearinghouse has a null end date

| Field | Value |
| --- | --- |
| **Statement** | The active clearinghouse is the one where `EndDate` is null |
| **Trigger** | Lookup |
| **Enforcement** | `EbillingQueryProvider.GetClearinghouse` |
| **Outcome** | Clearinghouse |
| **Source** | `Data/SAIF.Data/Queries/Claims/EbillingQueryProvider.cs` |
| **Operation(s)** | [E-bill processing queries](operations/e-bill-processing-queries.md) |
| **Tables** | [EBILL_CLEARINGHOUSE](database-tables.md#ebill_clearinghouse) |
| **SQL** | [SQL-142](sql/SQL-142-ebilling-query-provider-get-clearinghouse.md) |

---

## SD-BR-060 Case-to-claim resolution precedence

| Field | Value |
| --- | --- |
| **Statement** | Case-to-claim resolution tries the CC API first, then falls back to WCB, BRB, DCBS, OALJ, and OWCP numbers in order |
| **Trigger** | Lookup |
| **Enforcement** | `LegalQueryProvider.GetClaimIdForCase` |
| **Outcome** | Claim id |
| **Source** | `Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs` |
| **Operation(s)** | [Legal case queries](operations/legal-case-queries.md) |
| **Tables** | [LEGAL_CASE](database-tables.md#legal_case), [CASE_COST](database-tables.md#case_cost), [LEGAL_BILL](database-tables.md#legal_bill), [SUBPOENA](database-tables.md#subpoena), [APPEAL](database-tables.md#appeal), [ADP_EMPLOYEE](database-tables.md#adp_employee), [CASE_STATUS_CODE](database-tables.md#case_status_code), [ATTORNEY_PROFILE](database-tables.md#attorney_profile) |
| **SQL** | [SQL-152](sql/SQL-152-legal-query-provider-get-legal-case.md), [SQL-153](sql/SQL-153-legal-query-provider-get-legal-cases.md), [SQL-154](sql/SQL-154-legal-query-provider-get-claim-id-for-case.md), [SQL-155](sql/SQL-155-legal-query-provider-get-case-cost.md), [SQL-156](sql/SQL-156-legal-query-provider-get-legal-bills.md), [SQL-157](sql/SQL-157-legal-query-provider-get-subpoenas.md), [SQL-158](sql/SQL-158-legal-query-provider-get-appeal-assigned-attorney.md), [SQL-159](sql/SQL-159-legal-query-provider-get-adp-employee-name.md), [SQL-160](sql/SQL-160-legal-query-provider-get-active-legal-cases.md), [SQL-161](sql/SQL-161-legal-query-provider-get-attorney-profile.md) |

---

## SD-BR-061 Preferred employee name takes precedence

| Field | Value |
| --- | --- |
| **Statement** | The preferred employee name takes precedence over the legal name |
| **Trigger** | Lookup |
| **Enforcement** | `LegalQueryProvider.GetAdpEmployeeName` |
| **Outcome** | Name |
| **Source** | `Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs` |
| **Operation(s)** | [Legal case queries](operations/legal-case-queries.md) |
| **Tables** | [LEGAL_CASE](database-tables.md#legal_case), [CASE_COST](database-tables.md#case_cost), [LEGAL_BILL](database-tables.md#legal_bill), [SUBPOENA](database-tables.md#subpoena), [APPEAL](database-tables.md#appeal), [ADP_EMPLOYEE](database-tables.md#adp_employee), [CASE_STATUS_CODE](database-tables.md#case_status_code), [ATTORNEY_PROFILE](database-tables.md#attorney_profile) |
| **SQL** | [SQL-152](sql/SQL-152-legal-query-provider-get-legal-case.md), [SQL-153](sql/SQL-153-legal-query-provider-get-legal-cases.md), [SQL-154](sql/SQL-154-legal-query-provider-get-claim-id-for-case.md), [SQL-155](sql/SQL-155-legal-query-provider-get-case-cost.md), [SQL-156](sql/SQL-156-legal-query-provider-get-legal-bills.md), [SQL-157](sql/SQL-157-legal-query-provider-get-subpoenas.md), [SQL-158](sql/SQL-158-legal-query-provider-get-appeal-assigned-attorney.md), [SQL-159](sql/SQL-159-legal-query-provider-get-adp-employee-name.md), [SQL-160](sql/SQL-160-legal-query-provider-get-active-legal-cases.md), [SQL-161](sql/SQL-161-legal-query-provider-get-attorney-profile.md) |

---

## SD-BR-062 Location code and contact-type precedence

| Field | Value |
| --- | --- |
| **Statement** | Location codes BUS/POL/CLM and contact-type precedence (CLM, then CON) determine the resolved location; Oregon business locations require `State == "OR"` |
| **Trigger** | Lookup |
| **Enforcement** | `LocationQueryProvider` |
| **Outcome** | Location |
| **Source** | `Data/SAIF.Data/Queries/Locations/LocationQueryProvider.cs` |
| **Operation(s)** | [Location lookups](operations/location-lookups.md) |
| **Tables** | [LOCATION](database-tables.md#location), [CONTACT](database-tables.md#contact), [OFFICE_CODE](database-tables.md#office_code) |
| **SQL** | [SQL-167](sql/SQL-167-location-query-provider-get-location.md), [SQL-168](sql/SQL-168-location-query-provider-get-policy-locations.md), [SQL-169](sql/SQL-169-location-query-provider-get-primary-location.md), [SQL-170](sql/SQL-170-location-query-provider-get-policy-mailing-location.md), [SQL-171](sql/SQL-171-location-query-provider-get-location-contacts.md), [SQL-172](sql/SQL-172-location-query-provider-get-polcy-claim-location-with-default.md), [SQL-173](sql/SQL-173-location-query-provider-get-claim-location-contact-with-default.md), [SQL-174](sql/SQL-174-location-query-provider-get-office-code.md), [SQL-175](sql/SQL-175-location-query-provider-get-oregon-business-locations.md) |

---

## SD-BR-070 Output document status code set

| Field | Value |
| --- | --- |
| **Statement** | Output document status codes are PEND, HELD, DELE, and RELE |
| **Trigger** | Queries |
| **Enforcement** | `OutputDocumentQueryProvider` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/OutputDocuments/OutputDocumentQueryProvider.cs` |
| **Operation(s)** | [Output document queries](operations/output-document-queries.md) |
| **Tables** | [document_status_code](database-tables.md#document_status_code), [POLICY](database-tables.md#policy), [batch_process_log](database-tables.md#batch_process_log), [policy_output_document](database-tables.md#policy_output_document), [output_document_type_code](database-tables.md#output_document_type_code), [output_document_category_code](database-tables.md#output_document_category_code) |
| **SQL** | [SQL-181](sql/SQL-181-output-document-query-provider-get-released-status.md), [SQL-182](sql/SQL-182-output-document-query-provider-get-account-number.md), [SQL-183](sql/SQL-183-output-document-query-provider-get-document-date.md), [SQL-184](sql/SQL-184-output-document-query-provider-document-system-date.md), [SQL-185](sql/SQL-185-output-document-query-provider-get-policy-output-document.md), [SQL-186](sql/SQL-186-output-document-query-provider-policy-output-document-query.md), [SQL-187](sql/SQL-187-output-document-query-provider-output-document-type-code-query.md), [SQL-188](sql/SQL-188-output-document-query-provider-get-category-codes.md), [SQL-189](sql/SQL-189-output-document-query-provider-document-status-code-query.md) |

---

## SD-BR-071 Document date defaults from batch process log

| Field | Value |
| --- | --- |
| **Statement** | The document date comes from `BatchProcessLog`, defaulting to today when absent |
| **Trigger** | Query |
| **Enforcement** | `OutputDocumentQueryProvider` |
| **Outcome** | Date |
| **Source** | `Data/SAIF.Data/Queries/OutputDocuments/OutputDocumentQueryProvider.cs` |
| **Operation(s)** | [Output document queries](operations/output-document-queries.md) |
| **Tables** | [document_status_code](database-tables.md#document_status_code), [POLICY](database-tables.md#policy), [batch_process_log](database-tables.md#batch_process_log), [policy_output_document](database-tables.md#policy_output_document), [output_document_type_code](database-tables.md#output_document_type_code), [output_document_category_code](database-tables.md#output_document_category_code) |
| **SQL** | [SQL-181](sql/SQL-181-output-document-query-provider-get-released-status.md), [SQL-182](sql/SQL-182-output-document-query-provider-get-account-number.md), [SQL-183](sql/SQL-183-output-document-query-provider-get-document-date.md), [SQL-184](sql/SQL-184-output-document-query-provider-document-system-date.md), [SQL-185](sql/SQL-185-output-document-query-provider-get-policy-output-document.md), [SQL-186](sql/SQL-186-output-document-query-provider-policy-output-document-query.md), [SQL-187](sql/SQL-187-output-document-query-provider-output-document-type-code-query.md), [SQL-188](sql/SQL-188-output-document-query-provider-get-category-codes.md), [SQL-189](sql/SQL-189-output-document-query-provider-document-status-code-query.md) |

---

## SD-BR-072 Agency sees only agency-viewable and inbox-viewable documents

| Field | Value |
| --- | --- |
| **Statement** | An agency sees only documents flagged agency-viewable or agency-inbox-viewable |
| **Trigger** | Query |
| **Enforcement** | `PolicyOutputDocumentExtensions.AgencyViewable`, `AgencyInboxViewable` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/OutputDocuments/PolicyOutputDocumentExtensions.cs` |
| **Operation(s)** | [Output document queries](operations/output-document-queries.md) |

---

## SD-BR-073 Blank or ALL category applies no filter

| Field | Value |
| --- | --- |
| **Statement** | A category of "ALL" or blank applies no filter |
| **Trigger** | Query |
| **Enforcement** | `PolicyOutputDocumentExtensions.ForCategory` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/OutputDocuments/PolicyOutputDocumentExtensions.cs` |
| **Operation(s)** | [Output document queries](operations/output-document-queries.md) |

---

## SD-BR-074 Policy-or-account filter returns policy docs only while account docs remain unused

| Field | Value |
| --- | --- |
| **Statement** | The policy-or-account filter returns only policy documents; account documents are computed but the concatenation that would include them is unused, a probable defect* |
| **Trigger** | Query |
| **Enforcement** | `PolicyOutputDocumentExtensions.ForPolicyOrAccount` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/OutputDocuments/PolicyOutputDocumentExtensions.cs` |
| **Operation(s)** | [Output document queries](operations/output-document-queries.md) |

---

## SD-BR-075 Child documents only retrievable for a released parent

| Field | Value |
| --- | --- |
| **Statement** | Child documents are only retrievable when the parent document is released; otherwise the call throws |
| **Trigger** | Query |
| **Enforcement** | `OutputDocumentQueryProvider.GetReleasedAgencyViewableChildOutputDocuments` |
| **Outcome** | List or exception |
| **Source** | `Data/SAIF.Data/Queries/OutputDocuments/OutputDocumentQueryProvider.cs` |
| **Operation(s)** | [Output document queries](operations/output-document-queries.md) |
| **Tables** | [document_status_code](database-tables.md#document_status_code), [POLICY](database-tables.md#policy), [batch_process_log](database-tables.md#batch_process_log), [policy_output_document](database-tables.md#policy_output_document), [output_document_type_code](database-tables.md#output_document_type_code), [output_document_category_code](database-tables.md#output_document_category_code) |
| **SQL** | [SQL-181](sql/SQL-181-output-document-query-provider-get-released-status.md), [SQL-182](sql/SQL-182-output-document-query-provider-get-account-number.md), [SQL-183](sql/SQL-183-output-document-query-provider-get-document-date.md), [SQL-184](sql/SQL-184-output-document-query-provider-document-system-date.md), [SQL-185](sql/SQL-185-output-document-query-provider-get-policy-output-document.md), [SQL-186](sql/SQL-186-output-document-query-provider-policy-output-document-query.md), [SQL-187](sql/SQL-187-output-document-query-provider-output-document-type-code-query.md), [SQL-188](sql/SQL-188-output-document-query-provider-get-category-codes.md), [SQL-189](sql/SQL-189-output-document-query-provider-document-status-code-query.md) |

---

## SD-BR-080 Provider identity relationship and address code sets

| Field | Value |
| --- | --- |
| **Statement** | Provider identity codes NPI/ONPI, relationship type WRK, and address types PAY/PHY/COR are applied as fixed filters |
| **Trigger** | Queries |
| **Enforcement** | `ProviderQueryProvider` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs` |
| **Operation(s)** | [Provider queries](operations/provider-queries.md) |
| **Tables** | [PROVIDER_ADDRESS](database-tables.md#provider_address), [PROVIDER](database-tables.md#provider), [PROVIDER_TAX_ID](database-tables.md#provider_tax_id), [PROVIDER_LOCATION](database-tables.md#provider_location), [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [PROVIDER_IDENTITY](database-tables.md#provider_identity) |
| **SQL** | [SQL-200](sql/SQL-200-provider-query-provider-get-provider-address-last-update-date.md), [SQL-201](sql/SQL-201-provider-query-provider-get-all-active-provider-addresses-for-update-date.md), [SQL-202](sql/SQL-202-provider-query-provider-get-provider.md), [SQL-203](sql/SQL-203-provider-query-provider-get-provider-by-tax-id.md), [SQL-204](sql/SQL-204-provider-query-provider-get-provider-by-tax-id.md), [SQL-205](sql/SQL-205-provider-query-provider-get-location.md), [SQL-206](sql/SQL-206-provider-query-provider-get-provider-addresses.md), [SQL-207](sql/SQL-207-provider-query-provider-get-provider-addresses.md), [SQL-208](sql/SQL-208-provider-query-provider-get-provider-location-addresses.md), [SQL-209](sql/SQL-209-provider-query-provider-get-provider-location-addresses.md) |

---

## SD-BR-081 Provider updates stamped with a fixed audit user

| Field | Value |
| --- | --- |
| **Statement** | Provider updates are stamped with the last-update user constant "CMN0140" |
| **Trigger** | Update |
| **Enforcement** | `ProviderQueryProvider` |
| **Outcome** | Audit user |
| **Source** | `Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs` |
| **Operation(s)** | [Provider queries](operations/provider-queries.md) |

---

## SD-BR-082 Dismissed bills excluded from provider location ids

| Field | Value |
| --- | --- |
| **Statement** | Bills with status "DIS" are excluded from provider location ids |
| **Trigger** | Query |
| **Enforcement** | `ProviderQueryProvider.GetBillProviderLocationIds` |
| **Outcome** | List |
| **Source** | `Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs` |
| **Operation(s)** | [Provider queries](operations/provider-queries.md) |
| **Tables** | [PROVIDER_ADDRESS](database-tables.md#provider_address), [PROVIDER](database-tables.md#provider), [PROVIDER_TAX_ID](database-tables.md#provider_tax_id), [PROVIDER_LOCATION](database-tables.md#provider_location), [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [PROVIDER_IDENTITY](database-tables.md#provider_identity) |
| **SQL** | [SQL-200](sql/SQL-200-provider-query-provider-get-provider-address-last-update-date.md), [SQL-201](sql/SQL-201-provider-query-provider-get-all-active-provider-addresses-for-update-date.md), [SQL-202](sql/SQL-202-provider-query-provider-get-provider.md), [SQL-203](sql/SQL-203-provider-query-provider-get-provider-by-tax-id.md), [SQL-204](sql/SQL-204-provider-query-provider-get-provider-by-tax-id.md), [SQL-205](sql/SQL-205-provider-query-provider-get-location.md), [SQL-206](sql/SQL-206-provider-query-provider-get-provider-addresses.md), [SQL-207](sql/SQL-207-provider-query-provider-get-provider-addresses.md), [SQL-208](sql/SQL-208-provider-query-provider-get-provider-location-addresses.md), [SQL-209](sql/SQL-209-provider-query-provider-get-provider-location-addresses.md) |

---

## SD-BR-083 Provider in MCO only within date window

| Field | Value |
| --- | --- |
| **Statement** | A provider is in an MCO only within the MCO's effective/expiration date window |
| **Trigger** | Check |
| **Enforcement** | `ProviderQueryProvider.IsProviderInMco` |
| **Outcome** | bool |
| **Source** | `Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs` |
| **Operation(s)** | [Provider queries](operations/provider-queries.md) |
| **Tables** | [PROVIDER_ADDRESS](database-tables.md#provider_address), [PROVIDER](database-tables.md#provider), [PROVIDER_TAX_ID](database-tables.md#provider_tax_id), [PROVIDER_LOCATION](database-tables.md#provider_location), [CBP_BILL](database-tables.md#cbp_bill), [CBP_BILL_STATUS_CODE](database-tables.md#cbp_bill_status_code), [PROVIDER_IDENTITY](database-tables.md#provider_identity) |
| **SQL** | [SQL-200](sql/SQL-200-provider-query-provider-get-provider-address-last-update-date.md), [SQL-201](sql/SQL-201-provider-query-provider-get-all-active-provider-addresses-for-update-date.md), [SQL-202](sql/SQL-202-provider-query-provider-get-provider.md), [SQL-203](sql/SQL-203-provider-query-provider-get-provider-by-tax-id.md), [SQL-204](sql/SQL-204-provider-query-provider-get-provider-by-tax-id.md), [SQL-205](sql/SQL-205-provider-query-provider-get-location.md), [SQL-206](sql/SQL-206-provider-query-provider-get-provider-addresses.md), [SQL-207](sql/SQL-207-provider-query-provider-get-provider-addresses.md), [SQL-208](sql/SQL-208-provider-query-provider-get-provider-location-addresses.md), [SQL-209](sql/SQL-209-provider-query-provider-get-provider-location-addresses.md) |

---

## SD-BR-090 Superseded certificate holders excluded from search

| Field | Value |
| --- | --- |
| **Statement** | Superseded certificate holders are excluded, and search runs a word match across name and address fields |
| **Trigger** | Search |
| **Enforcement** | `CertificateHolderQueryProvider` |
| **Outcome** | List |
| **Source** | `Data/SAIF.Data/Queries/Policies/Certificates/CertificateHolderProvider.cs` |
| **Operation(s)** | [Other query providers](operations/other-query-providers.md) |
| **Tables** | [CERTIFICATE_HOLDER](database-tables.md#certificate_holder) |
| **SQL** | [SQL-051](sql/SQL-051-certificate-holder-query-provider-get-certificate-holder.md), [SQL-052](sql/SQL-052-certificate-holder-query-provider-get-certificate-holders.md), [SQL-053](sql/SQL-053-certificate-holder-query-provider-get-certificate-holders.md) |

---

## SD-BR-091 Task codes compared case-insensitively

| Field | Value |
| --- | --- |
| **Statement** | Task codes are matched case-insensitively |
| **Trigger** | Query |
| **Enforcement** | `TaskQueryProvider` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/Tasks/TaskQueryProvider.cs` |
| **Operation(s)** | [Other query providers](operations/other-query-providers.md) |
| **Tables** | [TASK_SOURCE_CODE](database-tables.md#task_source_code), [TASK_ACTION_CODE](database-tables.md#task_action_code), [TASK_PRIORITY_CODE](database-tables.md#task_priority_code), [TASK_CATEGORY_CODE](database-tables.md#task_category_code), [TASK](database-tables.md#task) |
| **SQL** | [SQL-231](sql/SQL-231-task-query-provider-get-source.md), [SQL-232](sql/SQL-232-task-query-provider-get-action.md), [SQL-233](sql/SQL-233-task-query-provider-get-priroity.md), [SQL-234](sql/SQL-234-task-query-provider-get-category.md), [SQL-235](sql/SQL-235-task-query-provider-get-task.md), [SQL-236](sql/SQL-236-task-query-provider-get-tasks-for-user.md) |

---

## SD-BR-092 Active support order has no termination date

| Field | Value |
| --- | --- |
| **Statement** | An active support order is one with no termination date |
| **Trigger** | Count |
| **Enforcement** | `WorkerQueryProvider.GetActiveSupportOrderCount` |
| **Outcome** | int |
| **Source** | `Data/SAIF.Data/Queries/Claims/WorkerQueryProvider.cs` |
| **Operation(s)** | [Other query providers](operations/other-query-providers.md) |
| **Tables** | [CL_CLAIM_SUPPORT_ORDER](database-tables.md#cl_claim_support_order), [CL_CLAIM_PERSON](database-tables.md#cl_claim_person), [cl_pref_contact_method_code](database-tables.md#cl_pref_contact_method_code), [CL_INJURY_CLAIM](database-tables.md#cl_injury_claim) |
| **SQL** | [SQL-237](sql/SQL-237-worker-query-provider-get-active-support-order-count.md), [SQL-238](sql/SQL-238-worker-query-provider-get-preferred-contact-method.md), [SQL-239](sql/SQL-239-worker-query-provider-get-health-insurance-provider-name.md) |

---

## SD-BR-093 Active report record has a null expiration date

| Field | Value |
| --- | --- |
| **Statement** | An active report record is one with a null `ExpirationDate` |
| **Trigger** | Query |
| **Enforcement** | `ReportQueryProvider` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/Claims/Reports/ReportQueryProvider.cs` |
| **Operation(s)** | [Other query providers](operations/other-query-providers.md) |
| **Tables** | [ATTENDING_PHYSICIAN](database-tables.md#attending_physician), [PROVIDER_LOCATION](database-tables.md#provider_location), [CL_INJURY_CLAIM](database-tables.md#cl_injury_claim), [CL_CLAIM_LEGAL_REPRESENTATIVE](database-tables.md#cl_claim_legal_representative) |
| **SQL** | [SQL-218](sql/SQL-218-report-query-provider-get-attending-claims-with-relationship.md), [SQL-219](sql/SQL-219-report-query-provider-get-legal-rep-claims-with-relationship.md), [SQL-220](sql/SQL-220-report-query-provider-get-active-attending-physician-records-for-claim.md), [SQL-221](sql/SQL-221-report-query-provider-get-active-legal-rep-records-for-claim.md) |

---

## SD-BR-094 MA code identifies medical audit payment type

| Field | Value |
| --- | --- |
| **Statement** | The code "MA" identifies a medical-audit payment type |
| **Trigger** | Query |
| **Enforcement** | `PaymentsQueryProvider` |
| **Outcome** | Filter |
| **Source** | `Data/SAIF.Data/Queries/Payments/PaymentsQueryProvider.cs` |
| **Operation(s)** | [Other query providers](operations/other-query-providers.md) |
| **Tables** | [PAYMENT_TRANSACTION_STAT](database-tables.md#payment_transaction_stat), [PAYMENT_TRANSACTION_TYPE_CODE](database-tables.md#payment_transaction_type_code) |
| **SQL** | [SQL-191](sql/SQL-191-payments-query-provider-get-payment-transaction-statisic.md), [SQL-192](sql/SQL-192-payments-query-provider-get-last-payment-transaction-statisic.md), [SQL-193](sql/SQL-193-payments-query-provider-get-payment-type.md) |

---

## SD-BR-095 Medicare history match requires all fields equal

| Field | Value |
| --- | --- |
| **Statement** | A Medicare beneficiary query history match requires all supplied fields to be equal |
| **Trigger** | Query |
| **Enforcement** | `MedicareQueryProvider` |
| **Outcome** | Match |
| **Source** | `Data/SAIF.Data/Queries/Claims/MedicareQueryProvider.cs` |
| **Operation(s)** | [Other query providers](operations/other-query-providers.md) |
| **Tables** | [MEDICARE_BENEFICIARY_QUERY_BAT](database-tables.md#medicare_beneficiary_query_bat), [MEDICARE_QUERY_HISTORY](database-tables.md#medicare_query_history), [MEDICARE_BENEFICIARY_QUERY](database-tables.md#medicare_beneficiary_query) |
| **SQL** | [SQL-176](sql/SQL-176-medicare-query-provider-get-next-minumum-submission-batch.md), [SQL-177](sql/SQL-177-medicare-query-provider-find-medicare-history-match.md), [SQL-178](sql/SQL-178-medicare-query-provider-get-countfor-batch-of-medicare-beneficiary.md), [SQL-179](sql/SQL-179-medicare-query-provider-get-countfor-batch-of-medicare-history.md), [SQL-180](sql/SQL-180-medicare-query-provider-get-beneficiaries.md) |

---

## SD-BR-100 Child procedure and service ids auto-increment

| Field | Value |
| --- | --- |
| **Statement** | Child procedure/service ids auto-increment when added to a bill |
| **Trigger** | Add child |
| **Enforcement** | `CbpBill.AddProcedure`, `CbpBill.AddService` |
| **Outcome** | Id assigned |
| **Source** | `Data/SAIF.Data/Model/Claims/Bills/CbpBill.cs` |
| **Operation(s)** | [Model helper operations](operations/model-helper-operations.md) |

---

## SD-BR-101 Financial transaction detail must not be null

| Field | Value |
| --- | --- |
| **Statement** | A financial transaction detail must not be null (enforced via the originating `SAIF.Framework.Core`/`Enforce` utility) |
| **Trigger** | Add detail |
| **Enforcement** | `FinancialTransaction.AddDetail` |
| **Outcome** | `ArgumentNullException` |
| **Source** | `Data/SAIF.Data/Model/Claims/Payments/FinancialTransaction.cs` |
| **Operation(s)** | [Model helper operations](operations/model-helper-operations.md) |

---

## SD-BR-102 Subpoena classification helpers

| Field | Value |
| --- | --- |
| **Statement** | Subpoena helpers classify witness type (Nonparties, OtherMedical, Parties), provider type (Claims, MedicalRecords), and zero-pay/no-mail status ("NOML" with a paid sum of 0) |
| **Trigger** | Evaluation |
| **Enforcement** | `Subpoena` properties (`IsWitnessType`, `IsProviderType`, `IsZeroPayNoMail`, `IsZeroPay`, `IsDoNotMail`) |
| **Outcome** | bool |
| **Source** | `Data/SAIF.Data/Model/Legal/Subpoenas/Subpoena.cs` |
| **Operation(s)** | [Model helper operations](operations/model-helper-operations.md) |

---

## SD-BR-103 Claim cost category code lookups and aliases

| Field | Value |
| --- | --- |
| **Statement** | Claim cost category codes (MED, TD, PPD, PTD, FTL, CHE, VSV, VTD, OTH) are fixed lookups; the descriptions "burial expenses" and "death benefits" map to FTL |
| **Trigger** | Lookup |
| **Enforcement** | `ClaimCostCategoryCode` |
| **Outcome** | Code |
| **Source** | `Data/SAIF.Data/Model/Claims/Payments/ClaimCostCategoryCode.cs` |
| **Operation(s)** | [Model helper operations](operations/model-helper-operations.md) |

---

## SD-BR-104 Unknown show-only string defaults to Unread

| Field | Value |
| --- | --- |
| **Statement** | An unrecognized show-only string defaults to `Unread` |
| **Trigger** | Conversion |
| **Enforcement** | `Enums.ConvertShowOnlyStringToEnum` |
| **Outcome** | Enum |
| **Source** | `Data/SAIF.Data/Model/OutputDocuments/Enums.cs` |
| **Operation(s)** | [Model helper operations](operations/model-helper-operations.md) |

## Notes
- Rule IDs follow the analyst's numbering scheme (SD-BR-NNN), grouped by originating query provider or operation, not strictly sequential.
- Mark inferred statements with `*` and unknown statements with `**`. Do not use bold inline confidence labels.

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

## Sources
- `Data/SAIF.Data/Configuration/ContainerBuilderExtensions.cs`
- `Data/SAIF.Data/Clients/HttpClientBase.cs`
- `Data/SAIF.Data/Clients/MedicalBillingApiService.cs`
- `Data/SAIF.Data/Queries/Claims/CCClaimApiService.cs`
- `Data/SAIF.Data/Queries/Claims/ClaimSecurityOverrideProvider.cs`
- `Data/SAIF.Data/Queries/OverpaymentQueryProvider.cs`
- `Data/SAIF.Data/Queries/AuditQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/ClaimQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillBatchQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillEobQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillHealthInformationQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/Ebilling/EbillingQueryProvider.cs`
- `Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs`
- `Data/SAIF.Data/Queries/Policies/LocationQueryProvider.cs`
- `Data/SAIF.Data/Queries/OutputDocuments/OutputDocumentQueryProvider.cs`
- `Data/SAIF.Data/Queries/OutputDocuments/PolicyOutputDocumentExtensions.cs`
- `Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs`
- `Data/SAIF.Data/Queries/Policies/Certificates/CertificateHolderProvider.cs`
- `Data/SAIF.Data/Queries/Tasks/TaskQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/WorkerQueryProvider.cs`
- `Data/SAIF.Data/Queries/Claims/Reports/ReportQueryProvider.cs`
- `Data/SAIF.Data/Queries/PaymentsQueryProvider.cs`
- `Data/SAIF.Data/Queries/MedicareQueryProvider.cs`
- `Data/SAIF.Data/Model/Claims/Bills/CbpBill.cs`
- `Data/SAIF.Data/Model/Claims/Payments/FinancialTransaction.cs`
- `Data/SAIF.Data/Model/Legal/Subpoenas/Subpoena.cs`
