Load provider services and service contracts¶
Loads a provider location's service-code assignments and its service contracts (restricted by an offset window), decorating each contract that has a plan ID with MCO plan details.
| Field | Value |
|---|---|
| Operation ID | OP-12 |
| Trigger | clsProviderLocation.Services / ServiceContracts navigation |
| Inputs | IDataPortalInfo, provider-location ID, optional offset in days (default 721) |
| Outputs | clsProviderServiceList, clsProviderServiceContractList |
| Primary components | clsProviderServiceList..ctor, clsProviderServiceContractList..ctor |
| Entry point | SAIF.Business.View.Provider/clsProviderServices.vb:59; SAIF.Business.View.Provider/clsProviderServiceContract.vb:199 |
Steps¶
- Services: join PROVIDER_SERVICE to PROVIDER_SERVICE_CODE on
:ProviderLocationID(SQL-PSVC-01). - Service contracts: query PROVIDER_SERVICE_CONTRACT on
:ProviderLocationID(SQL-PSVC-02). - If
inOffset > 0(default 721 days): additionally restrict toexp_date is null or exp_date > (sysdate - :Offset)(BR-PSVC-001), ordered byeff_date desc. - If
inOffset <= 0: no expiry restriction is applied. - Each contract with a non-blank plan ID is decorated with its
MCOPlanInfoviaSetPlan, which enforces BR-MCO-001 (throws on plan-ID mismatch).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller request]) --> S1{Services or contracts?}
S1 -->|Services| S2["Join PROVIDER_SERVICE to<br>PROVIDER_SERVICE_CODE"]
S1 -->|Contracts| S3["Query<br>PROVIDER_SERVICE_CONTRACT"]
S2 --> S4["Bind ProviderLocationID,<br>execute"]
S3 --> S5{Offset > 0?}
S5 -->|Yes| S6[Restrict to exp_date null<br>or exp_date > sysdate - Offset]
S5 -->|No| S7[No expiry restriction]
S6 --> S8["Bind ProviderLocationID +<br>Offset, execute"]
S7 --> S8
S4 --> EndOk1(["clsProviderServiceList<br>returned"])
S8 --> S9{Contract has plan ID?}
S9 -->|Yes| S10[SetPlan attaches MCOPlanInfo]
S9 -->|No| EndOk2(["clsProviderServiceContractList<br>returned"])
S10 --> EndOk2
Failure and edge-case behavior¶
- No matching rows for either query: an empty list is returned.
- A contract's plan ID that does not match the plan already assigned raises
ApplicationException("MCO plan submitted does not match plan assigned.")(BR-MCO-001). - An offset of zero or less removes the expiry-window restriction on service contracts entirely (BR-PSVC-001).
Related documentation¶
Sources¶
SAIF.Business.View.Provider/clsProviderServices.vbSAIF.Business.View.Provider/clsProviderServiceContract.vb