Search for provider locations¶
Executes a multi-criteria, dynamically assembled search across provider locations, addresses, tax IDs, other IDs, service types, and MCO plans, returning at most 300 ranked results.
| Field | Value |
|---|---|
| Operation ID | OP-09 |
| Trigger | Caller populates SearchCriteria then invokes searchForProvider(); resetSearchCriteria() clears it |
| Inputs | clsSearchCriteria (ProviderName, TaxId, OtherId, ProviderType, ServiceType, MCOName, BusinessPerson, Street, City, State, ZipCode, AreaCode, PhoneNum) |
| Outputs | Providers (clsProviders, a read-only collection of clsSearchResults) |
| Primary components | clsProviderSearch.searchForProvider |
| Entry point | SAIF.Business.View.Provider/clsProviderSearch.vb:89 |
Steps¶
- Reset the result collection; create a
SqlHelper.ResultSetQuerybound to the DPI. - Evaluate
BusinessPerson:"BUSINESS"→BUSINESS_FLAG = 'Y',"PERSON"→'N', anything else →WHERE 1 = 1(BR-SRCH-004). - Append optional inner joins, each with a bind variable: tax ID →
provider_tax_id; other ID →provider_identity; service type →provider_service; MCO plan →mco_provider. - Append optional predicates for name (prefix
LIKEonLAST_NAME_UPPER_CASEorBUSINESS_NAME_UPPER_CASE), provider type, street (prefixLIKE), city, state, zip, area code, and phone (prefixLIKE) — all normalized per BR-SRCH-008 (upper-cased, trimmed,-/.stripped from phone). - If
ZipCodeis supplied: it must be numeric (BR-SRCH-002). - If
TaxIdis supplied: with hyphens removed, it must be fewer than 10 characters (BR-SRCH-003). - If a provider name was supplied:
UNIONin the registered-name variant (PRVSearchRegName, joiningprovider_tax_id) so registered names are also matched (BR-SRCH-005). - Append
ORDER BY fullNAME ASCand execute (SQL-SRCH-01). - Materialise each row into
clsSearchResults, computingSortNameviaFormatSortName(BR-SRCH-006). - Stop condition: stop adding results once the collection exceeds 299 rows (BR-SRCH-007) — the loop exits with no user-facing warning (an inline comment records that a warning "didn't work").
- Validation rules BR-SRCH-001 … BR-SRCH-003 live on
clsSearchCriteriaand are evaluated by the BOF rule engine;searchForProvideritself does not checkIsValidbefore querying.*
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([SearchCriteria populated]) --> S1[Reset Providers collection]
S1 --> S2{BusinessPerson value?}
S2 -->|BUSINESS| S3[BUSINESS_FLAG = 'Y']
S2 -->|PERSON| S4[BUSINESS_FLAG = 'N']
S2 -->|Other| S5[No flag filter]
S3 --> S6["Append optional joins and<br>predicates"]
S4 --> S6
S5 --> S6
S6 --> S7{Provider name supplied?}
S7 -->|Yes| S8["UNION registered-name<br>variant"]
S7 -->|No| S9[Execute single query]
S8 --> S10["ORDER BY fullNAME ASC,<br>execute"]
S9 --> S10
S10 --> S11["Materialize rows into<br>clsSearchResults"]
S11 --> S12{Rows > 299?}
S12 -->|Yes| S13(["Stop loading, discard<br>remainder"])
S12 -->|No| EndOk([Providers returned])
S13 --> EndOk
Failure and edge-case behavior¶
- No rows match: an empty
Providerscollection is returned. - Result set exceeding 300 rows is silently truncated with no caller-visible warning (BR-SRCH-007).
searchForProviderdoes not checkclsSearchCriteria.IsValidbefore executing, so validation rule breaches (BR-SRCH-001–BR-SRCH-003) do not by themselves prevent a query from running.*
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¶
SAIF.Business.View.Provider/clsProviderSearch.vb