SQL-134: Retrieve CbpServicePmGroupCode¶
This ORM statement performs a read operation on CbpServicePmGroupCode via IUnitOfWork.GetRepository<T>(), executed from Services/SAIF.Services/Claims/Bills/AuthorizationService.cs (L143, L170, L246).
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-134 |
| Operation type | Read |
| Execution method | ORM (NHibernate LINQ) |
| Database | Oracle |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | CbpServicePmGroupCode |
| Criteria property | N/A — ORM |
| Lifecycle method | CreateAuthorization, GetServiceTypeCodes, UpdateAuthorization |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
authorization.ServiceType |
Input | ** | N/A | x.Code == authorization.ServiceType → column CODE |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| CBP_SERVICE_PM_GROUP_CODE | SELECT | CODE, UPDATE_NUM, CODE_DESCR, UPDATE_DATE, UPDATE_USER |
LINQ statement¶
Source: Services/SAIF.Services/Claims/Bills/AuthorizationService.cs:143
// Services/SAIF.Services/Claims/Bills/AuthorizationService.cs:143
return AutoMapper.Mapper.Map<ServiceTypeCode[]>(unitOfWork.GetRepository<CbpServicePmGroupCode>().Query().ToList());
// Services/SAIF.Services/Claims/Bills/AuthorizationService.cs:170
authorize.ServicePmGroup = unitOfWork.GetRepository<CbpServicePmGroupCode>().Query().Single(x => x.Code == authorization.ServiceType);
// Services/SAIF.Services/Claims/Bills/AuthorizationService.cs:245-248
ServicePmGroup =
unitOfWork.GetRepository<CbpServicePmGroupCode>()
.Query()
.Single(x => x.Code == authorization.ServiceType),
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/AuthorizationService.cs:143
SELECT
CSPGC.CODE,
CSPGC.UPDATE_NUM,
CSPGC.CODE_DESCR,
CSPGC.UPDATE_DATE,
CSPGC.UPDATE_USER
FROM CBP_SERVICE_PM_GROUP_CODE CSPGC
-- Services/SAIF.Services/Claims/Bills/AuthorizationService.cs:170
SELECT
CSPGC.CODE,
CSPGC.UPDATE_NUM,
CSPGC.CODE_DESCR,
CSPGC.UPDATE_DATE,
CSPGC.UPDATE_USER
FROM CBP_SERVICE_PM_GROUP_CODE CSPGC
WHERE CSPGC.CODE = :ServiceType
-- NHibernate expects at most one row
-- Services/SAIF.Services/Claims/Bills/AuthorizationService.cs:246
SELECT
CSPGC.CODE,
CSPGC.UPDATE_NUM,
CSPGC.CODE_DESCR,
CSPGC.UPDATE_DATE,
CSPGC.UPDATE_USER
FROM CBP_SERVICE_PM_GROUP_CODE CSPGC
WHERE CSPGC.CODE = :ServiceType
-- NHibernate expects at most one row
Translation notes:
- authorization.ServiceType -> bind :ServiceType.
- L241-260 is one object initializer; its CbpAuthorizationTypeCode (SQL-114) and ProviderLocation lookups are separate statements.
Operations and processes¶
- AuthorizationService.CreateAuthorization — see Operations and processes
- AuthorizationService.GetServiceTypeCodes — see Operations and processes
- AuthorizationService.UpdateAuthorization — see Operations and processes
Business rules¶
- SVC-BR-BIL-142 ClaimId NotNull - 'Error - Claim is required.'
- SVC-BR-BIL-143 BillingProviderName NotNull - 'Error - Billing Provider is required.'
Sources¶
Services/SAIF.Services/Claims/Bills/AuthorizationService.cs (L143, L170, L246)