Bill edit validation¶
clsBillEditor.EditBill runs the bill-header, diagnosis, and procedure rule groups in order, stopping as soon as any group produces a fatal error. Unlike the downstream audit engine, most of its rules only append audit messages to the bill; a small number of rules return False to EditBill and are treated as fatal, aborting the audit before any service-level work begins.
| Field | Value |
|---|---|
| Operation ID | OP-AA-02 |
| Trigger | BillAuditEngine.AuditBill calls clsBillEditor.EditBill(Bill) after GenerateAuditData succeeds |
| Inputs | Populated clsBillAudit (header fields, diagnoses, procedures, resolved Claim and BillingProvider) |
| Outputs | Boolean pass/fail (ErrorCount = 0); audit messages appended to the bill via GenerateError/GenerateWarning; broken rules propagated to BillAuditEngine |
| Primary components | clsBillEditor.EditBill, clsBillEditor.AddBusinessRules |
| Entry point | Business\SAIF.Business.Claim.Bill.AutomatedAudit\AuditUtilities\clsBillEditor.vb |
Steps¶
- Header group. Start the
"Header"rule group, clear broken rules, and runCheckRules("Header")(BR-003): val_fe_CheckReceiptDateWithDOI— fatal: ifBill.MailRoomReceivedDate < Bill.Claim.InjuryDate, generate error"Bill data - received date is before date of injury".val_fe_CheckForNCE— fatal: ifBill.Claim.IsNCE, generate error"Bill data - claim is for non-compliant employer".-
val_fe_ClaimExists— fatal: ifBill.ClaimID = 0or the claim is invalid, generate error"Invalid claim number"(with broken-rule data forClaim/ClaimNumber/ClaimCheckValue). If the claim is void and replaced, it re-resolves viaAuditEngine.GetClaim(Claim.ReplacedClaimID)and errors with"The merged claim is invalid"if the replacement is also invalid; otherwise it updatesBill.Claimto the resolved claim.Origin: The underlying claim lookup is implemented by Retrieve claim summary data in
SAIF.Business.View.Claim. -val_fe_ValidateBillingProvider— fatal: for a non-zeroProviderLocationID, requires a validBillingProvider; if a bill-levelProviderTaxIDis present, it must appear in the provider's tax-ID list or the rule fails with"Bill data - invalid billing provider location". A zeroProviderLocationIDis only an error unlessBillType = WorkerReimbursement.Origin:
Bill.BillingProvideris resolved via Retrieve provider location inSAIF.BOF.Business.View.Provider. -val_fe_ValidAdjuster— fatal: ifBill.Claim.AdjusterMailIDis blank, generate error"Bill data - missing responsible adjuster". -val_me_BillTypeRequired— message-only: forInpatientHospital/OutpatientHospitalbills, theUBBillTypeCodemust be at least 4 characters with numeric, non-zero characters in positions 2 and 3, else generate error"Bill data - invalid type of bill"(this rule always returnsTrue, so it never aborts the group by itself). -val_me_MissingAdmissionDate/val_me_MissingStatementFromDate— forInpatientHospitalbills, generate errors"Bill data - missing admit date"/"Bill data - missing statement from date"when the respective date is null. -val_me_ValidAdmissionDate— forInpatientHospitalbills, error"Bill data - admit date after received date"ifMailRoomReceivedDate < AdmissionDate. -val_me_ValidDischargeDate— forInpatientHospitalbills, error"Bill data - discharged before admitted"ifDischargeDate < AdmissionDate. -val_me_ValidStatementFromDate/val_me_ValidStatementThruDate— forInpatientHospitalbills, error if the statement-from date precedes the admission date, or the statement-thru date precedes the statement-from date. -val_me_ValidStatementFromThruDateSpan— if the bill has diagnoses (or its billing provider type requires them), error"Bill data - Statement from and thru dates cannot span over 10/01/15."when the from/thru span crosses the hard-coded ICD-10 cutoff date of October 1, 2015, unless the bill is an inpatient institutional bill with a UB bill type prefix of011,018,021, or032. -val_w_FederalClaimCheck— warning-only: ifBill.Claim.IsFederal, generate warning"Bill data - bill is for federal claim". - IfErrorCount > 0after the Header group,EditBillreturnsFalseimmediately — Diagnoses and Procedures are never checked. 2. Diagnoses group. Start the"Diagnoses"group, clear broken rules, and runCheckRules("Diagnoses"). Registered diagnosis rules (val_me_ValidDiagnosisCode) generate an error per diagnosis whose code does not resolve, and a separate error"Bill data - no diagnosis code"when the billing provider type requires a diagnosis and none is present. IfErrorCount > 0, returnFalseimmediately. 3. Procedures group. Start the"Procedures"group, clear broken rules, and runCheckRules("Procedures"). Registered procedure rules (val_me_ValidProcedureCode) generate an error per procedure whose service does not resolve. IfErrorCount > 0, returnFalse. 4. Return overall result. If all three groups completed without accumulating errors, returnTrue(ErrorCount = 0).
Process flow¶
flowchart TD
Start([EditBill invoked]) --> Header[Header rule group:<br>DOI/NCE/claim/provider/adjuster,<br>admission/statement dates]
Header --> HErr{ErrorCount > 0?}
HErr -->|Yes| Fail([Return False])
HErr -->|No| Diag[Diagnoses rule group]
Diag --> DErr{ErrorCount > 0?}
DErr -->|Yes| Fail
DErr -->|No| Proc[Procedures rule group]
Proc --> PErr{ErrorCount > 0?}
PErr -->|Yes| Fail
PErr -->|No| Pass([Return True])
Failure and edge-case behavior¶
- Only the Header-group rules listed as fatal above can stop the pipeline; every other listed rule always returns
Truefrom its function even when it records an error message, soEditBillonly fails when a Header-group fatal rule fires or a later group accumulates any generated error.* val_me_BillTypeRequiredexplicitlyReturn Trueeven on a detected invalid bill type, so an invalid UB bill type code produces an audit message but does not, by itself, abort the Header group.- The claim-merge resolution inside
val_fe_ClaimExistscan silently repointBill.Claimto a different claim mid-validation; subsequent rules in the same group see the updated claim. - The October 1, 2015 ICD-10 span cutoff and its four UB bill-type-prefix exceptions are hard-coded in
clsBillEditor, so any future exception codes require a code change rather than configuration.
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.AutomatedAudit\AuditUtilities\clsBillEditor.vb