Skip to content

SAIF.Domain operations and processes

This page is the operation catalog and cross-operation hub for SAIF.Domain's ebilling assignment, indexing, CBP generation, EDI processing, audit, certificate-holder, Guidewire claim-mapping, and document-packet logic. No per-operation detail pages (operations/*.md) were generated for this library; each catalog row cites the enforcing class/method directly, and step-by-step detail lives in Business rules and the per-type pages under API reference.

Operation catalog

Operation Intent Trigger Inputs Outputs Rules Tables SQL
OP-DOM-01 BillAssignment.AssignBillsResponsibily Assign a bill's responsible party and status based on its pended errors An indexed ebill has pended errors to resolve Ebill, pended errors Ebill status Assigned, AuditNote rows DOM-BR-001-DOM-BR-007 EBILL, CBP_NOTE SQL-024
OP-DOM-02 PatientIndexer.IndexPatientToClaim Match an ebill's patient to a ClaimCenter claim An ebill's patient has not yet been indexed Ebill patient, claim number Indexed patient or error condition DOM-BR-010-DOM-BR-016 EBILL_ERROR_CONDITION SQL-014
OP-DOM-03 ProviderIndexer.IndexProvider (v1) Match a bill's billing provider to a provider location by address An ebill's provider has not yet been indexed (legacy path) Provider tax ID, addresses Billing provider location or error condition DOM-BR-020-DOM-BR-025 PROVIDER_LOCATION —
OP-DOM-04 ProviderIndexerV2.IndexProvider Match a bill's billing provider to a provider location using ordered match rules An ebill's provider has not yet been indexed (current path) Provider tax ID, addresses, provider type Billing provider location or error condition DOM-BR-020, DOM-BR-026-DOM-BR-029a PROVIDER_LOCATION —
OP-DOM-05 BillServiceIndexer.IndexBillServices Resolve the rendering provider location for each bill service Bill services have a rendering NPI and billing location Services, rendering NPI Ebill status Indexed DOM-BR-040-DOM-BR-043 EBILL, PROVIDER_LOCATION SQL-025
OP-DOM-06 GenerateCbpBills.Generate Build CBP bills, services, procedures, and diagnoses from indexed ebills An ebill has completed indexing Indexed ebill New CbpBill graph, ebill status CbpSetup DOM-BR-050-DOM-BR-064 CBP_BILL, CBP_BILL_SERVICE, EBILL SQL-016, SQL-017, SQL-032
OP-DOM-07 ErrorConditionHandler Record an error/pend condition raised by any indexing or assignment step An indexing/assignment step detects an error Error kind EbillErrorCondition row DOM-BR-070 EBILL_ERROR_CONDITION SQL-014
OP-DOM-08 ServiceCodeManager Resolve the effective service code for a bill service A service code lookup is needed during CBP generation Service code, service date Resolved code or Unknown type DOM-BR-080, DOM-BR-081 — —
OP-DOM-09 Batch lifecycle (Batch) Create and progress an ebilling batch through its status lifecycle A new batch arrives or an existing batch transitions Batch data EbillBatch row, status transitions DOM-BR-090-DOM-BR-092 EBILL_BATCH SQL-003, SQL-004, SQL-005, SQL-023
OP-DOM-10 File837Extractor.ProcessFile Parse an inbound X12 837 file into ebill structures An 837 file is received for a batch Raw 837 segments Ebill, bill, service, and document entities DOM-BR-100-DOM-BR-108 EBILL_SERVICE SQL-015
OP-DOM-11 File277CaBuilder.Build277ResponseFile Build a 277 claim-acknowledgement response file A batch of bills needs a 277 response Bills, statuses 277 EDI file, updated ebill response-set links DOM-BR-110, DOM-BR-111 EBILL SQL-030
OP-DOM-12 EobBuilder.GenerateEobs Generate explanation-of-benefits records and adjustments from payment extracts A Guidewire payment extract is available Payment extract, ebills EOB, adjustment, and remittance-advice rows DOM-BR-120-DOM-BR-126 EBILL, EBILL_EOB_ADJUSTMENT, EBILL_EOB_REMITTANCE_ADVICE, PROVIDER_LOCATION SQL-010, SQL-011, SQL-012, SQL-013, SQL-020, SQL-021, SQL-029
OP-DOM-13 Bill behaviours (Bill) Route, audit, pend, approve, and modify a bill's payment options and status A bill needs a status or payment-option change Bill, action Status change, audit note, or exception DOM-BR-030, DOM-BR-130-DOM-BR-135 CBP_BILL_STATUS SQL-006
OP-DOM-14 Audit Disallow or allow all services on an audit and compute totals An audit is created or reviewed Audited services Adjusted allowed amounts, totals DOM-BR-140-DOM-BR-142 — —
OP-DOM-15 AuditNote Attach, modify, or delete an audit note on a bill or claim A note is added, edited, or removed Note category, text CbpNote row created/updated/deleted DOM-BR-150 CBP_NOTE SQL-001, SQL-002, SQL-033
OP-DOM-16 BillRegenerator.Regenerate Clone an existing bill into a new bill for reprocessing A bill must be regenerated Source bill New CbpBill and services DOM-BR-160 CBP_BILL, CBP_BILL_SERVICE SQL-007, SQL-008
OP-DOM-17 CertificateHolder lifecycle (CertificateHolder) Create, update, expire, reinstate, and supersede policy certificate holders A certificate holder is created or its state changes Holder edit contract CertificateHolder row created/updated DOM-BR-170-DOM-BR-172 CERTIFICATE_HOLDER SQL-009, SQL-026, SQL-027, SQL-028
OP-DOM-18 Claim read model (Claim, GuidewireToLegacyMapper) Present a Guidewire-backed claim as a legacy-shaped read model A consumer requests claim data Claim number Claim object with derived properties and SecureClaimAttributes DOM-BR-180-DOM-BR-191, DOM-BR-193-DOM-BR-195 MCO_GSA_LOCATION, PROVIDER_LOCATION SQL-018, SQL-019
OP-DOM-19 Packets (PacketManager, PacketGenerator, PacketDefinition) Assemble document packets for policy correspondence Documents are ready for packet evaluation Documents, policy, period Generated packets DOM-BR-200-DOM-BR-203 ENDORSE_CODE SQL-022
OP-DOM-20 Other (ClaimReserveGenerator, Image, Employee) Build claim reserves, convert Vignette image IDs, and load employee display data A consumer needs reserves, an image, or employee data Claim, image ID, or user ID Reserve amounts, converted image IDs, or employee data DOM-BR-210, DOM-BR-211 — —

