Bill search criteria validation¶
clsBillSearchCriteria is a rules-manager object (not a persisted business object) that a caller populates with search inputs — claim number, provider location, worker name/DOB, service date range, bill/check number — before submitting a medical bill search. Reading IsValid (or any bound IDataErrorInfo property) re-runs all thirteen registered rules and returns whether the criteria are consistent enough to submit. The object also exposes an IsMedicalBillSearch flag that activates an additional mutual-exclusion rule used by the worker/provider-location bill-search UI path.
| Field | Value |
|---|---|
| Operation ID | OP-MB-02 |
| Trigger | Caller sets clsBillSearchCriteria properties (ClaimNumber, ProviderLocID, WorkerFirstName/WorkerLastName, ServiceBeginDate/ServiceEndDate, WorkerBirthDate, SAIFBillNumber, CheckNumber, IsMedicalBillSearch, WorkerID) and reads IsValid |
| Inputs | All searchable criteria fields listed above, plus the constructor-supplied isExternal flag that gates the internal-search-info rule |
| Outputs | Boolean validity (BrokenRules.ErrorCount = 0); populated BrokenRules/IDataErrorInfo error messages; as a side effect of provider-location validation, a resolved ProviderID |
| Primary components | clsBillSearchCriteria.IsValid, clsBillSearchCriteria.AddBusinessRules, the thirteen IsValid*/Is*NotFuture rule methods |
| Entry point | Business\SAIF.Business.Claim.MedicalBill\clsBillSearchCriteria.vb |
Steps¶
- Construct the criteria object. The caller creates
clsBillSearchCriteriaviaNew(dataPortalInfo, isExternal), which registers all thirteen rules throughAddBusinessRules. - Populate search fields. The caller sets any combination of claim number, provider location, worker name/DOB, service dates, bill number, check number, and (for the worker/provider-location search path)
IsMedicalBillSearchplus exactly one ofWorkerIDorProviderLocID. - Evaluate validity. Reading
IsValidclears propagated rules and callsCheckRules(Me, ""), running every registered rule against the current property values, then returnsBrokenRules.ErrorCount = 0. - Claim number validation. If
ClaimNumberis not empty,IsValidClaimresolves it viaclsClaimSecurity.GetClaimSecurity(dpi, ClaimNumber)and requiresIsValidon the result (BR-MB-005). - Sub-step:
clsClaimSecurity.GetClaimSecurityresolves claim and worker-conflict data for the entered claim number.
Origin:
clsClaimSecurity.GetClaimSecurityis implemented inSAIF.Businessand executed on behalf of this operation. See Claim information and authorization support (OP-SB-07) in theSAIF.Businessdocumentation set. This operation calls the direct claim-number overload rather than the CCClaimData API route described as the primary path on that operation page.* 5. Provider location validation. IfProviderLocIDis empty, the rule passes automatically; otherwiseIsValidProviderLocationresolvesProvider.clsProviderLocation.GetProviderLocation(dpi, ProviderLocID)and requiresProviderLocationID > 0, settingProviderIDfrom the resolved location as a side effect (BR-MB-006).Origin:
Provider.clsProviderLocation.GetProviderLocationis implemented inSAIF.BOF.Business.View.Providerand executed on behalf of this operation. That library is documented in the previous format, so no per-operation page exists; see Operations and processes in theSAIF.BOF.Business.View.Providerdocumentation set. 6. Worker first/last name pairing.IsValidFirstNamefails whenWorkerFirstNameis entered withoutWorkerLastName(BR-MB-007). 7. Service date pairing.IsValidDatesOfServicefails when exactly one ofServiceBeginDate/ServiceEndDateis entered without the other (BR-MB-008). 8. Service begin date not future.IsFromDateNotFuturefails whenServiceBeginDateis entered and is later than today (BR-MB-009). 9. Service end date not before begin date.IsValidThruDatefails when both dates are entered andServiceEndDateprecedesServiceBeginDate(BR-MB-010). 10. Date range cap.IsValidDateRangefails whenClaimNumber,SAIFBillNumber, andCheckNumberare all empty and the six-month window fromServiceBeginDateis exceeded byServiceEndDate(BR-MB-011). - IfServiceBeginDateitself is empty in that same no-identifier scenario: the rule also fails. 11. Service end date not future.IsThruDateNotFuturefails whenServiceEndDateis entered and is later than today (BR-MB-012). 12. Worker birth date not future.IsValidDobfails whenWorkerBirthDateis entered and is later than today (BR-MB-013). - Note: this rule'sRuleDataattribute text reads"clsBillSearchCriteria.IsFromDateNotFuture", copied from the service-begin-date rule, even though the bound function and message describe the birth-date check; this appears to be a copy-paste artifact rather than an intentional dual-purpose rule.* 13. Internal search-info requirement. If the criteria object was constructed withisExternal = False,IsValidSearchInfofails unless at least one ofClaimNumber,SAIFBillNumber, orProviderLocIDis entered; external criteria skip this check entirely (BR-MB-014). 14. Check-number requires provider.IsValidCheckNumfails whenCheckNumberis entered butProviderIDis still empty (BR-MB-015). 15. Wildcard minimum length.IsValidWildCardfails whenStartsWithis true,WorkerLastNameis entered, and its trimmed length is less than three characters (BR-MB-016). 16. Medical-bill-search mutual exclusion. IfIsMedicalBillSearchis true,IsValidMedicalBillSearchfails when bothWorkerID = 0andProviderLocID = 0, and also fails whenWorkerID <> 0andProviderLocID > 0— exactly one of the two must be supplied (BR-MB-017). 17. Surface errors to the UI.IDataErrorInfo.Errorand the indexedItem(columnName)property exposeBrokenRules.ErrorMessageso data-bound controls can display validation feedback without the caller explicitly callingIsValid.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller populates search criteria]) --> Eval[IsValid clears rules<br>and runs CheckRules]
Eval --> Claim{ClaimNumber entered?}
Claim -->|Yes| ClaimCheck[Resolve via clsClaimSecurity;<br>require IsValid]
Claim -->|No| ProvLoc
ClaimCheck --> ProvLoc{ProviderLocID entered?}
ProvLoc -->|Yes| ProvCheck[Resolve via clsProviderLocation;<br>require found, set ProviderID]
ProvLoc -->|No| Names
ProvCheck --> Names[Name, date, range,<br>DOB, search-info,<br>check-num, wildcard rules]
Names --> Medical{IsMedicalBillSearch?}
Medical -->|Yes| Exclusive[Require exactly one of<br>WorkerID or ProviderLocID]
Medical -->|No| Result
Exclusive --> Result{ErrorCount = 0?}
Result -->|Yes| Valid([Criteria considered valid;<br>caller may submit search])
Result -->|No| Invalid([Broken rules returned;<br>IDataErrorInfo surfaces messages])
Failure and edge-case behavior¶
- Every rule is evaluated on each
IsValidread; there is no early exit, so all applicable broken rules accumulate together for display. - The date-range cap rule (BR-MB-011) only activates when claim number, bill number, and check number are all empty — a search with any one of those identifiers can span any date range.
- The internal search-info rule (BR-MB-014) is completely bypassed when the criteria object is constructed as external, so external callers can search with only name/date criteria.
- Provider-location and claim-number validation both make a live lookup call on every
IsValidevaluation; repeated validation during interactive data entry issues repeated lookups rather than caching results.* - The DOB rule's mismatched
RuleDatalabel does not change its runtime behavior (the bound function and message are correct), but it could confuse anyone reading rule metadata directly rather than the rule engine's evaluated output.*
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.MedicalBill\clsBillSearchCriteria.vb