Maintain provider MCO membership¶
clsProviderMCOMembership maintains a provider location's enrollment in an MCO plan for a given effective/expiration window, including per-membership admin-fee and specialty rate fields. The membership period must fit inside the parent plan's active dates and cannot expire before an effective service contract for the same plan/location, and every successful save or delete is synchronized to Contact Manager through clsMembershipApi.
| Field | Value |
|---|---|
| Operation ID | OP-PRV-09 |
| Trigger | Caller calls NewProviderMCOMembership/GetProviderMCOMembership, edits properties, and calls Save() or Delete() |
| Inputs | ProviderLocationSeqNum, MCOPlanID, EffDate/ExpDate, NewPatientsFlag, DirectoryFlag, AdminFeeFlag/AdminFeeRate, RatePtOtSt, RateRad, RateWcCtc, RateAsc |
| Outputs | Persisted MCO_PROVIDER row; ContactManager MembershipDto sync |
| Primary components | clsProviderMCOMembership.Create, BeforeInsert/BeforeUpdate/BeforeDelete, ActiveEffDate, BeforeContractExpDate, FillMembershipDto, clsMembershipApi.AddMembership/UpdateMembership/DeleteMembership |
| Entry point | Business\SAIF.Business.Provider\clsProviderMCOMembership.vb |
Steps¶
- Create with defaults.
Create()defaultsNewPatientsFlag,DirectoryFlag, andAdminFeeFlagto"Y", andAdminFeeRate,RatePtOtSt,RateRad,RateWcCtc,RateAscto1; assigns a new seq num viaGetNextSeqNum("Mco_Provider_SEQ"). - Retrieve. Reads MCO_PROVIDER by
PROVIDER_LOCATION_SEQ_NUM + MCO_PLAN_ID + EFF_DATE(SQL-054);Fill(...)also capturesm_OriginalMCOPlanID/m_OriginalEffDatefor use as the update/delete key, since the plan ID and effective date are themselves editable. - Validate before save.
MissingMCOPlanID,MissingEffDate: hard errors requiring the plan and effective date.- BR-016:
ActiveEffDaterequires the membership's effective/expiration window to fall entirely withinclsMCOPlan.GetMCOPlan(...).EffDate/ExpDate(open-ended plan or membership expirations default toDate.MaxValue). LateExpDate: hard error ifExpDateexceedsToday + 10 years.- BR-017:
BeforeContractExpDate— only when the objectIsDirtyand anExpDateis set — runsIsServiceContractEffective, a scalar count query against PROVIDER_SERVICE_CONTRACT for the same location/plan whose expiration (NVL(EXP_DATE, '31-Dec-2999')) exceeds the proposed membership expiration; a nonzero count fails the rule. ValidEffExpDate: hard error ifExpDateprecedesEffDate.- BR-018:
ValidAdminFeeRate— ifAdminFeeFlagis set, requires a nonblank rate no greater than1.000; if not set, requires the rate to be blank. ValidRatePtOtSt,ValidRateRad,ValidRateWcCtc,ValidRateAsc: hard errors requiring each specialty rate to be present.- Warning-only checks:
EarlyEffDate/EarlyExpDate(dates more than a year in the past),LowAdminFeeRate/LowRatePtOtSt/LowRateRad/LowRateWcCtc/LowRateAsc(rate below.75) — none of these block the save. - Overlapping-membership-period rules exist in source as commented-out code and are not currently enforced.*
- Insert. Writes
MCO_PLAN_ID,PROVIDER_LOCATION_SEQ_NUM,EFF_DATE/EXP_DATE,NEW_PATIENTS_FLAG,DIRECTORY_FLAG,ADMIN_FEE_RATE/ADMIN_FEE_FLAG, the four specialty rates,MCO_PROVIDER_SEQ_NUM, and audit fields to MCO_PROVIDER (SQL-029). FillMembershipDto(MCOPlanID)resolvesplanNameviaclsProviderUtility.GetPlanNameByid,providerNumberviaclsProviderUtility.GetProviderByProviderLocSeqNum, and normalizesmcoMembershipExpDatetoNothingwhenExpDate = Date.MinValue.- On success:
MarkOld(), then callclsMembershipApi.AddMembership(...)against routeprovider/{providerLocationSeqNumber}/membership; API exceptions are JSON-logged and surfaced asApiInsertError. - Update. Writes the same fields to MCO_PROVIDER (SQL-077) with concurrency check
WHERE PROVIDER_LOCATION_SEQ_NUM = :ProviderLocationSeqNum AND MCO_PLAN_ID = :OriginalMCOPlanID AND EFF_DATE = :OriginalEffDate AND UPDATE_NUM = :UpdateNum— the row is located by the original plan ID and effective date even though those fields may have just changed. FillMembershipDto(m_OriginalMCOPlanID)is used for the API call, so the syncedplanNamereflects the original plan while dates reflect the current fields.*- On success: call
clsMembershipApi.UpdateMembership(...); API failure is logged and surfaced asApiUpdateError. - Delete. Deletes from MCO_PROVIDER by
ProviderLocationSeqNum + OriginalMCOPlanID + OriginalEffDate(SQL-099) — noUPDATE_NUMcheck on delete. - The DTO for the API call is built using the original plan ID.
- On success: call
clsMembershipApi.DeleteMembership(...)against routeprovider/{providerLocationSeqNumber}/membership/remove; API failure is logged and surfaced asApiDeleteError.
Process flow¶
flowchart TD
Start([Caller edits MCO membership]) --> PlanRange{Period within<br>MCO plan active dates?}
PlanRange -->|No| Fail([Outside plan's active<br>date range blocks save])
PlanRange -->|Yes| ContractCheck{Dirty, ExpDate set,<br>effective service contract outlives it?}
ContractCheck -->|Yes| Fail2([Membership would expire<br>before contract blocks save])
ContractCheck -->|No| AdminFee{Admin fee flag/rate consistent?}
AdminFee -->|No| Fail3([Inconsistent admin<br>fee flag/rate blocks save])
AdminFee -->|Yes| Rates{All specialty rates present?}
Rates -->|No| Fail4([Broken rules returned])
Rates -->|Yes| Persist[Insert/update/delete MCO_PROVIDER]
Persist --> Rows{RowsAffected = 1?}
Rows -->|No| Contention([Insert Failed / DB contention error])
Rows -->|Yes| Api[Call clsMembershipApi Add/Update/Delete]
Api --> Done([Save complete;<br>API failures logged, not blocking])
Failure and edge-case behavior¶
- Update and delete locate the row by the original plan ID and effective date, so changing either field mid-edit relies on those original values being preserved correctly in memory; a stale original value would misdirect the SQL.*
- Delete has no
UPDATE_NUMconcurrency check, unlike insert/update, so a concurrent modification is not detected on delete. - Overlapping-membership-period validation exists in source but is commented out, so a provider location can currently hold overlapping memberships in the same MCO plan.*
- Warning-only low-rate checks (below
.75) never block a save, regardless of how far below the threshold the rate is.
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\clsProviderMCOMembership.vbBusiness\SAIF.Business.Provider\Api\clsMembershipApi.vbBusiness\SAIF.Business.Provider\clsMCOPlan.vbBusiness\SAIF.Business.Provider\clsProviderUtility.vb