SQL-201: ProviderQueryProvider.GetAllActiveProviderAddressesForUpdateDate¶
This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by ProviderQueryProvider.GetAllActiveProviderAddressesForUpdateDate.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-201 |
| Operation type | Read |
| Execution method | ORM (NHibernate LINQ) |
| Database | Oracle* |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | ProviderQueryProvider |
| Criteria property | N/A — ORM |
| Lifecycle method | GetAllActiveProviderAddressesForUpdateDate |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
lastUpdateDate |
Input | DateTime | N/A | Method argument of ProviderQueryProvider.GetAllActiveProviderAddressesForUpdateDate bound into the ORM expression; NHibernate generates the bind variable at runtime |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| PROVIDER_ADDRESS | SELECT | PROVIDER_ADDRESS_SEQ_NUM, UPDATE_NUM, CITY_NAME, COUNTRY_CODE, EFF_DATE, EXP_DATE, ADDRESS_LINE1, ADDRESS_LINE2, ADDRESS_LINE3, ADDRESS_LINE4, ZIP_CODE_EXT, STATE_CODE, ZIP_CODE, UPDATE_DATE, UPDATE_USER, FOREIGN_ADDRESS_FLAG, PROVIDER_ADDRESS_CODE, PROVIDER_LOCATION_SEQ_NUM |
LINQ statement¶
Source: Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs:41-45.
public IEnumerable<BatchProviderAddress> GetAllActiveProviderAddressesForUpdateDate(DateTime lastUpdateDate)
{
return Factory.GetRepository<BatchProviderAddress>().Query().Where(x => x.ExpirationDate == null
&& x.UpdateDate > lastUpdateDate
&& x.IsForeign == false
&& x.Line2 == null
&& x.Line3 == null).OrderBy(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
PA.PROVIDER_ADDRESS_SEQ_NUM,
PA.UPDATE_NUM,
PA.CITY_NAME,
PA.COUNTRY_CODE,
PA.EFF_DATE,
PA.EXP_DATE,
PA.ADDRESS_LINE1,
PA.ADDRESS_LINE2,
PA.ADDRESS_LINE3,
PA.ADDRESS_LINE4,
PA.ZIP_CODE_EXT,
PA.STATE_CODE,
PA.ZIP_CODE,
PA.UPDATE_DATE,
PA.UPDATE_USER,
PA.FOREIGN_ADDRESS_FLAG,
PA.PROVIDER_ADDRESS_CODE,
PA.PROVIDER_LOCATION_SEQ_NUM
FROM PROVIDER_ADDRESS PA
WHERE PA.EXP_DATE IS NULL
AND PA.UPDATE_DATE > :lastUpdateDate
AND PA.FOREIGN_ADDRESS_FLAG = 'N'
AND PA.ADDRESS_LINE2 IS NULL
AND PA.ADDRESS_LINE3 IS NULL
ORDER BY PA.PROVIDER_ADDRESS_SEQ_NUM
Translation notes:
- BatchProviderAddress is a second ClassMap on the same PROVIDER_ADDRESS table (BatchProviderAddressMap.cs:11). It maps the address-type and location columns as plain properties, not references.
- IsForeign == false → FOREIGN_ADDRESS_FLAG, CustomType<YesNoType>() (BatchProviderAddressMap.cs:28) → 'N'.
Operations and processes¶
Business rules¶
- SD-BR-080 Provider identity relationship and address code sets
- SD-BR-082 Dismissed bills excluded from provider location ids
- SD-BR-083 Provider in MCO only within date window
Sources¶
Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs:41