Operation index

Each operation below anchors to a stable #op-dom-nn target for cross-references from the API reference and SQL catalog; full Intent/Trigger/Inputs/Outputs/Rules/Tables/SQL detail is in the Operation catalog table above.

OP-DOM-01

BillAssignment.AssignBillsResponsibily — assign a bill's responsible party and status based on its pended errors.

OP-DOM-02

PatientIndexer.IndexPatientToClaim — match an ebill's patient to a ClaimCenter claim.

OP-DOM-03

ProviderIndexer.IndexProvider (v1) — match a bill's billing provider to a provider location by address.

OP-DOM-04

ProviderIndexerV2.IndexProvider — match a bill's billing provider to a provider location using ordered match rules.

OP-DOM-05

BillServiceIndexer.IndexBillServices — resolve the rendering provider location for each bill service.

OP-DOM-06

GenerateCbpBills.Generate — build CBP bills, services, procedures, and diagnoses from indexed ebills.

OP-DOM-07

ErrorConditionHandler — record an error/pend condition raised by any indexing or assignment step.

OP-DOM-08

ServiceCodeManager — resolve the effective service code for a bill service.

OP-DOM-09

Batch lifecycle (Batch) — create and progress an ebilling batch through its status lifecycle.

OP-DOM-10

File837Extractor.ProcessFile — parse an inbound X12 837 file into ebill structures.

OP-DOM-11

File277CaBuilder.Build277ResponseFile — build a 277 claim-acknowledgement response file.

OP-DOM-12

EobBuilder.GenerateEobs — generate explanation-of-benefits records and adjustments from payment extracts.

