Retrieve provider aggregate¶
clsProvider is a thin header object keyed by ProviderSeqNum that stores only the primary tax ID pointer and audit fields; the bulk of a provider's data — locations, tax IDs, and everything hanging off a location — is exposed through read-only collection properties that retrieve on first access rather than eagerly with the header.
| Field | Value |
|---|---|
| Operation ID | OP-PRV-01 |
| Trigger | Caller invokes clsProvider.GetProvider(inDataportal, inProviderSeqNum) |
| Inputs | ProviderSeqNum, IDataPortalInfo |
| Outputs | Populated clsProvider with PrimaryTaxID, audit fields, and lazily loaded Locations/TaxIds collections |
| Primary components | clsProvider.GetProvider, clsProvider.BeforeRetrieve, clsProvider.AfterRetrieve, clsProviderLocationCollection.GetProviderLocationCollection, clsProviderTaxIDCollection.GetProviderTaxIDCollection |
| Entry point | Business\SAIF.Business.Provider\clsProvider.vb |
Steps¶
- Caller requests the provider.
clsProvider.GetProvider(inDataportal, inProviderSeqNum)constructs aCriteriawith theProviderSeqNumkey and callsinDataportal.DataAccessLayer.RetrieveObject(...). - Retrieve the header row.
BeforeRetrieveissues a result-set request against SQL-042, selectingPROVIDER_SEQ_NUM,PRIMARY_TAX_ID, and audit columns from PROVIDER filtered by:ProviderSeqNum. - Fill the object.
AfterRetrievefillsPrimaryTaxIDand audit fields from the first returned row (if any) and marks the object clean viaMarkOld(). - If no row matches, the object is still marked old but its fields remain at their initial (empty) values; the caller receives an unpopulated object rather than an explicit not-found error.*
- Resolve the registered name for legacy compatibility. The
RegisteredNameread-only property scansTaxIdsfor the row withPrimaryTaxIDFlag = "Y"and returns itsRegisteredName, or an empty string if none is flagged primary. - Load locations on demand. The first access to
LocationscallsclsProviderLocationCollection.GetProviderLocationCollection(MyCriteria.DataPortalInfo, m_ProviderSeqNum), which retrieves every PROVIDER_LOCATION row for the provider (SQL-053) and caches the collection for the life of the object. - Each returned
clsProviderLocationcan, in turn, be used to load its own address, contact, identity, tax ID, relationship, service, MCO membership, ineligibility period, DCBS cost/charge, and note children — each of which is documented as its own maintenance operation. - Load tax IDs on demand. The first access to
TaxIdscallsclsProviderTaxIDCollection.GetProviderTaxIDCollection(MyCriteria.DataPortalInfo, m_ProviderSeqNum), which retrieves every PROVIDER_TAX_ID row for the provider (SQL-060) and caches the collection. - Create a new provider (less common path).
NewProvider(inDataportal)callsinDataportal.DataAccessLayer.CreateObject(...), andCreate()assignsm_ProviderSeqNumfromGetNextSeqNum("PROVIDER_SEQ")— the caller is then expected to populate a location and tax ID before the aggregate is meaningful. - Persist header changes.
BeforeInsert/BeforeUpdatewritePrimaryTaxID,ProviderSeqNum, and audit fields to PROVIDER (SQL-018, SQL-066); the update statement enforces optimistic concurrency onUPDATE_NUM. - On a rows-affected value other than
1: insert adds"Insert Failed"; update adds the DB contention error message.
Process flow¶
flowchart TD
Start([Caller calls GetProvider]) --> Retrieve[Retrieve header row from PROVIDER]
Retrieve --> Found{Row found?}
Found -->|Yes| Fill[Fill PrimaryTaxID and audit fields]
Found -->|No| Empty([Unpopulated object returned])
Fill --> Access{Caller accesses Locations or TaxIds?}
Access -->|Locations| LoadLoc[Lazily retrieve PROVIDER_LOCATION collection]
Access -->|TaxIds| LoadTax[Lazily retrieve PROVIDER_TAX_ID collection]
Access -->|Neither| Done([Header-only object returned])
LoadLoc --> Cached([Collection cached on object])
LoadTax --> Cached
Failure and edge-case behavior¶
- A
ProviderSeqNumwith no matching row returns an unpopulated object rather than throwing; callers must check the populated state themselves.* LocationsandTaxIdsare cached only for the lifetime of the in-memory object — no cross-request caching occurs.*RegisteredNamesilently returns an empty string when no tax ID is flagged primary, rather than surfacing an error.- Header insert/update failures follow the standard rows-affected pattern: a value other than
1produces an error message instead of a thrown exception.
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.
Sources¶
Business\SAIF.Business.Provider\clsProvider.vbBusiness\SAIF.Business.Provider\clsProviderLocationCollection.vbBusiness\SAIF.Business.Provider\clsProviderTaxIDCollection.vb