SQL-353: Update CbpServiceCodeStateless via UpdateService¶
This ORM statement updates a CBP_SERVICE_CODE row's effective/expiration dates and review/reporting flags for a service code, executed from Services/SAIF.Services/Claims/ICDCodeService/Icd10CodeService.cs (L350). The SQL below is inferred from the IRepository<CbpServiceCodeStateless>.Update call and the CbpServiceCodeStateless NHibernate mapping, not literal SQL text in source.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-353 |
| Operation type | Update |
| Execution method | ORM (IRepository.Update) |
| Database | Oracle |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | CbpServiceCodeStateless |
| Criteria property | N/A — ORM |
| Lifecycle method | UpdateService |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
:Code |
Input | string | N/A | Identifier of the CbpServiceCodeStateless being updated (CODE) |
:ServiceType |
Input | string | N/A | Identifier of the CbpServiceCodeStateless being updated (BILL_SERVICE_TYPE_CODE) |
:EffectiveDate |
Input | DateTime | N/A | New value of EFF_DATE |
:ExpirationDate |
Input | DateTime? | N/A | New value of EXP_DATE |
:IsRp1099Required |
Input | bool | N/A | New value of RP_1099_REQ_FLAG |
:UpdateUser |
Input | string | N/A | New value of UPDATE_USER |
:UpdateDate |
Input | DateTime | N/A | New value of UPDATE_DATE |
:IsNurseReviewRequired |
Input | bool | N/A | New value of NURSE_REVIEW_REQUIRED_FLAG |
:DcbsReportServiceCode |
Input | string | N/A | New value of DCBS_REPORT_SERVICE_CODE |
:newVersion |
Input | int | N/A | Incremented UPDATE_NUM value |
:oldVersion |
Input | int | N/A | Current UPDATE_NUM value (optimistic-concurrency check) |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| CBP_SERVICE_CODE | UPDATE | 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: Services/SAIF.Services/Claims/ICDCodeService/Icd10CodeService.cs:350
// Services/SAIF.Services/Claims/ICDCodeService/Icd10CodeService.cs:350
unitOfWork.GetRepository<CbpServiceCodeStateless>().Update(cbpSeviceCode);
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 CBP_SERVICE_CODE
SET
UPDATE_NUM = :newVersion,
EFF_DATE = :EffectiveDate,
EXP_DATE = :ExpirationDate,
RP_1099_REQ_FLAG = :IsRp1099Required,
UPDATE_USER = :UpdateUser,
UPDATE_DATE = :UpdateDate,
NURSE_REVIEW_REQUIRED_FLAG = :IsNurseReviewRequired,
DCBS_REPORT_SERVICE_CODE = :DcbsReportServiceCode
WHERE CODE = :Code
AND BILL_SERVICE_TYPE_CODE = :ServiceType
AND UPDATE_NUM = :oldVersion
Translation notes:
Version(x => x.UpdateNumber).Column("UPDATE_NUM")- NHibernate sets the incremented version and adds the old-version predicate.Update(entity)emits an explicit UPDATE of every updatable mapped column (noDynamicUpdate()on this map).
Operations and processes¶
- Icd10CodeService.UpdateService — see Operations and processes
Sources¶
Services/SAIF.Services/Claims/ICDCodeService/Icd10CodeService.cs (L350)