Skip to content

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

  1. Create. Assigns a new seq num via GetNextSeqNum("PROVIDER_INELIG_PERIOD_SEQ") and stamps the acting user.
  2. Retrieve. BeforeRetrieve first calls CreateUpdateInfo(UserID), then reads PROVIDER_INELIG_PERIOD by PROVIDER_INELIG_PERIOD_SEQ_NUM (SQL-050); AfterRetrieve uses clsSAIFDataReader and, if a row exists, fills the object including a nested clsUpdateInfo.
  3. Validate before save (BR-022):
  4. ValidReason: hard error requiring a resolved, nonblank ineligibility reason description.
  5. ValidStartDate/UnreasonableStartDate: hard errors requiring a start date not before 01/01/1850.
  6. ValidTerminationDate: hard error if termination precedes the start date.
  7. LateStartDate/LateTerminationDate: hard errors if either date is in the future.
  8. EarlyTerminationDate: hard error if termination is more than 30 years old.
  9. EarlyStartDate (warning only): warns if the start date is before 01/01/2002.
  10. 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 checks UPDATE_NUM, delete does not.
  11. Null-termination helpers. SetTerminationDateNull()/IsTerminationDateNull() manage an open-ended (still-ineligible) period.

Provider DCBS cost/charge

  1. Create. Only stamps the acting user — there is no sequence assignment; the key is the location plus effective date.
  2. Retrieve. Reads PROVIDER_DCBS_COST_CHARGE by PROVIDER_LOCATION_SEQ_NUM and EFF_DATE (SQL-047); Fill(...) stores m_OriginalEffDate for the update/delete key, since the effective date is itself editable.
  3. Validate before save (BR-023):
  4. ValidCostChargeFactor: hard error requiring the factor to be between 0 and 1 inclusive.
  5. MissingEffDate: hard error requiring an effective date.
  6. EarlyEffDate/LateEffDate: hard errors bounding the effective date to Today - 30 years through Today + 10 years.
  7. LateExpDate: hard error if the expiration exceeds Today + 10 years.
  8. ValidEffExpDate: hard error if the expiration precedes the effective date.
  9. 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 on PROVIDER_LOCATION_SEQ_NUM + OriginalEffDate + UPDATE_NUM, delete on PROVIDER_LOCATION_SEQ_NUM + OriginalEffDate only.

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_NUM concurrency 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 EarlyStartDate rule is warning-only, so a start date before 2002 is still saved, just flagged.

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.vb
  • Business\SAIF.Business.Provider\clsProviderDcbsCostCharge.vb