OP-DOM-13

Bill behaviours (Bill) — route, audit, pend, approve, and modify a bill's payment options and status.

OP-DOM-14

Audit — disallow or allow all services on an audit and compute totals.

OP-DOM-15

AuditNote — attach, modify, or delete an audit note on a bill or claim.

OP-DOM-16

BillRegenerator.Regenerate — clone an existing bill into a new bill for reprocessing.

OP-DOM-17

CertificateHolder lifecycle (CertificateHolder) — create, update, expire, reinstate, and supersede policy certificate holders.

OP-DOM-18

Claim read model (Claim, GuidewireToLegacyMapper) — present a Guidewire-backed claim as a legacy-shaped read model.

OP-DOM-19

Packets (PacketManager, PacketGenerator, PacketDefinition) — assemble document packets for policy correspondence.

OP-DOM-20

Other (ClaimReserveGenerator, Image, Employee) — build claim reserves, convert Vignette image IDs, and load employee display data.

Process flow diagram

The following diagram visualizes the ebilling lifecycle that most of the catalog operations above participate in, from batch receipt through EOB generation.

flowchart TD
    Start([837 file received]) --> Extract["OP-DOM-10<br>File837Extractor.ProcessFile"]
    Extract --> Patient["OP-DOM-02<br>PatientIndexer"]
    Patient --> Provider["OP-DOM-04<br>ProviderIndexerV2"]
    Provider --> Service["OP-DOM-05<br>BillServiceIndexer"]
    Service --> Assign["OP-DOM-01<br>BillAssignment"]
    Assign --> Generate["OP-DOM-06<br>GenerateCbpBills"]
    Generate --> Audit{"Audit required?"}
    Audit -->|Yes| AuditFlow["OP-DOM-14<br>Audit review"]
    Audit -->|No| Eob["OP-DOM-12<br>EobBuilder.GenerateEobs"]
    AuditFlow --> Eob
    Eob --> End([EOB and 835/277 output])

Database interactions

SAIF.Domain's own database interactions are all NHibernate ORM operations mediated by IRepositoryFactory/IUnitOfWork — there is no raw SQL, no stored procedures, and no IBusinessCriteria usage in this library. See Database tables and the SQL catalog for the full 33-operation catalog (18 explicit repository calls, 5 cascade inserts, 10 implicit dirty-check updates).

Operation SQL Tables Type
OP-DOM-01 BillAssignment SQL-024 EBILL Write
OP-DOM-05 BillServiceIndexer.IndexBillServices SQL-025 EBILL Write
OP-DOM-06 GenerateCbpBills.Generate SQL-016, SQL-017, SQL-032 CBP_BILL, CBP_BILL_SERVICE, EBILL Read/Write
OP-DOM-07 ErrorConditionHandler SQL-014 EBILL_ERROR_CONDITION Write
OP-DOM-09 Batch lifecycle SQL-003, SQL-004, SQL-005, SQL-023 EBILL_BATCH Read/Write
OP-DOM-10 File837Extractor.ProcessFile SQL-015 EBILL_SERVICE Write
OP-DOM-11 File277CaBuilder.Build277ResponseFile SQL-030 EBILL Write
OP-DOM-12 EobBuilder.GenerateEobs SQL-010, SQL-011, SQL-012, SQL-013, SQL-020, SQL-021, SQL-029 EBILL, EBILL_EOB_ADJUSTMENT, EBILL_EOB_REMITTANCE_ADVICE, PROVIDER_LOCATION Read/Write
OP-DOM-13 Bill behaviours SQL-006 CBP_BILL_STATUS Write
OP-DOM-15 AuditNote SQL-001, SQL-002, SQL-033 CBP_NOTE Read/Write/Delete
OP-DOM-16 BillRegenerator.Regenerate SQL-007, SQL-008 CBP_BILL, CBP_BILL_SERVICE Write
OP-DOM-17 CertificateHolder lifecycle SQL-009, SQL-026, SQL-027, SQL-028 CERTIFICATE_HOLDER Write
OP-DOM-18 Claim read model SQL-018, SQL-019 MCO_GSA_LOCATION, PROVIDER_LOCATION Read
OP-DOM-19 Packets SQL-022 ENDORSE_CODE Read

