Skip to content

Load provider relationships (parents or children)

Loads either the child or parent set of provider-location relationships for a location, materializing the destination clsProviderLocation for each relationship, and applies "works for" filtering by relationship code and active-date window.

Field Value
Operation ID OP-05
Trigger clsProviderLocation.ChildRelationships / ParentRelationships; clsCaseCost.WorksFor; clsRequestManager attorney lookup
Inputs IDataPortalInfo, provider-location ID
Outputs clsProviderRelationshipCollection
Primary components clsProviderRelationshipCollection.GetChildProviderRelationshipCollection, GetParentProviderRelationshipCollection
Entry point SAIF.Business.View.Provider/clsProviderRelationshipCollection.vb:236, 244

Steps

  1. Criteria stores SourceRelationshipType (Parent by default).
  2. RetrieveSQL selects RetrieveChildRelationshipsSQL (SQL-PREL-01) when the source is the parent, otherwise RetrieveParentRelationshipsSQL (SQL-PREL-02). Both join PROVIDER_LOCATION to PROVIDER_RELATIONSHIP and left-join back to PROVIDER_LOCATION for the other end, ordered by business name.
  3. BeforeRetrieve binds :ProviderLocationID.
  4. AfterRetrieve builds a clsProviderLocationCollection alongside the relationship collection; each row produces a clsProviderRelationship whose Load() also materialises the destination clsProviderLocation.
  5. WorksFor filters ProviderRelationshipCode = "WRK" and (when ActiveOnly, the default) IsActive (BR-PREL-001, BR-PREL-002).
  6. If activeDate is supplied: WorksFor(activeDate) substitutes Date.MaxValue for a missing termination date (BR-PREL-003).
  7. Destination navigation always resolves to the opposite end via DestinationRelationshipType (BR-PREL-004).
  8. Note: clsProviderRelationship.Criteria throws on all five SQL properties — individual relationships are never retrieved directly.**

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Caller request]) --> S1{"Child or parent<br>relationships?"}
    S1 -->|Child| S2[RetrieveChildRelationshipsSQL]
    S1 -->|Parent| S3[RetrieveParentRelationshipsSQL]
    S2 --> S4["BeforeRetrieve binds<br>ProviderLocationID"]
    S3 --> S4
    S4 --> S5["AfterRetrieve: build<br>relationship + location<br>collections"]
    S5 --> S6{WorksFor filter requested?}
    S6 -->|Yes| S7[Filter code = WRK<br>and ActiveOnly date test]
    S6 -->|No| EndOk(["clsProviderRelationshipCollection<br>returned"])
    S7 --> EndOk

Failure and edge-case behavior

  • No matching relationships: an empty clsProviderRelationshipCollection is returned.
  • clsProviderRelationship.Criteria throws InvalidSQLProperty for all five SQL properties, so a single relationship can never be retrieved directly through the portal.**
  • A missing termination date is treated as Date.MaxValue, keeping open-ended relationships active (BR-PREL-003).

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