Provider location ancillary data retrieval¶
Four small reference lists share an identical architectural shape, distinct from the rest of this library: each is a plain Generic.List(Of T) (not a clsBusinessCollection), populated entirely inside its constructor by a StringBuilder-composed SELECT executed through SqlHelper.ResultSetQuery, filtered by a provider location ID. None goes through IBusinessCriteria or the standard data-portal BeforeRetrieve/AfterRetrieve lifecycle used by the rest of this library. They are merged into one operation here because they are near-duplicate retrieval flows governed by the same construction pattern and the same provider-location scoping, differing only in the table queried and, for service contracts, an additional expiration-window rule.
| Field | Value |
|---|---|
| Operation ID | OP-VP-09 |
| Trigger | New clsMCOProviderList(dpi, providerLocationID) — invoked directly or via clsProviderLocation.MCOList; New clsDCBSCostChargeList(dpi, providerLocationID) — via clsProviderLocation.DCBSCostCharges; New clsProviderServiceList(dpi, providerLocationID) — via clsProviderLocation.Services; New clsProviderServiceContractList(dpi, providerLocationID, [offset]) — via clsProviderLocation.ServiceContracts |
| Inputs | Provider location ID (Decimal) for all four lists; an optional expiration offset in days (Decimal, default 721) for the service-contract list only |
| Outputs | clsMCOProviderList (MCO enrollment fee rates and plan reference), clsDCBSCostChargeList (cost/charge factor by effective window), clsProviderServiceList (service code, description, primary-service flag, DCBS specialty code), clsProviderServiceContractList (discount rates, max charge amount, plan reference, ordered by effective date descending) |
| Primary components | clsMCOProviderList.New, clsDCBSCostChargeList.New, clsProviderServiceList.New, clsProviderServiceContractList.New |
| Entry point | Business\SAIF.Business.View.Provider\clsMCOProvider.vb |
Steps¶
- Construct the list for a location. Each list type's constructor takes the data-portal info and a provider location ID (the service-contract list also accepts an optional offset); construction is the only entry point — there is no separate factory method or lazy retrieval step.
- Compose the query with a
StringBuilder. Each constructor builds itsSELECTby appending literal fragments, always filteringWHERE PROVIDER_LOCATION_SEQ_NUM = :ProviderLocationID: clsMCOProviderListreadsMCO_PROVIDERfor enrollment flags and fee rates (SQL-002, MCO_PROVIDER).clsDCBSCostChargeListreadsPROVIDER_DCBS_COST_CHARGEfor the cost/charge factor and effective window (SQL-001, PROVIDER_DCBS_COST_CHARGE).clsProviderServiceListjoinsPROVIDER_SERVICE_CODEtoPROVIDER_SERVICEfor the service code, description, DCBS specialty code, and primary-service flag (SQL-017, PROVIDER_SERVICE_CODE, PROVIDER_SERVICE).clsProviderServiceContractListreadsPROVIDER_SERVICE_CONTRACTfor discount rates, max charge amount, and plan/service codes, ordered by effective date descending (SQL-016, PROVIDER_SERVICE_CONTRACT).- Apply the service-contract expiration window. When the constructor's offset parameter is greater than zero (the default is 721 days), the service-contract query appends
AND (exp_date IS NULL OR exp_date > (sysdate - :Offset)), excluding contracts expired further in the past than the offset window, and binds:Offset(BR-002). - If the offset is zero or negative: no expiration predicate is appended and no
:Offsetparameter is bound, so all contracts regardless of expiration are returned. - Execute and map each row. Each constructor executes its query through
SqlHelper.ResultSetQuery, then iterates the returned rows, constructing one DTO instance per row and adding it to the list (Me.Add(...)). - Resolve the MCO plan reference for MCO enrollments and service contracts. For each row in the MCO enrollment list, and for each service-contract row whose plan ID is non-blank, the DTO's
SetPlanis called with the plan resolved byGetMCOInfo(inDPI).Plan(planID), and throws anApplicationExceptionif the resolved plan's ID does not match the row's plan ID.
Origin:
GetMCOInfoand itsPlan(planID)lookup are not defined in this library's own source; the MCO plan reference-data resolution is delegated to an external dependency that could not be identified from this library's code alone.** 6. Return the populated list. Once all rows are processed, the fully populated list is available as the return value of theNewconstructor (assigned by the caller) or as the cached lazy-load property onclsProviderLocation.
Process flow¶
The following diagram visualizes this operation's control flow, common to all four list types.
flowchart TD
Start([List constructed for a provider location]) --> Which{Which list?}
Which -->|MCO enrollments| MCO[Query MCO_PROVIDER]
Which -->|DCBS cost charges| DCBS[Query PROVIDER_DCBS_COST_CHARGE]
Which -->|Provider services| Svc[Join PROVIDER_SERVICE_CODE<br>to PROVIDER_SERVICE]
Which -->|Service contracts| Contract[Query PROVIDER_SERVICE_CONTRACT]
Contract --> Offset{Offset greater than zero?}
Offset -->|Yes| AddExp[Append expiration window predicate]
Offset -->|No| NoExp[No expiration predicate]
MCO --> Exec[Execute query]
DCBS --> Exec
Svc --> Exec
AddExp --> Exec
NoExp --> Exec
Exec --> Loop[For each row: construct DTO,<br>add to list]
Loop --> PlanCheck{MCO enrollment or<br>service contract with a plan ID?}
PlanCheck -->|Yes| Resolve[Resolve MCO plan reference;<br>throw if plan ID mismatch]
PlanCheck -->|No| Skip[Skip plan resolution]
Resolve --> Done([Populated list returned])
Skip --> Done
Failure and edge-case behavior¶
- None of these four lists are
clsBusinessCollectiontypes, so they have noIsValid,IsDirty, orSavesemantics; they are pure read-only projections populated once at construction time. - A location with no matching rows for a given list simply returns an empty list; no exception is raised.
SetPlanthrows anApplicationExceptionif the resolved MCO plan's ID (trimmed, case-insensitive) does not match the row's stored plan ID — a defensive consistency check against the external MCO reference-data source rather than a business rule enforced by this library's own data.- The service-contract list guards the plan lookup with a non-blank check on the trimmed plan ID before calling
SetPlan, but the MCO enrollment list callsSetPlanunconditionally for every row, so an MCO enrollment row with a blank plan ID would callGetMCOInfo(inDPI).Plan(""), a path not explicitly guarded in that constructor.* - The default 721-day offset on service contracts is a caller-adjustable parameter; passing
0or a negative number disables the expiration filter entirely and returns every contract ever recorded for the location, including long-expired ones (BR-002).
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
Business\SAIF.Business.View.Provider\clsMCOProvider.vbBusiness\SAIF.Business.View.Provider\clsDCBSCostCharge.vbBusiness\SAIF.Business.View.Provider\clsProviderServices.vbBusiness\SAIF.Business.View.Provider\clsProviderServiceContract.vb