clsProviderRelationshipCollection¶
clsProviderRelationshipCollection loads either the parent or child relationship set for a provider location from the same PROVIDER_RELATIONSHIP table, using two different SELECT statements chosen by direction. It also filters the loaded set down to "works for" relationships (WorksFor), which is the mechanism SAIF.Business.Claim.Legal's clsCaseCost uses to resolve a claimant's employer location.
Purpose¶
- Loads relationships in either direction (parent-of or child-of) for a location, each via a dedicated join query (OP-05).
- Filters relationships to only those with relationship code
"WRK"when readingWorksFor(BR-PREL-001). - Restricts
WorksForto currently active relationships by default, with an opt-out viaActiveOnly = False(BR-PREL-002).
Context¶
- Namespace:
SAIF.Business.View.Provider - Assembly/package:
SAIF.Business.View.Provider(embedded/project-compiled); also distributed as the NuGet packageSAIF.BOF.Business.View.Provider.
Public members¶
| Member | Signature | Purpose |
|---|---|---|
GetChildProviderRelationshipCollection |
Shared Function GetChildProviderRelationshipCollection(dpi As IDataPortalInfo, providerLocationID As Decimal) As clsProviderRelationshipCollection |
Loads relationships where the given location is the parent (OP-05, SQL-PREL-01). |
GetParentProviderRelationshipCollection |
Shared Function GetParentProviderRelationshipCollection(dpi As IDataPortalInfo, providerLocationID As Decimal) As clsProviderRelationshipCollection |
Loads relationships where the given location is the child (OP-05, SQL-PREL-02). |
WorksFor |
ReadOnly Property WorksFor As clsProviderRelationshipCollection |
Returns relationships with code "WRK", filtered to currently active ones when ActiveOnly (default true) (BR-PREL-001, BR-PREL-002). |
WorksFor |
Function WorksFor(asOfDate As Date) As clsProviderRelationshipCollection |
Returns "works for" relationships active as of the given date, treating a missing termination date as Date.MaxValue (BR-PREL-003). |
ActiveOnly |
Property ActiveOnly As Boolean |
Controls whether WorksFor applies the active-date filter; set to False to include expired "works for" relationships (BR-PREL-002). |
ProviderLocations |
ReadOnly Property ProviderLocations As clsProviderLocationCollection |
The set of destination locations materialised alongside this relationship collection during load (OP-05). |
RelationshipTypes (enum) |
Public Enum RelationshipTypes — members Child, Parent |
Identifies which side (Parent or Child) the collection was sourced from, driving which SELECT (SQL-PREL-01/02) is used and how DestinationRelationshipType inverts (BR-PREL-004). |
Item |
Default ReadOnly Property Item(index As Integer) As clsProviderRelationship (from clsBusinessCollection(Of clsProviderRelationship)) |
Returns the relationship at the given position in the loaded collection. |
Count |
ReadOnly Property Count As Integer (from clsBusinessCollection(Of clsProviderRelationship)) |
Number of relationships loaded for the location. |
IsValid |
ReadOnly Property IsValid As Boolean (overridden from collection base) |
Reflects aggregate rule-check state of member relationships; not used to gate any write since none exist. |
IsDirty |
ReadOnly Property IsDirty As Boolean (overridden from collection base) |
Indicates in-memory changes to member relationships; has no effect on persistence (BR-DATA-001). |
Save |
Function Save() As clsProviderRelationshipCollection (overridden from collection base) |
Calls ApplyEdit()/MyBase.Save() but cannot persist since no write SQL exists (BR-DATA-001).* |
Behavioral notes¶
- OP-05: the criteria stores
SourceRelationshipType(Parentby default);RetrieveSQLselectsRetrieveChildRelationshipsSQL(SQL-PREL-01) when the source is the parent, otherwiseRetrieveParentRelationshipsSQL(SQL-PREL-02). Both queries joinPROVIDER_LOCATIONtoPROVIDER_RELATIONSHIPand left-join back toPROVIDER_LOCATIONfor the other end, ordered by business name. AfterRetrievebuilds aclsProviderLocationCollectionin parallel with the relationship rows, soProviderLocationsis populated as a side effect of loading the relationships themselves.
Constraints and usage notes¶
- Callers needing "who this location works for" should use
WorksFor/WorksFor(date)rather than iterating the raw collection, to get code and activity filtering applied (BR-PREL-001, BR-PREL-002). - The collection cannot persist any change to its member relationships (BR-DATA-001).
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/clsProviderRelationshipCollection.vb