BillServiceValidator¶
Validates a BillService line item's coding, dates, quantities, and identifiers against the constraints of a professional/institutional claim service line: provider service codes, up to four diagnosis pointer codes (each restricted to A–L or 1–8 and cross-checked for uniqueness across all four fields), service and prescription dates bounded relative to today, up to four two-character service modifiers, a two-digit service location code, quantity/tooth-number ranges, and conditional length checks on pharmacy dispense-as-written and prescribing-provider identifiers. It depends on IBillServiceService via constructor injection, though that dependency is not referenced within the visible rule bodies.*
Purpose¶
- Requires
ProviderServiceCodeto be non-null and no more than 11 characters; limitsSecondaryProvServiceCodeto at most 11 characters. - Restricts each of
DiagnosisPointerCode1–4to at most 1 character matching[A-L1-8], and requires the four pointer codes (where entered) to be mutually distinct via a customMustpredicate. - When set, bounds
BillServiceDateto no more than 30 days in the future and requiresBillServiceEndDate(when set) to be on or afterBillServiceDate; requiresPrescriptionWrittenDate(when set) to be a valid, non-default date. - Limits
ServiceModifierCode1–4to at most 2 characters each, and requiresServiceLocationCodeto be exactly 2 digits. - Requires
ServiceQuantityto be non-negative,ToothNumberto fall between 0 and 32 inclusive, andDaysSupplyQuantityto fall between 0 and 99999 inclusive. - When present, requires
PharmacyDispenseAsWrittenCodeto be exactly 1 character andPrescribingProviderIdto be at most 10 characters.
Context¶
- Namespace:
SAIF.Services.Claims.Bills.Validators - Assembly/package:
SAIF.Services(packaged inside theSAIF.SAIFCode.CoreNuGet package)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| BillServiceValidator | BillServiceValidator(IBillServiceService billServiceService) |
Wires the full set of length, regex, range, date-window, and cross-field uniqueness rules described above for a BillService line item.* |
Behavioral notes¶
- Validation is enforced via FluentValidation's
AbstractValidator<T>base.* - The diagnosis-pointer uniqueness rule uses a custom
Must((service, x) => ...)predicate that inspects all fourDiagnosisPointerCode1–4fields together, comparing entered (non-null) values for duplicates — a genuine cross-field rule rather than a per-property check.* - Several rules (
BillServiceDate,BillServiceEndDate,PrescriptionWrittenDate,PharmacyDispenseAsWrittenCode,PrescribingProviderId) are gated by.When(...)so they only apply when the corresponding value is present/non-default.* - The injected
IBillServiceServiceis accepted via the constructor but is not visibly used inside any rule body shown in source; its role could not be confirmed.**
Constraints and usage notes¶
- Requires an
IBillServiceServiceimplementation to be supplied via constructor injection.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
- Services/SAIF.Services/Claims/Bills/Validators/BillServiceValidator.cs