Skip to content

SQL-045: BillQueryProvider.GetBillServiceCode

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by BillQueryProvider.GetBillServiceCode.

Classification

Field Value
SQL ID SQL-045
Operation type Read
Execution method ORM (NHibernate LINQ)
Database Oracle*
Schema [unqualified]**
Command type N/A (ORM-generated)
Business object BillQueryProvider
Criteria property N/A — ORM
Lifecycle method GetBillServiceCode

Parameters

Parameter Direction Type Max length Description
serviceCode Input string N/A Method argument of BillQueryProvider.GetBillServiceCode bound into the ORM expression; NHibernate generates the bind variable at runtime
serviceTypeCode Input string N/A Method argument of BillQueryProvider.GetBillServiceCode bound into the ORM expression; NHibernate generates the bind variable at runtime

Tables

Table Access Columns used
CBP_SERVICE_CODE SELECT CODE, BILL_SERVICE_TYPE_CODE, UPDATE_NUM, EFF_DATE, EXP_DATE, RP_1099_REQ_FLAG, UPDATE_USER, UPDATE_DATE, NURSE_REVIEW_REQUIRED_FLAG, DCBS_REPORT_SERVICE_CODE

LINQ statement

Source: Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs:192.

Factory.GetRepository<CbpServiceCode>()
    .Query()
    .FirstOrDefault(x => x.ServiceType.Code == serviceTypeCode && x.Code == serviceCode);

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 *
FROM (
  SELECT
    CSC.CODE,
    CSC.BILL_SERVICE_TYPE_CODE,
    CSC.UPDATE_NUM,
    CSC.EFF_DATE,
    CSC.EXP_DATE,
    CSC.RP_1099_REQ_FLAG,
    CSC.UPDATE_USER,
    CSC.UPDATE_DATE,
    CSC.NURSE_REVIEW_REQUIRED_FLAG,
    CSC.DCBS_REPORT_SERVICE_CODE
  FROM CBP_SERVICE_CODE CSC
  WHERE CSC.BILL_SERVICE_TYPE_CODE = :serviceTypeCode
    AND CSC.CODE = :serviceCode
)
WHERE ROWNUM <= 1

Translation notes: - x.ServiceType.Code is the identifier of the ServiceType key-reference, so it resolves to CSC.BILL_SERVICE_TYPE_CODE with no join; CBP_SERVICE_TYPE_CODE is not accessed as a separate table. - The predicate covers the complete composite key, so at most one row qualifies. The ROWNUM wrapper comes from FirstOrDefault under the Oracle10 dialect.

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs:191