Load and select a provider-location address¶
Loads a location's address rows and applies address-selection logic (active-on-date filtering and a type-based fallback chain) to resolve the best-available address, including cross-location parent/child address resolution.
| Field | Value |
|---|---|
| Operation ID | OP-04 |
| Trigger | clsProviderLocation.Addresses / ActiveAddresses; clsCaseCost payee-address resolution |
| Inputs | IDataPortalInfo, provider-location ID, optional AddressTypes |
| Outputs | clsProviderAddressCollection, clsProviderAddress |
| Primary components | clsProviderAddressCollection.GetProviderAddressCollection, clsProviderAddress.GetAddress |
| Entry point | SAIF.Business.View.Provider/clsProviderAddressCollection.vb:340; SAIF.Business.View.Provider/clsProviderAddress.vb:237–290 |
Steps¶
- Collection
BeforeRetrievesetsSQLStatement = clsProviderAddress.RETRIEVE_SQLand binds:ProviderLocationID(SQL-PADR-01 against PROVIDER_ADDRESS). AfterRetrieveiterates the reader, creatingclsProviderAddress(m_ProviderLocationID)and callingLoad()per row.Fillapplies BR-PADR-001: a nullexp_dateis replaced withDate.MaxValue.ActiveAddresses(date)filters to rows where the date is betweenStartDateandTerminationDate(BR-PADR-002).CalculatePrimaryAddress(addressType)applies the fallback chain BR-PADR-003: Correspondence → Physical; Payment → Physical → Correspondence; Physical → Correspondence.- If no address matches: an empty
clsProviderAddressis returned rather thanNothing(BR-PADR-004). GetAddress(child, parent, addressType)applies BR-PADR-005: if the parent location has a non-empty address it is cloned and used, taggedIsParent = Truewith the parent's name/ID, but re-stamped with the child's business name and location ID; otherwise the child's own address is returned.- Address type resolution uses
GetAddressTypeCode(addressType), which enforces BR-PADR-006 (fixed codesCOR/PAY/PHY; any other value throws). - Note:
clsProviderAddress.BeforeRetrieveonly createsclsUpdateInfoand issues no data request — the type is never retrieved standalone.**
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller request]) --> S1["BeforeRetrieve binds<br>ProviderLocationID"]
S1 --> S2[AfterRetrieve: Fill each row<br>null exp_date -> Date.MaxValue]
S2 --> S3{"Active-date filter<br>requested?"}
S3 -->|Yes| S4[ActiveAddresses date]
S3 -->|No| S5[All loaded addresses]
S4 --> S6[CalculatePrimaryAddress addressType<br>fallback chain]
S5 --> S6
S6 --> S7{Match found?}
S7 -->|Yes| S8(["Best-available address<br>returned"])
S7 -->|No| S9(["Empty clsProviderAddress<br>returned"])
S8 --> S10{"Child/parent resolution<br>requested?"}
S9 --> S10
S10 -->|Yes| S11[Parent non-empty? Clone + tag IsParent<br>else use child's own address]
S10 -->|No| EndOk([Address returned])
S11 --> EndOk
Failure and edge-case behavior¶
- No address rows loaded for a location:
CalculatePrimaryAddressreturns an emptyclsProviderAddressobject rather thanNothing(BR-PADR-004). - An unrecognized address type passed to
GetAddressTypeCodethrowsException("Invalid Address Type.")(BR-PADR-006). - Standalone retrieval of
clsProviderAddressvia the portal is not supported — itsBeforeRetrieveissues no data request.**
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/clsProviderAddress.vbSAIF.Business.View.Provider/clsProviderAddressCollection.vb