Skip to content

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

  1. Collection BeforeRetrieve sets SQLStatement = clsProviderAddress.RETRIEVE_SQL and binds :ProviderLocationID (SQL-PADR-01 against PROVIDER_ADDRESS).
  2. AfterRetrieve iterates the reader, creating clsProviderAddress(m_ProviderLocationID) and calling Load() per row. Fill applies BR-PADR-001: a null exp_date is replaced with Date.MaxValue.
  3. ActiveAddresses(date) filters to rows where the date is between StartDate and TerminationDate (BR-PADR-002).
  4. CalculatePrimaryAddress(addressType) applies the fallback chain BR-PADR-003: Correspondence → Physical; Payment → Physical → Correspondence; Physical → Correspondence.
  5. If no address matches: an empty clsProviderAddress is returned rather than Nothing (BR-PADR-004).
  6. GetAddress(child, parent, addressType) applies BR-PADR-005: if the parent location has a non-empty address it is cloned and used, tagged IsParent = True with 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.
  7. Address type resolution uses GetAddressTypeCode(addressType), which enforces BR-PADR-006 (fixed codes COR/PAY/PHY; any other value throws).
  8. Note: clsProviderAddress.BeforeRetrieve only creates clsUpdateInfo and 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: CalculatePrimaryAddress returns an empty clsProviderAddress object rather than Nothing (BR-PADR-004).
  • An unrecognized address type passed to GetAddressTypeCode throws Exception("Invalid Address Type.") (BR-PADR-006).
  • Standalone retrieval of clsProviderAddress via the portal is not supported — its BeforeRetrieve issues no data request.**

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.vb
  • SAIF.Business.View.Provider/clsProviderAddressCollection.vb