SQL-013: AuditQueryProvider.GetAudit¶
This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by AuditQueryProvider.GetAudit.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-013 |
| Operation type | Read |
| Execution method | ORM (NHibernate LINQ) |
| Database | Oracle* |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | AuditQueryProvider |
| Criteria property | N/A — ORM |
| Lifecycle method | GetAudit |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
auditId |
Input | long | N/A | Method argument of AuditQueryProvider.GetAudit bound into the ORM expression; NHibernate generates the bind variable at runtime |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| CBP_AUDIT | SELECT | BILL_ID, UPDATE_NUM, TOTAL_CHARGED_AMT, TOTAL_ALLOWED_AMT, TOTAL_MCO_ADMIN_FEE_AMT, UPDATE_DATE, UPDATE_USER, AUDIT_RECEIPT_DATE, CHARGEABLE_COST_FLAG, PRINT_EOB_FLAG, SPECIAL_HANDLING_CODE |
LINQ statement¶
Source: Data/SAIF.Data/Queries/AuditQueryProvider.cs:34. The repository is a class field initialised from Factory.GetRepository<CbpAudit>().Query() at Data/SAIF.Data/Queries/AuditQueryProvider.cs:23.
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
SELECT
CA.BILL_ID,
CA.UPDATE_NUM,
CA.TOTAL_CHARGED_AMT,
CA.TOTAL_ALLOWED_AMT,
CA.TOTAL_MCO_ADMIN_FEE_AMT,
CA.UPDATE_DATE,
CA.UPDATE_USER,
CA.AUDIT_RECEIPT_DATE,
CA.CHARGEABLE_COST_FLAG,
CA.PRINT_EOB_FLAG,
CA.SPECIAL_HANDLING_CODE
FROM CBP_AUDIT CA
WHERE CA.BILL_ID = :auditId
-- NHibernate expects at most one row
Translation notes:
- x.Bill.Id is the identifier of References(Bill).Column("BILL_ID"), so it resolves to CA.BILL_ID with no join; CBP_BILL is not accessed as a separate table.
- The parameter is named auditId but is compared to the bill id. CBP_AUDIT is keyed by BILL_ID, so this query is semantically identical to SQL-014.
Operations and processes¶
Business rules¶
- SD-BR-030 Nurse review required if any audited service code flags it
- SD-BR-031 Duplicate services excluded from count
- SD-BR-032 Unset thru-date treated as open-ended
Sources¶
Data/SAIF.Data/Queries/AuditQueryProvider.cs:34