SQL-126: EbillQueryProvider.GetImagedBills¶
This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by EbillQueryProvider.GetImagedBills.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-126 |
| Operation type | Read |
| Execution method | ORM (NHibernate LINQ) |
| Database | Oracle* |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | EbillQueryProvider |
| Criteria property | N/A — ORM |
| Lifecycle method | GetImagedBills |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
batchId |
Input | long | N/A | Method argument of EbillQueryProvider.GetImagedBills bound into the ORM expression; NHibernate generates the bind variable at runtime |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| EBILL | SELECT | EBILL_SEQ_NUM, EBILL_PATIENT_SEQ_NUM, EBILL_STATUS_CODE |
| EBILL_PATIENT | JOIN | EBILL_PATIENT_SEQ_NUM, EBILL_PROVIDER_SEQ_NUM |
| EBILL_PROVIDER | JOIN | EBILL_PROVIDER_SEQ_NUM, EBILL_BATCH_SEQ_NUM |
LINQ statement¶
Source: Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:149. The repository is obtained at Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:29.
// Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:29
billRepository = Factory.GetRepository<Ebill>().Query();
// Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:149
return billRepository
.Where(b => b.Patient.Provider.Batch.Id == batchId &&
b.Status.Code == "IMAGE")
.Select(x => x.Id)
.ToList();
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
E.EBILL_SEQ_NUM
FROM EBILL E
INNER JOIN EBILL_PATIENT EP
ON EP.EBILL_PATIENT_SEQ_NUM = E.EBILL_PATIENT_SEQ_NUM
INNER JOIN EBILL_PROVIDER EP2
ON EP2.EBILL_PROVIDER_SEQ_NUM = EP.EBILL_PROVIDER_SEQ_NUM
WHERE EP2.EBILL_BATCH_SEQ_NUM = :batchId
AND E.EBILL_STATUS_CODE = 'IMAGE'
Translation notes:
b.Patient.Provideris a non-identifier property ofEbillPatient, soEBILL_PATIENTis joined..Batchis a non-identifier property ofEbillProvider, soEBILL_PROVIDERis joined (aliasEP2).Select(x => x.Id)is a projection, so onlyE.EBILL_SEQ_NUMis selected.
Operations and processes¶
Business rules¶
- SD-BR-050 E-bill status and assignment-rule code sets
- SD-BR-051 Bill included in clearinghouse response file by response-batch state
- SD-BR-052 Multiple prescription numbers mark all NDC lines as compound drug
Sources¶
Data/SAIF.Data/Queries/Claims/Ebilling/EbillQueryProvider.cs:149