Skip to content

SQL-024: Ebill status update to Assigned (Ebill)

BillAssignment.UpdateBillStatusToAssigned sets the ebill's Status to Assigned and records the assigning user after bill responsibility has been determined. The UPDATE runs via NHibernate dirty-check detection at flush*.

Classification

Field Value
SQL ID SQL-024
Operation type Update*
Execution method ORM (dirty-check flush*)
Database Oracle*
Schema [unqualified]**
Command type N/A — ORM (NHibernate generates SQL at runtime from the ClassMaps in Data/SAIF.Data.NHibernate/Mappings/**)
Business object BillAssignment
Criteria property N/A — ORM
Lifecycle method UpdateBillStatusToAssigned

Tables

Table Access Columns used
EBILL UPDATE UPDATE_NUM, CLEARINGHOUSE_CONTROL_NUM, STATEMENT_FROM_DATE, STATEMENT_THRU_DATE, INJURY_DATE, ADMISSION_DATE, DISCHARGE_DATE, ORIGINAL_BILL_ID, BILL_TOTAL_AMOUNT, UB_BILL_TYPE_CODE, SERVICE_LOCATION_CODE, FACILITY_NPI, SUBMITTER_CONTROL_NUM, TRANSACTION_SET_CONTROL_NUM, UPDATE_USER, UPDATE_DATE, CLEARINGHOUSE_RECEIVED_DATE, CBP_ADMISSION_TYPE_CODE, BILL_ID, EBILL_RECEIPT_BATCH_SEQ_NUM, EBILL_PATIENT_SEQ_NUM, EBILL_STATUS_CODE, FACILITY_ADDRESS_SEQ_NUM, EBILL_SET_TYPE_CODE, EBILL_FIRST_RESPONSE_SEQ_NUM, EBILL_LAST_RESPONSE_SEQ_NUM, EBILL_RESPONSE_SET_SEQ_NUM, EBILL_EOB_SEQ_NUM, EBILL_SEQ_NUM

LINQ statement

Source: Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs:112

// Domain/SAIF.Domain/Claims/Ebilling/BillAssignment.cs:110-115
public static void UpdateBillStatusToAssigned(Ebill bill, IEbillingQueryProvider queryProvider, string updateUser)
{
    bill.Status = queryProvider.BillQueries.GetBillStatusAssigned();
    bill.UpdateUser = updateUser;
    bill.UpdateDate = DateTime.Now;
}

Sample SQL

Inferred SQL: This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
UPDATE EBILL
SET
  UPDATE_NUM = :newVersion,
  CLEARINGHOUSE_CONTROL_NUM = :ClearinghouseControlNumber,
  STATEMENT_FROM_DATE = :StatementFromDate,
  STATEMENT_THRU_DATE = :StatementThruDate,
  INJURY_DATE = :InjuryDate,
  ADMISSION_DATE = :AdmissionDate,
  DISCHARGE_DATE = :DischargeDate,
  ORIGINAL_BILL_ID = :OriginalBillId,
  BILL_TOTAL_AMOUNT = :TotalAmount,
  UB_BILL_TYPE_CODE = :UbBillTypeCode,
  SERVICE_LOCATION_CODE = :ServiceLocationCode,
  FACILITY_NPI = :FacilityNpi,
  SUBMITTER_CONTROL_NUM = :SubmitterControlNumber,
  TRANSACTION_SET_CONTROL_NUM = :TransactionSetControlNumber,
  UPDATE_USER = :UpdateUser,
  UPDATE_DATE = :UpdateDate,
  CLEARINGHOUSE_RECEIVED_DATE = :ClearinghouseReceivedDate,
  CBP_ADMISSION_TYPE_CODE = :CbpAdmissionTypeCode,
  BILL_ID = :Bill,
  EBILL_RECEIPT_BATCH_SEQ_NUM = :ReceiptBatch,
  EBILL_PATIENT_SEQ_NUM = :Patient,
  EBILL_STATUS_CODE = :Status,
  FACILITY_ADDRESS_SEQ_NUM = :FacilityAddress,
  EBILL_SET_TYPE_CODE = :SetType,
  EBILL_FIRST_RESPONSE_SEQ_NUM = :FirstResponseBatch,
  EBILL_LAST_RESPONSE_SEQ_NUM = :LastResponseBatch,
  EBILL_RESPONSE_SET_SEQ_NUM = :ResponseSet,
  EBILL_EOB_SEQ_NUM = :Eob
WHERE EBILL_SEQ_NUM = :Id
  AND UPDATE_NUM = :oldVersion

Translation notes: - No explicit Update() call: under the stateful strategy RepositoryBase.Update is a no-op and the UPDATE is emitted by NHibernate dirty-checking at Commit() flush (Legends: SAIF.Framework.Data.NHibernate RepositoryBase / business-rules). The mapping declares no DynamicUpdate(), so NHibernate sends every updatable mapped column, not only the ones changed here. - Version UPDATE_NUM (EbillMap.cs:13). - Bind variables for References carry the referenced entity's identifier; values not changed by this call site are re-sent unchanged. - The C# code assigns DateTime.Now client-side before flush; the value is bound as an ordinary parameter (no server date function). - GetBillStatusAssigned() is a separate read.

Operations and processes

  • OP-DOM-01 BillAssignment.AssignBillsResponsibily / AssignBillResponsibility — sets the ebill status to Assigned after assignment (see Operations and processes)

Business rules

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