---
title: "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.NHibernate
reference_type: package
---


# SAIF.Data.NHibernate business rules

This page captures business rules enforced by this library, including rules implemented directly in .NET repository/mapping code and rules enforced by the Oracle/SQL Server stored procedures this library calls.

## SDN-BR-001 Claim bill queue operations are served by the Guidewire CC Claim API, not by the legacy Oracle package

| Field | Value |
| --- | --- |
| **Statement** | Claim bill queue operations are served by the Guidewire CC Claim API, not by the legacy Oracle package. Originating rules are in SAIF.Data (`CCClaimApiService`, [SD-BR-013](../saif-data/business-rules.md#sd-br-013-bill-queue-http-status-mapping)) |
| **Trigger** | Bill queue request |
| **Enforcement** | `ClaimBillEntryRepository` |
| **Outcome** | Delegation |
| **SQL** | [SQL-050](sql/SQL-050-get-next-bill-from-queue-unused.md), [SQL-051](sql/SQL-051-restore-bill-to-queue-unused.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/ClaimBillEntryRepository.cs` |

---

## SDN-BR-010 Collection case payments are applied by the Oracle package APPLYPAYMENTS for the case and payment date

| Field | Value |
| --- | --- |
| **Statement** | Collection case payments are applied by the Oracle package `APPLYPAYMENTS` for the case and payment date |
| **Trigger** | Apply payments |
| **Enforcement** | `CollectionsRepository.ApplyPayments` |
| **Outcome** | DB update |
| **Tables** | [LC_TRAN_CATEGORY_CODE](database-tables.md#lc_tran_category_code), [LEGAL_COLLECTION_PAYMENT_REF](database-tables.md#legal_collection_payment_ref), [LEGAL_COLLECTION_TRANSACTION](database-tables.md#legal_collection_transaction), [LEGAL_COLLECTION_TRAN_CODE](database-tables.md#legal_collection_tran_code) |
| **SQL** | [SQL-052](sql/SQL-052-applypayments-unused.md), [SQL-053](sql/SQL-053-collections-repository-apply-payments.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/CollectionsRepository.cs:131` |

---

## SDN-BR-011 SOIL debtor eligibility: balance ≥ 0, include-on-SOIL flag 'Y', no third party, worker id present

| Field | Value |
| --- | --- |
| **Statement** | SOIL debtor eligibility: balance ≥ 0, include-on-SOIL flag 'Y', no third party, worker id present |
| **Trigger** | SOIL run |
| **Enforcement** | `Collections_getWorkerIdForSoilDebtor` (`Collections.hbm.xml`) |
| **Outcome** | Worker id list |
| **Tables** | [CLM_DBA.TEMP_DATA_PERSON_ADDRESS](database-tables.md#clm_dba.temp_data_person_address), [LEGAL_COLLECTION](database-tables.md#legal_collection), [LEGAL_COLLECTION_DEBTOR](database-tables.md#legal_collection_debtor), [PERSON](database-tables.md#person), [SOIL_DEBTOR_REFERENCE](database-tables.md#soil_debtor_reference), [THRDPARTY](database-tables.md#thrdparty) |
| **SQL** | [SQL-002](sql/SQL-002-collections-repository-create-soil-debtor-reference-records.md), [SQL-019](sql/SQL-019-collections-repository-get-worker-id-for-debtors.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Mappings/Collections/Collections.hbm.xml` |

---

## SDN-BR-012 SOIL transactions are selected by the truncated create date

| Field | Value |
| --- | --- |
| **Statement** | SOIL transactions are selected by the truncated create date |
| **Trigger** | SOIL run |
| **Enforcement** | `Collections_getWorkerIdForSoilTrans` (`Collections.hbm.xml`) |
| **Outcome** | Worker id list |
| **Tables** | [LEGAL_COLLECTION](database-tables.md#legal_collection), [LEGAL_COLLECTION_DEBTOR](database-tables.md#legal_collection_debtor), [SOIL_DEBTOR_REFERENCE](database-tables.md#soil_debtor_reference) |
| **SQL** | [SQL-020](sql/SQL-020-collections-repository-get-worker-id-for-soil-trans.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Mappings/Collections/Collections.hbm.xml` |

---

## SDN-BR-020 Claim complexity/segmentation score is computed by the SQL Server procedure bp_clm_segmntn_complexity_score

| Field | Value |
| --- | --- |
| **Statement** | Claim complexity/segmentation score is computed by the SQL Server procedure `bp_clm_segmntn_complexity_score` |
| **Trigger** | Score request |
| **Enforcement** | `ClaimScoreRepository.GetClaimScoreCategory` |
| **Outcome** | Score category |
| **Tables** | [ANALYTICS_DB.dbo.CSG_CLM_SGMNTN_REQUEST_CLAIM](database-tables.md#analytics_db.dbo.csg_clm_sgmntn_request_claim), [EIS_PROD.dbo.WCS_POLICY](database-tables.md#eis_prod.dbo.wcs_policy), [EIS_STAGING.dbo.BDS_CTL_MESSAGES](database-tables.md#eis_staging.dbo.bds_ctl_messages) |
| **SQL** | [SQL-001](sql/SQL-001-claim-score-repository-get-claim-score-category.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/Claims/Information/ClaimScoreRepository.cs:15` |

---

## SDN-BR-030 ProvidersRepository requires a non-null unit of work

| Field | Value |
| --- | --- |
| **Statement** | ProvidersRepository requires a non-null unit of work. Originating rule: SAIF.Framework.Core `Enforce` |
| **Trigger** | Construction |
| **Enforcement** | `ProvidersRepository` constructor |
| **Outcome** | ArgumentNullException |
| **Tables** | [PROVIDER](database-tables.md#provider), [PROVIDER_ADDRESS](database-tables.md#provider_address), [PROVIDER_LOCATION](database-tables.md#provider_location) |
| **SQL** | [SQL-048](sql/SQL-048-providers-repository-get-provider-by-tax-id-batch.md), [SQL-049](sql/SQL-049-providers-repository-get-provider-addresses.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/ProvidersRepository.cs:20` |

---

## SDN-BR-031 Provider payment address type = PAY, physical = PHY

| Field | Value |
| --- | --- |
| **Statement** | Provider payment address type = PAY, physical = PHY |
| **Trigger** | Address lookup |
| **Enforcement** | `ProvidersRepository.GetProviderPaymentAddresses` / `GetProviderPhysicalAddresses` |
| **Outcome** | Filtered list |
| **Tables** | [PROVIDER](database-tables.md#provider), [PROVIDER_ADDRESS](database-tables.md#provider_address), [PROVIDER_LOCATION](database-tables.md#provider_location) |
| **SQL** | [SQL-049](sql/SQL-049-providers-repository-get-provider-addresses.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/ProvidersRepository.cs:20` |

---

## SDN-BR-040 Group image delete is a soft delete

| Field | Value |
| --- | --- |
| **Statement** | Group image delete is a soft delete (ImageDeleteCode = "Y", with audit stamp), applied only if not already deleted |
| **Trigger** | Delete |
| **Enforcement** | `GroupImageRepository.Delete` |
| **Outcome** | Row updated |
| **SQL** | [SQL-054](sql/SQL-054-group-image-repository-delete.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/Groups/GroupImageRepository.cs:23` |

---

## SDN-BR-041 Filter sentinels "---"

| Field | Value |
| --- | --- |
| **Statement** | Filter sentinels "---" (all categories), "-100" (all doc types) and "" (all users) mean no filter |
| **Trigger** | Search |
| **Enforcement** | `GroupImageRepository.GetFilteredImageGroups`, `ImageFilterCriteria` (SAIF.Data) |
| **Outcome** | Filtered list |
| **Tables** | [Image_Group](database-tables.md#image_group) |
| **SQL** | [SQL-025](sql/SQL-025-group-image-repository-get-filtered-image-groups.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/Groups/GroupImageRepository.cs:23` |

---

## SDN-BR-042 Deleted images are visible only to users permitted to see deleted images

| Field | Value |
| --- | --- |
| **Statement** | Deleted images are visible only to users permitted to see deleted images |
| **Trigger** | Search |
| **Enforcement** | `GroupImageRepository.GetFilteredImageGroups` |
| **Outcome** | Filtered list (authorization) |
| **Tables** | [Image_Group](database-tables.md#image_group) |
| **SQL** | [SQL-025](sql/SQL-025-group-image-repository-get-filtered-image-groups.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/Groups/GroupImageRepository.cs:23` |

---

## SDN-BR-043 Confidential images are visible only to users permitted to see confidential images

| Field | Value |
| --- | --- |
| **Statement** | Confidential images are visible only to users permitted to see confidential images; non-confidential images are always visible |
| **Trigger** | Search |
| **Enforcement** | `GroupImageRepository.GetFilteredImageGroups` |
| **Outcome** | Filtered list (authorization) |
| **Tables** | [Image_Group](database-tables.md#image_group) |
| **SQL** | [SQL-025](sql/SQL-025-group-image-repository-get-filtered-image-groups.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/Groups/GroupImageRepository.cs:23` |

---

## SDN-BR-044 Group image categories are those with file code "GROUP"

| Field | Value |
| --- | --- |
| **Statement** | Group image categories are those with file code "GROUP" |
| **Trigger** | Lookup |
| **Enforcement** | `ImageCategoryCodeRepository.GetImageCategoryCodes` |
| **Outcome** | List |
| **SQL** | [SQL-029](sql/SQL-029-image-category-code-repository-image-document-type-found.md), [SQL-030](sql/SQL-030-image-category-code-repository-get-document-type-or-default.md), [SQL-031](sql/SQL-031-image-category-code-repository-get-image-category-codes.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/Imaging/ImageCategoryCodeRepository.cs:19` |

---

## SDN-BR-050 Investigation subject name resolves via person, company or provider location, with nvl fallbacks

| Field | Value |
| --- | --- |
| **Statement** | Investigation subject name resolves via person, company or provider location, with `nvl` fallbacks |
| **Trigger** | Lookup |
| **Enforcement** | `InvestigationRepositoryExtensions.GetSubjectName` |
| **Outcome** | Name data |
| **Tables** | [COMPANY](database-tables.md#company), [INVESTIGATION](database-tables.md#investigation), [PERSON](database-tables.md#person), [POLICY](database-tables.md#policy), [PROVIDER_LOCATION](database-tables.md#provider_location), [SUBJECT](database-tables.md#subject) |
| **SQL** | [SQL-032](sql/SQL-032-investigation-repository-extensions-get-subject-name.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/Investigations/InvestigationRepositoryExtensions.cs:8` |

---

## SDN-BR-060 Agency inbox: Unread = not viewed and not agency-deleted

| Field | Value |
| --- | --- |
| **Statement** | Agency inbox: Unread = not viewed and not agency-deleted; All = not agency-deleted; Deleted = agency delete date set |
| **Trigger** | Inbox query |
| **Enforcement** | `PolicyOutputDocumentRepository.GetPolicyOutputDocumentsForInbox`, `PolicyOutputDocumentExtensions` |
| **Outcome** | Filtered list |
| **Tables** | [POLICY](database-tables.md#policy), [output_document](database-tables.md#output_document), [policy_output_document](database-tables.md#policy_output_document) |
| **SQL** | [SQL-043](sql/SQL-043-policy-output-document-repository-get-policy-output-documents-for-inbox.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/OutputDocuments/PolicyOutputDocumentRepository.cs:38` |

---

## SDN-BR-061 Agencies see only released, agency-viewable documents

| Field | Value |
| --- | --- |
| **Statement** | Agencies see only released, agency-viewable documents (held/pending for the specific views). Duplicates SAIF.Data [SD-BR-070](../saif-data/business-rules.md#sd-br-070-output-document-status-code-set)/[SD-BR-072](../saif-data/business-rules.md#sd-br-072-agency-sees-only-agency-viewable-and-inbox-viewable-documents) |
| **Trigger** | Query |
| **Enforcement** | `PolicyOutputDocumentExtensions.Released` / `AgencyViewable` / `AgencyInboxViewable` |
| **Outcome** | Filtered list |
| **Tables** | [POLICY](database-tables.md#policy), [output_document](database-tables.md#output_document), [policy_output_document](database-tables.md#policy_output_document) |
| **SQL** | [SQL-041](sql/SQL-041-policy-output-document-repository-get-released-agency-viewable-policy-output-documents.md), [SQL-042](sql/SQL-042-policy-output-document-repository-get-held-and-pending-agency-viewable-policy-output-documents.md), [SQL-043](sql/SQL-043-policy-output-document-repository-get-policy-output-documents-for-inbox.md) |
| **Source** | `Data/SAIF.Data/Queries/OutputDocuments/PolicyOutputDocumentExtensions.cs` |

---

## SDN-BR-062 Category "ALL" or blank means no filter

| Field | Value |
| --- | --- |
| **Statement** | Category "ALL" or blank means no filter |
| **Trigger** | Query |
| **Enforcement** | `PolicyOutputDocumentExtensions.ForCategory` |
| **Outcome** | Filtered list |
| **Tables** | [POLICY](database-tables.md#policy), [output_document](database-tables.md#output_document), [policy_output_document](database-tables.md#policy_output_document) |
| **SQL** | [SQL-041](sql/SQL-041-policy-output-document-repository-get-released-agency-viewable-policy-output-documents.md) |
| **Source** | `Data/SAIF.Data/Queries/OutputDocuments/PolicyOutputDocumentExtensions.cs` |

---

## SDN-BR-063 Child documents are returned only for a released parent

| Field | Value |
| --- | --- |
| **Statement** | Child documents are returned only for a released parent |
| **Trigger** | Query |
| **Enforcement** | `PolicyOutputDocumentRepository.GetReleasedAgencyViewableChildOutputDocuments` |
| **Outcome** | List or exception |
| **Tables** | [POLICY](database-tables.md#policy), [output_document](database-tables.md#output_document), [policy_output_document](database-tables.md#policy_output_document) |
| **SQL** | [SQL-046](sql/SQL-046-policy-output-document-repository-get-released-agency-viewable-child-output-documents.md) |
| **Source** | `Data/SAIF.Data.NHibernate/Repositories/OutputDocuments/PolicyOutputDocumentRepository.cs:38` |

---

## SDN-BR-070 Tri-state Y/N/NULL persistence

| Field | Value |
| --- | --- |
| **Statement** | Tri-state Y/N/NULL persistence |
| **Trigger** | Map/load |
| **Enforcement** | `YesNoNullUserType` |
| **Outcome** | Value conversion |
| **Source** | `Data/SAIF.Data.NHibernate/CustomTypes/YesNoNullUserType.cs` |

---

## SDN-BR-071 Claim authority purpose codes 1–4, default Initiate

| Field | Value |
| --- | --- |
| **Statement** | Claim authority purpose codes 1–4, default Initiate |
| **Trigger** | Map/load |
| **Enforcement** | `ClaimAuthorityPurposeType` |
| **Outcome** | Enum |
| **Source** | `Data/SAIF.Data.NHibernate/CustomTypes/ClaimAuthorityPurposeType.cs` |

---

## SDN-BR-072 Certificate delivery method codes

| Field | Value |
| --- | --- |
| **Statement** | Certificate delivery method codes |
| **Trigger** | Map/load |
| **Enforcement** | `CertificateDeliveryMethodsType` |
| **Outcome** | Enum |
| **Source** | `Data/SAIF.Data.NHibernate/CustomTypes/CertificateDeliveryMethodsType.cs` |

---

## SDN-BR-073 Certificate distribution status codes, default DoNotPrint

| Field | Value |
| --- | --- |
| **Statement** | Certificate distribution status codes, default DoNotPrint |
| **Trigger** | Map/load |
| **Enforcement** | `CertificateDistributionStatusType` |
| **Outcome** | Enum |
| **Source** | `Data/SAIF.Data.NHibernate/CustomTypes/CertificateDistributionStatusType.cs` |

---

## SDN-BR-074 Certificate renewal notification codes

| Field | Value |
| --- | --- |
| **Statement** | Certificate renewal notification codes |
| **Trigger** | Map/load |
| **Enforcement** | `CertificateRenewalNotificationTypesType` |
| **Outcome** | Enum |
| **Source** | `Data/SAIF.Data.NHibernate/CustomTypes/CertificateRenewalNotificationTypesType.cs` |

---

## SDN-BR-075 Certificate type codes BID/OSC/STD

| Field | Value |
| --- | --- |
| **Statement** | Certificate type codes BID/OSC/STD |
| **Trigger** | Map/load |
| **Enforcement** | `CertificateTypeType` |
| **Outcome** | Enum |
| **Source** | `Data/SAIF.Data.NHibernate/CustomTypes/CertificateTypeType.cs` |

---

## Stored procedure business rules

Rules enforced by stored procedures this library calls. Each rule gets its own H2 section, restated in full as this page's canonical home for the rule.

## PROC-RULE-001 Numeric references match case id, policy number or claim number

| Field | Value |
| --- | --- |
| **Statement** | Numeric references match case id, policy number or claim number |
| **Trigger** | reference_id_in is numeric and ≠ 0 |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_cases_by_reference` — Match LEGAL_COLLECTION seq_num, policy_num or saif_claim_num |
| **Outcome** | Match LEGAL_COLLECTION seq_num, policy_num or saif_claim_num |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-002 Non-numeric references

| Field | Value |
| --- | --- |
| **Statement** | Non-numeric references (OD claims) match the claim number only; the case description depends on the case code |
| **Trigger** | Non-numeric reference; code WRKR/FOTH/THRD/CTHRD vs POL/FPOL/CPOL |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_cases_by_reference` — Match saif_claim_num; describe as claim number, or as policy number + name |
| **Outcome** | Match saif_claim_num; describe as claim number, or as policy number + name |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-003 Payments and credit adjustments are shown negative

| Field | Value |
| --- | --- |
| **Statement** | Payments and credit adjustments are shown negative |
| **Trigger** | Tran code PMT or CADJ |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_category_totals` — Negate the amount; RPMT is shown as Payments |
| **Outcome** | Negate the amount; RPMT is shown as Payments |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-004 Fixed display order of categories

| Field | Value |
| --- | --- |
| **Statement** | Fixed display order of categories |
| **Trigger** | Category code |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_category_totals` — BBAL 1, COST2 2, PJFEE 2 ("Pre-Judgment Fees"), INT2 3, COST3 4, INT 5, COST 6, CADJ 7, DADJ 8, other 10 |
| **Outcome** | BBAL 1, COST2 2, PJFEE 2 ("Pre-Judgment Fees"), INT2 3, COST3 4, INT 5, COST 6, CADJ 7, DADJ 8, other 10 |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-005 The subtotal excludes payments

| Field | Value |
| --- | --- |
| **Statement** | The subtotal excludes payments |
| **Trigger** | Display row 9 |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_category_totals` — Sum all categories except PMT/RPMT (CADJ negated); Current Balance is row 11 |
| **Outcome** | Sum all categories except PMT/RPMT (CADJ negated); Current Balance is row 11 |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-006 Judgment description source

| Field | Value |
| --- | --- |
| **Statement** | Judgment description source |
| **Trigger** | Judgment code NA |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_category_totals` — Use code_descr; otherwise JUDGMENT_DESCR |
| **Outcome** | Use code_descr; otherwise JUDGMENT_DESCR |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-007 Foreign address flag

| Field | Value |
| --- | --- |
| **Statement** | Foreign address flag |
| **Trigger** | LOC_ADDR3 populated* |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_fraud_other_address` — ForeignAddressFlag derived from LOC_ADDR3 on LOCATION_VIEW |
| **Outcome** | ForeignAddressFlag derived from LOC_ADDR3 on LOCATION_VIEW |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-008 Debtor location precedence

| Field | Value |
| --- | --- |
| **Statement** | Debtor location precedence |
| **Trigger** | Debtor has loc_seq_num |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_policy_address` — Use the debtor location, else the policy's active 'POL' location (rownum = 1) |
| **Outcome** | Use the debtor location, else the policy's active 'POL' location (rownum = 1) |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-009 Third-party contact sources

| Field | Value |
| --- | --- |
| **Statement** | Third-party contact sources |
| **Trigger** | Person or firm third party |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_thirdparty_address` — UNION ALL person address and company address; phone type 'P', fax type 'F' |
| **Outcome** | UNION ALL person address and company address; phone type 'P', fax type 'F' |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-010 Closed cases are hidden unless requested

| Field | Value |
| --- | --- |
| **Statement** | Closed cases are hidden unless requested |
| **Trigger** | show_closed_cases_in = 'N' |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.search_collections` — Add CURRENT_BALANCE_AMT > 0 to every search branch |
| **Outcome** | Add CURRENT_BALANCE_AMT > 0 to every search branch |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-011 Search branch selection

| Field | Value |
| --- | --- |
| **Statement** | Search branch selection |
| **Trigger** | policy_name_in supplied vs not |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.search_collections` — Policy/company name search (POLICY_SEARCH types LEGAL/TRD with DBA labelling, third-party companies); else worker name via CLM_DBA.TEMP_DATA_PERSON_ADDRESS (run_id), worker SSN, affiliate, third-party person, fraud-other |
| **Outcome** | Policy/company name search (POLICY_SEARCH types LEGAL/TRD with DBA labelling, third-party companies); else worker name via CLM_DBA.TEMP_DATA_PERSON_ADDRESS (run_id), worker SSN, affiliate, third-party person, fraud-other |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-012 Debtor name resolution order

| Field | Value |
| --- | --- |
| **Statement** | Debtor name resolution order |
| **Trigger** | First match (rownum ≤ 1) |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.getDebtorName / getPrimaryDebtorName` — Affiliate → policy name → third-party person → third-party company → fraud-other (FOTH, suffix included) |
| **Outcome** | Affiliate → policy name → third-party person → third-party company → fraud-other (FOTH, suffix included) |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-013 Debtor SSN source

| Field | Value |
| --- | --- |
| **Statement** | Debtor SSN source (PII) |
| **Trigger** | Debtor type |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.getDebtorSSN` — Affiliate match, third-party person TAX_ID, or FOTH debtor SSN |
| **Outcome** | Affiliate match, third-party person TAX_ID, or FOTH debtor SSN |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-014 'ALL' selects every case

| Field | Value |
| --- | --- |
| **Statement** | 'ALL' selects every case |
| **Trigger** | legal_collection_seq_num_in = 'ALL' |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.interest_calc_select` — Convert to '%' LIKE pattern |
| **Outcome** | Convert to '%' LIKE pattern |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-015 Monthly interest accrues only after a full prior month

| Field | Value |
| --- | --- |
| **Statement** | Monthly interest accrues only after a full prior month |
| **Trigger** | Interest option MTH |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.interest_calc_select` — ROUND(outstanding × rate / 12 × (1 if days since interest start ≥ days in prior month else 0), 2) |
| **Outcome** | ROUND(outstanding × rate / 12 × (1 if days since interest start ≥ days in prior month else 0), 2) |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-016 Daily interest

| Field | Value |
| --- | --- |
| **Statement** | Daily interest |
| **Trigger** | Interest option DAY |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.interest_calc_select` — outstanding × rate × days / 365.25, rounded; only INTEREST_FLAG = 'Y', outstanding > 0, rate > 0; only interest > 0 returned |
| **Outcome** | outstanding × rate × days / 365.25, rounded; only INTEREST_FLAG = 'Y', outstanding > 0, rate > 0; only interest > 0 returned |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-017 Interest start date and statement balance

| Field | Value |
| --- | --- |
| **Statement** | Interest start date and statement balance |
| **Trigger** | Case transactions |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.get_interest_start_date / get_last_statement_balance` — Start = TRUNC(MAX(date)) where REFERENCE_TEXT = 'LCB00003', else MIN(date), else SYSDATE; statement balance = sum to date with PMT/CADJ negated, NO_DATA_FOUND → 0 |
| **Outcome** | Start = TRUNC(MAX(date)) where REFERENCE_TEXT = 'LCB00003', else MIN(date), else SYSDATE; statement balance = sum to date with PMT/CADJ negated, NO_DATA_FOUND → 0 |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-018 Unposted payments for open cases

| Field | Value |
| --- | --- |
| **Statement** | Unposted payments for open cases |
| **Trigger** | Case balance > 0 |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.getPolicyPayments / getThirdPartyPayments` — Policy financial trans with trans_amt < 0 on/after date and no matching LC transaction; third-party distributions created after date |
| **Outcome** | Policy financial trans with trans_amt < 0 on/after date and no matching LC transaction; third-party distributions created after date |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-019 Statement and follow-up selection

| Field | Value |
| --- | --- |
| **Statement** | Statement and follow-up selection |
| **Trigger** | Balance and hold flags |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.getDebtorsWithoutPayments / getDebtorsWithExpiredLocs / getBalanceBroughtToMinAmount` — No DPMT after date with HOLD_STATEMENT_FLAG = 'N'; expired policy location updated after date; balance < 100 whose latest transaction is DPMT after date |
| **Outcome** | No DPMT after date with HOLD_STATEMENT_FLAG = 'N'; expired policy location updated after date; balance < 100 whose latest transaction is DPMT after date |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-020 Each request gets a new model sequence number

| Field | Value |
| --- | --- |
| **Statement** | Each request gets a new model sequence number |
| **Trigger** | Every call |
| **Enforcement** | `bp_clm_segmntn_complexity_score` — NEXT VALUE FOR dbo.CSG_ModelSeqNum |
| **Outcome** | NEXT VALUE FOR dbo.CSG_ModelSeqNum |
| **Origin** | [`bp_clm_segmntn_complexity_score`](procedures/bp-clm-segmntn-complexity-score.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `bp_clm_segmntn_complexity_score` |

---

## PROC-RULE-021 The request is persisted before scoring

| Field | Value |
| --- | --- |
| **Statement** | The request is persisted before scoring |
| **Trigger** | Every call |
| **Enforcement** | `bp_clm_segmntn_complexity_score` — INSERT into ANALYTICS_DB.dbo.CSG_CLM_SGMNTN_REQUEST_CLAIM with rtrim'd text parameters and PLCY_ID from EIS_PROD.dbo.WCS_POLICY |
| **Outcome** | INSERT into ANALYTICS_DB.dbo.CSG_CLM_SGMNTN_REQUEST_CLAIM with rtrim'd text parameters and PLCY_ID from EIS_PROD.dbo.WCS_POLICY |
| **Origin** | [`bp_clm_segmntn_complexity_score`](procedures/bp-clm-segmntn-complexity-score.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `bp_clm_segmntn_complexity_score` |

---

## PROC-RULE-022 Current model scores

| Field | Value |
| --- | --- |
| **Statement** | Current model scores; 2026 model runs silently |
| **Trigger** | After insert |
| **Enforcement** | `bp_clm_segmntn_complexity_score` — EXEC _dtl (result) then _dtl_2026 (silent mode) |
| **Outcome** | EXEC _dtl (result) then _dtl_2026 (silent mode) |
| **Origin** | [`bp_clm_segmntn_complexity_score`](procedures/bp-clm-segmntn-complexity-score.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `bp_clm_segmntn_complexity_score` |

---

## PROC-RULE-023 The primary injury type code is stored only

| Field | Value |
| --- | --- |
| **Statement** | The primary injury type code is stored only |
| **Trigger** | @primaryInjuryTypeCode |
| **Enforcement** | `bp_clm_segmntn_complexity_score` — Saved on the request row; not passed to the model |
| **Outcome** | Saved on the request row; not passed to the model |
| **Origin** | [`bp_clm_segmntn_complexity_score`](procedures/bp-clm-segmntn-complexity-score.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `bp_clm_segmntn_complexity_score` |

---

## PROC-RULE-024 Failure notification

| Field | Value |
| --- | --- |
| **Statement** | Failure notification |
| **Trigger** | CATCH block |
| **Enforcement** | `bp_clm_segmntn_complexity_score` — Read BDS_CTL_MESSAGES MSG_ID = 28 and EXEC eis_staging.dbo.bp_send_message; RETURN error number |
| **Outcome** | Read BDS_CTL_MESSAGES MSG_ID = 28 and EXEC eis_staging.dbo.bp_send_message; RETURN error number |
| **Origin** | [`bp_clm_segmntn_complexity_score`](procedures/bp-clm-segmntn-complexity-score.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `bp_clm_segmntn_complexity_score` |

---

## PROC-RULE-025 Only unapplied payments are applied

| Field | Value |
| --- | --- |
| **Statement** | Only unapplied payments are applied |
| **Trigger** | Payment tran PAY_DOWN_ORDER = 0 and outstanding > 0 (inSeqNum = 0 → all cases) |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.applyPayments` — Process in date order |
| **Outcome** | Process in date order |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-026 Pay-down order

| Field | Value |
| --- | --- |
| **Statement** | Pay-down order |
| **Trigger** | Cost transactions PAY_DOWN_ORDER > 0 |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.applyIt` — Apply to costs ordered by pay_down_order, date; reduce outstanding, increment update_num |
| **Outcome** | Apply to costs ordered by pay_down_order, date; reduce outstanding, increment update_num |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-027 Every application is recorded

| Field | Value |
| --- | --- |
| **Statement** | Every application is recorded |
| **Trigger** | Amount applied to a cost |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.legalcol_payment_ref_insert` — INSERT LEGAL_COLLECTION_PAYMENT_REF |
| **Outcome** | INSERT LEGAL_COLLECTION_PAYMENT_REF |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-028 The payment keeps the unapplied remainder

| Field | Value |
| --- | --- |
| **Statement** | The payment keeps the unapplied remainder; the payment date is ignored |
| **Trigger** | After applyIt |
| **Enforcement** | `PK80010_LEGAL_COLLECTIONS.applyPayments` — UPDATE payment outstanding = remainder; pmt_date unused (date filter commented out) |
| **Outcome** | UPDATE payment outstanding = remainder; pmt_date unused (date filter commented out) |
| **Origin** | [`PK80010_LEGAL_COLLECTIONS`](procedures/pk80010-legal-collections.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80010_LEGAL_COLLECTIONS` |

---

## PROC-RULE-030 SOIL eligibility

| Field | Value |
| --- | --- |
| **Statement** | SOIL eligibility |
| **Trigger** | Balance ≥ 0 and INCLUDE_ON_SOIL_FLAG = 'Y' |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.create_reference_records` — INSERT SOIL_DEBTOR_REFERENCE from non-worker debtors (debtor_ssn without '-'), worker debtors (TEMP_DATA_PERSON_ADDRESS by run_id) and third-party debtors (TAX_ID) |
| **Outcome** | INSERT SOIL_DEBTOR_REFERENCE from non-worker debtors (debtor_ssn without '-'), worker debtors (TEMP_DATA_PERSON_ADDRESS by run_id) and third-party debtors (TAX_ID) |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-031 Audit user

| Field | Value |
| --- | --- |
| **Statement** | Audit user |
| **Trigger** | Insert |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.create_reference_records` — update_user = 'LCB0006' |
| **Outcome** | update_user = 'LCB0006' |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-032 Balances are summed per SSN

| Field | Value |
| --- | --- |
| **Statement** | Balances are summed per SSN |
| **Trigger** | Reference rows for the run date |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.create_SOIL_transactions` — Cursor ordered by SSN; accumulate balances |
| **Outcome** | Cursor ordered by SSN; accumulate balances |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-033 No prior DOR balance sentinel

| Field | Value |
| --- | --- |
| **Statement** | No prior DOR balance sentinel |
| **Trigger** | No DEPT_REVENUE_SOIL_BALANCE row |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.find_DOR_balance` — Use -.33 |
| **Outcome** | Use -.33 |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-034 Transaction code

| Field | Value |
| --- | --- |
| **Statement** | Transaction code |
| **Trigger** | Prior balance and new sum |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.insert_soil_tran` — 'A' if prior -.33 or 0 and sum > 0; 'D' if sum = 0; else 'C' |
| **Outcome** | 'A' if prior -.33 or 0 and sum > 0; 'D' if sum = 0; else 'C' |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-035 Zero-balance debtors leave SOIL

| Field | Value |
| --- | --- |
| **Statement** | Zero-balance debtors leave SOIL |
| **Trigger** | Trans code 'D' |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.remove_soil_flag` — UPDATE LEGAL_COLLECTION_DEBTOR include_on_soil_flag = 'N' |
| **Outcome** | UPDATE LEGAL_COLLECTION_DEBTOR include_on_soil_flag = 'N' |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-036 Only changes are sent

| Field | Value |
| --- | --- |
| **Statement** | Only changes are sent |
| **Trigger** | sum ≠ DOR balance |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.create_SOIL_transactions` — INSERT DEPT_REVENUE_SOIL_ADJUSTMENT change_amt = sum − balance |
| **Outcome** | INSERT DEPT_REVENUE_SOIL_ADJUSTMENT change_amt = sum − balance |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-037 Name split

| Field | Value |
| --- | --- |
| **Statement** | Name split |
| **Trigger** | first_name = 'REPLACE' |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.create_SOIL_transactions` — Split the name on a comma |
| **Outcome** | Split the name on a comma |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-038 Dropped debtors are deleted at DOR

| Field | Value |
| --- | --- |
| **Statement** | Dropped debtors are deleted at DOR |
| **Trigger** | DOR balance > 0 (latest received) with no reference row for the run date |
| **Enforcement** | `PK80011_LEGALCOL_SOIL.create_SOIL_transactions` — Insert 'D' adjustment; errors raise -20000 with the SSN |
| **Outcome** | Insert 'D' adjustment; errors raise -20000 with the SSN |
| **Origin** | [`PK80011_LEGALCOL_SOIL`](procedures/pk80011-legalcol-soil.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK80011_LEGALCOL_SOIL` |

---

## PROC-RULE-040 Standard premium from the latest premium-history set

| Field | Value |
| --- | --- |
| **Statement** | Standard premium from the latest premium-history set |
| **Trigger** | Policy + period effective date |
| **Enforcement** | `PK72846_VIEW_POLICY.SP73111_GET_WCIS_STD_PREMIUM` — RETURN pk73059_prem_hist_summary.get_standard_premium(get_max_ph_set_id(in_policy_num, in_pol_per_eff_date)) (pk73059 not retrieved**) |
| **Outcome** | RETURN pk73059_prem_hist_summary.get_standard_premium(get_max_ph_set_id(in_policy_num, in_pol_per_eff_date)) (pk73059 not retrieved**) |
| **Origin** | [`PK72846_VIEW_POLICY`](procedures/pk72846-view-policy.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK72846_VIEW_POLICY` |

---

## PROC-RULE-041 Shared logic with BDS

| Field | Value |
| --- | --- |
| **Statement** | Shared logic with BDS |
| **Trigger** | Any change |
| **Enforcement** | `PK72846_VIEW_POLICY.SP73111_GET_WCIS_STD_PREMIUM` — Header comment: changes must be coordinated with BDS |
| **Outcome** | Header comment: changes must be coordinated with BDS |
| **Origin** | [`PK72846_VIEW_POLICY`](procedures/pk72846-view-policy.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK72846_VIEW_POLICY` |

---

## PROC-RULE-045 Procedure wrapper exists for NHibernate

| Field | Value |
| --- | --- |
| **Statement** | Procedure wrapper exists for NHibernate |
| **Trigger** | NHibernate cannot call a VARCHAR2 function |
| **Enforcement** | `PK73101_IMAGE.track_in_report (procedure)` — Call wcis_dba.pk73101_image.track_in_report@POLDB and discard the arrears flag |
| **Outcome** | Call wcis_dba.pk73101_image.track_in_report@POLDB and discard the arrears flag |
| **Origin** | [`PK73101_IMAGE`](procedures/pk73101-image.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK73101_IMAGE` |

---

## PROC-RULE-046 Temporary until Guidewire

| Field | Value |
| --- | --- |
| **Statement** | Temporary until Guidewire |
| **Trigger** | Header comment |
| **Enforcement** | `PK73101_IMAGE.track_in_report (procedure)` — Wrapper can be removed once Guidewire implements the function |
| **Outcome** | Wrapper can be removed once Guidewire implements the function |
| **Origin** | [`PK73101_IMAGE`](procedures/pk73101-image.md#business-rules) |
| **Source** | Oracle DBA_SOURCE / retrieved package source: `PK73101_IMAGE` |

---

## Notes
- Statements marked with `*` were inferred from code structure, naming conventions, or
  contextual evidence where direct confirmation was not available in source artifacts.
- Statements marked with `**` could not be confirmed from available source and should be
  treated as unknown until verified.

## 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)
- [Procedures](procedures/index.md)
- [Security and authorization](security-authorization.md)
- [API reference](api/index.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- `Data/SAIF.Data.NHibernate/Repositories/**`
- `Data/SAIF.Data.NHibernate/Mappings/**`