Indirect reads via SAIF.Data query providers

Beyond the 33 ORM operations above, SAIF.Domain calls 98 distinct SAIF.Data query-provider methods (e.g. BatchQueries.GetBatch, BillQueries.GetNonAssignedBills, SaifProviderQueries.GetProviderByTaxId) to look up reference data, status codes, and related entities during these same operations. These calls execute SQL owned and cataloged by SAIF.Data, not by this library — see the SAIF.Data SQL catalog for the underlying SQL IDs*. A representative sample:

Provider call SAIF.Data SQL ID(s) Called from (operation)
BatchQueries.GetBatch SQL-078, SQL-079, SQL-080, SQL-081 (SAIF.Data) OP-DOM-09, OP-DOM-11
BillQueries.GetNonAssignedBills SQL-123 (SAIF.Data) OP-DOM-01
SaifProviderQueries.GetProviderByTaxId SQL-203, SQL-204 (SAIF.Data) OP-DOM-03, OP-DOM-04
CbpBillQueries.GetCbpServiceCodeNotExpired / GetCbpServiceCodeExpired SQL-039, SQL-040 (SAIF.Data) OP-DOM-08
AuditQueries.GetAudit SQL-013 (SAIF.Data, candidate by method name)* OP-DOM-14
EobQueries.GetCompletedZeroPaymentBillsForEob SQL-100, SQL-101 (SAIF.Data) OP-DOM-12

The full 98-row mapping (provider call → SAIF.Data SQL ID → call site) is recorded in the Stage 1b analysis and is not repeated in full here; consult the SAIF.Data SQL catalog for the authoritative SQL definitions once that library's documentation set is generated.

Tech debt and design findings

  • REST-only query providers, not database access. ClaimQueryProvider (used by Claim, Bill.GenrateEob, and Worker) and WorkerQueryProvider (used by Worker.GetClaimCount) make REST API calls to Guidewire ClaimCenter — they perform no direct database access despite living in SAIF.Data alongside ORM query providers. Methods such as GetClaim, GetLatestClaimStatus, GetWorkStatus, GetCompensabilityStatus, GetVocationalDetails, HasLegalRepresentativeHistory, GetThirdPartyCase, GetRecoverableOverpaymentBalance, and GetWorker/GetClaimCount are all REST-backed*, which means OP-DOM-18 (the Claim read model) and parts of OP-DOM-13/OP-DOM-20 depend on ClaimCenter availability and latency rather than local database performance characteristics.
  • GetLatestClaimTypeActivity is retired. ClaimQueryProvider.GetLatestClaimTypeActivity, called from Claim.cs:590, throws NotImplementedException unconditionally. Any code path that still reaches Claim's activity-related property depending on this method will fail at runtime; the trigger conditions under which a caller would hit this path are unverified**.
  • File837Extractor static mutable state. The 837 parser holds static mutable state, so batch jobs that process files concurrently could corrupt each other's parsing state*.
  • File837Extractor unimplemented path. A code path in ProcessFile (around line 843) throws NotImplementedException; the trigger conditions are unverified**.
  • ServiceLocationCodeManager possible dead code. A source-code comment on this class states it is not referenced anywhere in the codebase**.

Failure and edge-case behavior

  • A ClaimCenter API failure during patient indexing is recorded as an indexing error rather than raised to the caller (DOM-BR-012).
  • Assignment failures are wrapped and rethrown with the ebill ID for traceability (DOM-BR-007).
  • An unknown bill status passed to BillStatusCode.GetStatusCode throws rather than defaulting (DOM-BR-030).
  • A batch retrieved by Batch.GetBatch that does not match the expected status/type throws InvalidBatchException (DOM-BR-091).
  • An untranslated Guidewire claim status throws InvalidDataException from GuidewireToLegacyMapper (DOM-BR-194).
  • Claim.MyClaimLastLogin swallows a "No row with the given identifier" exception and returns null instead of propagating it (DOM-BR-190).

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

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