MCO billing¶
MCO billing creates a bill for a managed-care organization, seeding it from claim context and standard MCO defaults, and supports maintaining a collection of MCO bills filtered and grouped by plan. It shares the underlying bill persistence and audit cascade documented in Bill CRUD and Audit and audited services — clsMCOBill inherits from the same bill hierarchy — and adds MCO-specific claim seeding, eligibility-history resolution, and provider-type admin-fee applicability lookups.
| Field | Value |
|---|---|
| Operation ID | OP-CB-03 |
| Trigger | Caller calls clsMCOBill.NewMCOBill(inDataportal, inClaimID) (or the clsClaimData overload) to create a bill for a claim, or retrieves an existing collection with NewMCOBillCollection |
| Inputs | ClaimID or a pre-loaded clsClaimData; MCO plan ID for filtering; effective date for eligibility resolution; provider location for admin-fee validation |
| Outputs | New clsMCOBill seeded with claim and default fields; filtered/grouped clsMCOBillCollection; resolved clsMCOEligibility for an effective date; validated clsMCOProviderTypeAdminFee |
| Primary components | clsMCOBill.Create, clsMCOBill.NewMCOBill, clsMCOBill.AddBusinessRules/validbill, clsMCOBillCollection.ListByMco, clsMCOBillCollection.UniqueMCOPlanIds, clsClaimMCO.GetMCOEligibility, clsMCOProviderTypeAdminFee.SetLocation/IsInEffect |
| Entry point | Business\SAIF.Business.Claim.Bill\MCOSupport\clsMCOBill.vb |
Steps¶
- Create a new MCO bill.
Create()callsMyBase.Create()(the shared bill-creation path from Bill CRUD), then setsClaimIDfrom the criteria and loads claim context. - Sub-step:
clsClaimData.GetData(MyCriteria.DataPortalInfo, MyCriteria.ClaimID)retrieves the claim identified byClaimIDand returns the populated claim data used to seed the bill.
Origin: The claim-data retrieval is implemented by
clsClaimData.GetDatainSAIF.Business.View.Claimand executed on behalf of this operation. That library is a same-repo NuGet dependency documented in the previous format; see Operations and processes in theSAIF.Business.View.Claimdocumentation set. 2. Copy claim fields onto the bill.ClaimNumber,ClaimCheckValue,WorkerFirstName,WorkerLastName, andWorkerTaxIDare copied from the loaded claim data onto the new bill. 3. Apply MCO bill defaults.Create()hard-setsBillTypeCode = "S"(Standard),RebillFlag = "N",MailRoomReceivedDate = Today, andPriorityNumber = "5". 4. Enforce the bill-ID rule.AddBusinessRules()registersvalidbill(), which requiresBillID > 0under rule code"CBPBill01". - On failure: add"Invalid bill"(BR-001). 5. Persist the bill. Insert, update, and delete of the header and its child collections reuse the sameCBP_BILLpersistence path, audit generation, and rows-affected concurrency contract described in Bill CRUD steps 5–14 (BR-004). 6. Retrieve the claim's MCO plan bill collection.clsMCOBillCollectionretrieves bills for a claim viaRetrieveSQLselectingCBP_BILLrows byCLAIM_ID(SQL-001 family, CBP_BILL). 7. Filter and summarize the collection.ListByMco(inMCOPlan)copiesProcessDateand returns a new collection containing only items whereMcoPlanId.ToLower = inMCOPlan.ToLower;UniqueMCOPlanIds()returns the distinct plan IDs across the collection. Both are in-memory operations with no additional database access. 8. Resolve the claim's MCO eligibility history.clsClaimMCO.New(inDataportal, claimId)issues an inline read againstCL_CLAIM_MCO_ELIGIBILITY(SQL-014, CL_CLAIM_MCO_ELIGIBILITY). For each row, it resolves the MCO's location and builds aclsMCOEligibilityDetail. - Alternate constructor:clsClaimMCO.New(inDataportal, claimId, mcoHistory)builds the same eligibility-detail list from an in-memoryList(Of clsMcoData)instead of querying the database.Origin: The MCO-location resolution (
GetMCOInfo(DPI).MCO(mcoID)) is implemented by the provider-view lookup inSAIF.BOF.Business.View.Provider. That library is a same-repo NuGet dependency documented in the previous format; see Operations and processes in theSAIF.BOF.Business.View.Providerdocumentation set. 9. Resolve eligibility for a specific effective date (GetMCOEligibility). The eligibility-detail history is sorted descending by effective date, and the latest record on or before the requested date is selected as the working record. - If no record matches the date and the working record's status isPendingorPendingUnassigned: the working record is qualified as-is.* - If the matched record's status isPendingUnassigned: look at the next (more recent) record — - if the next record's status isNotEligible,Pending, orPendingUnassigned: promote the next record's status onto the result.* - if the next record's status isEligible: copy only the date and MCO from the next record, not its status.* - If the result is stillPendingUnassignedand a more-recent record exists beyond that: repeat the same promotion — full copy forPendingUnassigned/Pending/NotEligible, date/MCO-only copy forEligible.* - This effective-date promotion logic resolves a claim's working MCO eligibility status even when the nearest historical record is itself unassigned, by looking forward through subsequent history entries.* 10. Validate a provider-type admin fee's location.clsMCOProviderTypeAdminFee.SetLocation(inLocation)assigns the location, then compares the fee's ownMcoID(trimmed, lowercased) against the assigned location'sMcoID. - On mismatch: throw"MCO location submitted does not match location assigned."(BR-006). 11. Determine admin-fee applicability for a date (IsInEffect). ReturnsFalsebefore the fee's effective date;Trueif the fee has no expiration; otherwiseTrueonly while the requested date is on or before the expiration date. 12. Load the provider-type admin fee list.clsMCOProviderTypeAdminFeeList's constructor issues an inline read againstMCO_TYPE_ADMIN_FEE(SQL-015, MCO_TYPE_ADMIN_FEE), builds oneclsMCOProviderTypeAdminFeeper row, and binds each to its resolved MCO location via the provider-view lookup.
Process flow¶
The following diagram visualizes MCO bill creation and the eligibility-resolution logic used to determine a claim's working MCO status.
flowchart TD
Start([Caller creates MCO bill<br>for a claim]) --> LoadClaim[Load claim data<br>via clsClaimData.GetData]
LoadClaim --> Seed[Copy claim fields;<br>apply MCO defaults]
Seed --> Rule{BillID > 0?}
Rule -->|No| Fail([Broken rule;<br>invalid bill])
Rule -->|Yes| Save[Persist via Bill CRUD<br>save cascade]
Save --> Elig[Resolve eligibility history<br>for effective date]
Elig --> Match{Matched record<br>PendingUnassigned?}
Match -->|Yes| Next{Next record status?}
Next -->|Eligible| CopyDateOnly[Copy date/MCO only]
Next -->|Other| Promote[Promote next record<br>status and fields]
Match -->|No| UseMatch[Use matched record]
CopyDateOnly --> Done([Working eligibility returned])
Promote --> Done
UseMatch --> Done
Failure and edge-case behavior¶
SetLocationthrows immediately on a location/MCO mismatch rather than adding a broken rule, so callers must catch the exception (BR-006).- The
PendingUnassignedpromotion logic inGetMCOEligibilityhas several nested conditional branches; because the exact business intent behind each promotion path is not documented outside the code, the behavior is described here as observed rather than as a named business rule.* clsMCOEligibilityDetail.IsUnassignedtreats an MCO ID of"99"as the sentinel for "unassigned," a convention not otherwise documented in this library.*- MCO bill creation depends on
clsClaimData.GetDatasuccessfully returning claim data; the trace does not show an explicit guard if the claim lookup fails or returns an invalid claim.*
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.Claim.Bill\MCOSupport\clsMCOBill.vbBusiness\SAIF.Business.Claim.Bill\MCOSupport\clsMCOBillCollection.vbBusiness\SAIF.Business.Claim.Bill\AuditSupport\MCO\clsClaimMCO.vbBusiness\SAIF.Business.Claim.Bill\AuditSupport\MCO\clsMCOEligibility.vbBusiness\SAIF.Business.Claim.Bill\AuditSupport\MCO\clsMCOEligibilityDetail.vbBusiness\SAIF.Business.Claim.Bill\AuditSupport\MCO\clsMCOProviderTypeAdminFee.vb