Maintain provider location periods¶
Two structurally similar classes are documented together because both maintain a simple, date-bounded period record directly against a provider location: clsProviderIneligibilityPeriod records when a location was ineligible and why, and clsProviderDcbsCostCharge records the cost/charge factor effective for a location over a date range. Both follow the same create/retrieve/insert/update/delete pipeline with UPDATE_NUM concurrency on update only.
| Field | Value |
|---|---|
| Operation ID | OP-PRV-11 |
| Trigger | Caller calls NewProviderIneligibilityPeriod/GetProviderIneligibilityPeriod or NewProviderDcbsCostCharge/GetProviderDcbsCostCharge, edits properties, and calls Save() or Delete() |
| Inputs | Ineligibility: ProviderLocationID, IneligibilityReasonCode, StartDate/TerminationDate. DCBS: ProviderLocationSeqNum, EffDate/ExpDate, CostChargeFactor |
| Outputs | Persisted PROVIDER_INELIG_PERIOD or PROVIDER_DCBS_COST_CHARGE row |
| Primary components | clsProviderIneligibilityPeriod.AddBusinessRules, clsProviderDcbsCostCharge.AddBusinessRules |
| Entry point | Business\SAIF.Business.Provider\clsProviderIneligibilityPeriod.vb |
Steps¶
Provider ineligibility period¶
- Create. Assigns a new seq num via
GetNextSeqNum("PROVIDER_INELIG_PERIOD_SEQ")and stamps the acting user. - Retrieve.
BeforeRetrievefirst callsCreateUpdateInfo(UserID), then reads PROVIDER_INELIG_PERIOD byPROVIDER_INELIG_PERIOD_SEQ_NUM(SQL-050);AfterRetrieveusesclsSAIFDataReaderand, if a row exists, fills the object including a nestedclsUpdateInfo. - Validate before save (BR-022):
ValidReason: hard error requiring a resolved, nonblank ineligibility reason description.ValidStartDate/UnreasonableStartDate: hard errors requiring a start date not before 01/01/1850.ValidTerminationDate: hard error if termination precedes the start date.LateStartDate/LateTerminationDate: hard errors if either date is in the future.EarlyTerminationDate: hard error if termination is more than 30 years old.EarlyStartDate(warning only): warns if the start date is before 01/01/2002.- Insert/update/delete. Writes
PROVIDER_INELIG_PERIOD_SEQ_NUM,PROVIDER_LOCATION_SEQ_NUM,PROVIDER_INELIG_REASON_CODE,EFF_DATE/EXP_DATE, and audit fields to PROVIDER_INELIG_PERIOD (SQL-026, SQL-074); update checksUPDATE_NUM, delete does not. - Null-termination helpers.
SetTerminationDateNull()/IsTerminationDateNull()manage an open-ended (still-ineligible) period.
Provider DCBS cost/charge¶
- Create. Only stamps the acting user — there is no sequence assignment; the key is the location plus effective date.
- Retrieve. Reads PROVIDER_DCBS_COST_CHARGE by
PROVIDER_LOCATION_SEQ_NUMandEFF_DATE(SQL-047);Fill(...)storesm_OriginalEffDatefor the update/delete key, since the effective date is itself editable. - Validate before save (BR-023):
ValidCostChargeFactor: hard error requiring the factor to be between0and1inclusive.MissingEffDate: hard error requiring an effective date.EarlyEffDate/LateEffDate: hard errors bounding the effective date toToday - 30 yearsthroughToday + 10 years.LateExpDate: hard error if the expiration exceedsToday + 10 years.ValidEffExpDate: hard error if the expiration precedes the effective date.- Insert/update/delete. Writes
PROVIDER_LOCATION_SEQ_NUM,EFF_DATE,COST_CHARGE_FACTOR,EXP_DATE, and audit fields to PROVIDER_DCBS_COST_CHARGE (SQL-023, SQL-071); update keys onPROVIDER_LOCATION_SEQ_NUM + OriginalEffDate + UPDATE_NUM, delete onPROVIDER_LOCATION_SEQ_NUM + OriginalEffDateonly.
Process flow¶
flowchart TD
Start([Caller edits location period]) --> Which{Ineligibility or DCBS cost/charge?}
Which -->|Ineligibility| DateCheck1{Dates within 1850-today,<br>termination not before start,<br>not >30yrs old?}
DateCheck1 -->|No| Fail([Out-of-range or invalid<br>date bounds block save])
DateCheck1 -->|Yes| ReasonCheck{Reason resolved?}
ReasonCheck -->|No| Fail
ReasonCheck -->|Yes| SaveInelig[Insert/update PROVIDER_INELIG_PERIOD]
Which -->|DCBS cost/charge| FactorCheck{Factor 0.000-1.000?}
FactorCheck -->|No| Fail2([Factor outside<br>0.000-1.000 blocks save])
FactorCheck -->|Yes| DateCheck2{Eff/exp dates within bounds?}
DateCheck2 -->|No| Fail2
DateCheck2 -->|Yes| SaveDcbs[Insert/update PROVIDER_DCBS_COST_CHARGE]
SaveInelig --> Rows{RowsAffected = 1?}
SaveDcbs --> Rows
Rows -->|No| Contention([Insert Failed / DB contention error])
Rows -->|Yes| Done([Save complete])
Failure and edge-case behavior¶
- Both classes allow delete without an
UPDATE_NUMconcurrency check, so a concurrent update between the caller's read and their delete call is not detected. - DCBS cost/charge update and delete both key on the original effective date, so an in-flight edit that also changes the effective date relies on the originally retrieved value being preserved correctly in memory.*
- The ineligibility period's
EarlyStartDaterule is warning-only, so a start date before 2002 is still saved, just flagged.
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\clsProviderIneligibilityPeriod.vbBusiness\SAIF.Business.Provider\clsProviderDcbsCostCharge.vb