SQL-119: Retrieve CbpBillService via SubmitBill¶
This ORM statement performs a read operation on CbpBillService via IUnitOfWork.GetRepository<T>(), executed from Services/SAIF.Services/Claims/Bills/BillEntryService.cs (L321).
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-119 |
| Operation type | Read |
| Execution method | ORM (NHibernate LINQ) |
| Database | Oracle |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | CbpBillService |
| Criteria property | N/A — ORM |
| Lifecycle method | SubmitBill |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
bill.Id |
Input | ** | N/A | x.Bill.Id == bill.Id → column join via Bill (BILL_ID) → Bill.Id |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| CBP_BILL_SERVICE | SELECT | BILL_ID |
LINQ statement¶
Source: Services/SAIF.Services/Claims/Bills/BillEntryService.cs:321
// Services/SAIF.Services/Claims/Bills/BillEntryService.cs:321
if (!unitOfWork.GetRepository<CbpBillService>().Query().Where(x => x.Bill.Id == bill.Id).Any())
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
-- Services/SAIF.Services/Claims/Bills/BillEntryService.cs:321
SELECT *
FROM (
SELECT 1
FROM CBP_BILL_SERVICE CBS
WHERE CBS.BILL_ID = :Id
)
WHERE ROWNUM <= 1
Translation notes:
- Terminal .Any() -> SELECT 1 ... ROWNUM <= 1; bill.Id -> bind :Id.
Operations and processes¶
- BillEntryService.SubmitBill — see Operations and processes
Business rules¶
- SVC-BR-BIL-080 BillTotalAmount NotNull - 'Error - Bill total amount is required.'
- SVC-BR-BIL-081 BillTypeCode NotNull - 'Error - Bill type is required.'
- SVC-BR-BIL-082 DrgCode ≤3 - 'Error - DRG code can be a maximum 3 characters.'
- SVC-BR-BIL-083 Claim number must be valid (ClaimQueryProvider.IsValidClaim) - 'Error - Claim not found.'---'error---claim-not-found.')
- SVC-BR-BIL-084 UbBillTypeCode numeric - 'Error - UB Bill Type Code is invalid. Must be numeric.'
- SVC-BR-BIL-085 CBPAdmissionTypeCode must be in the acceptable list - 'Error - CBP Admission Type Code is invalid.'
- SVC-BR-BIL-090 Submit requires a claim # - 'Error - Claim number is required.'
- SVC-BR-BIL-091 Billing provider required unless type 'W' - 'Error - Billing Provider is required.'
- SVC-BR-BIL-092 At least one service line - 'Error - At least one service line is required.'
- SVC-BR-BIL-093
Sources¶
Services/SAIF.Services/Claims/Bills/BillEntryService.cs (L321)