---
title: Service edit and adjustment
summary: Validates and normalizes each billed service line, then applies full-charge disallowance adjustments for services that fail eligibility checks.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Business.Claim.Bill.AutomatedAudit
reference_type: package
operation_id: OP-AA-03
trigger: BillAuditEngine.AuditBill calls clsServiceEditor.EditService then, for auditable services, AdjustService, once per service line
---

# Service edit and adjustment

`clsServiceEditor` runs two passes per billed service line. `EditService` performs lightweight, non-adjusting validation and logging. For any service still flagged for re-audit (`ReauditCode = "R"`), `AdjustService` first normalizes the audited service (`UpdateAuditService`) and then runs two further rule groups that can generate full-charge disallowance adjustments and force the service out of the audit (`ReauditCode = "X"`).

| Field | Value |
| --- | --- |
| **Operation ID** | OP-AA-03 |
| **Trigger** | `BillAuditEngine.AuditBill` calls `clsServiceEditor.EditService(Bill, Service)` for every service, then `AdjustService(Bill, Service)` for services where `Service.IsAuditable` |
| **Inputs** | `clsBillAudit`, `clsBillAuditService` for the current line (billed service + audited service + cached provider/NDC/fee state) |
| **Outputs** | Boolean pass/fail (`ErrorCount = 0`) per call; normalized audited-service fields; `ReauditCode` transitions to `"X"` on disallowance; full-charge adjustments; audit messages |
| **Primary components** | `clsServiceEditor.EditService`, `clsServiceEditor.AdjustService`, `clsServiceEditor.UpdateAuditService` |
| **Entry point** | `Business\SAIF.Business.Claim.Bill.AutomatedAudit\AuditUtilities\clsServiceEditor.vb` |

## Steps

1. **EditService — set context and log.** Store the current `Bill`, `BillAuditService`, and `AuditedService`. Log the service date and either the NDC code (pharmacy services) or the service code/type (all other services).
2. **EditService — run `#VALIDATE_SERVICE_LINE#`.** Clear broken rules and execute the rule group ([BR-004](../business-rules.md#br-004-service-edits-must-pass)):
   - `cse_ServiceDateExists` — if the service date is null: error `"{0} Invalid service date"` ([BR-008](../business-rules.md#br-008-audited-service-line-requires-a-service-date)) and set `ReauditCode = "X"`.
   - `cse_ServiceDate_ReceivedDate` — warning-only: warn `"{0} Service date is after received date"` if the service date is after the mailroom received date.
   - `cse_ServiceDate_ServiceEndDate` — if `ServiceEndDate < ServiceDate`: error `"{0} Service through date is before from date"` ([BR-009](../business-rules.md#br-009-service-through-date-cannot-precede-the-service-from-date)).
   - `cse_ValidSecondaryServiceCode` — if a secondary service code is present but does not resolve: error `"{0} Invalid secondary service code"` ([BR-013](../business-rules.md#br-013-secondary-service-code-must-resolve-to-a-known-service)).
   - `ba_ValidatePharmacyPrescriberID` — if `PrescribingProviderCode = "01"` (NPI qualifier) and the prescriber ID is not exactly 10 numeric digits: error `"Prescriber ID must be 10 numeric digits for NPI qualifier ({0})."` ([BR-014](../business-rules.md#br-014-pharmacy-prescriber-npi-must-be-exactly-10-numeric-digits)).
   - `cse_ServiceTypeCode_IsRevenueCode` — for `InpatientHospital`/`OutpatientHospital` bills, if neither the primary nor secondary service type is a revenue code: error `"{0} Revenue code required"` ([BR-015](../business-rules.md#br-015-institutional-bill-lines-require-a-revenue-code)).
   - Return `ErrorCount = 0` to the caller.
3. **AdjustService — normalize (`UpdateAuditService`).**
   - Reset the service wrapper's `FeeScheduleCode` to blank and clear `TotalAdjustmentAmount`, `FeeScheduleAmount`, and MCO eligibility/ID/admin-fee/rate.
   - If `ReauditCode = "R"` and a charge amount exists: set `AllowedAmount = ChargeAmount` and `OriginalBillCode = "O"` as the starting point before adjustment.
   - Normalize NDC/service-code precedence: if an NDC is already present, clear `ServiceCode`; if the service type is Pharmacy and the resolved national drug is valid, normalize `NationalDrugCode` and clear `ServiceCode`.
   - If a secondary service code exists but has not resolved, attempt to resolve its type via the service reference lookup, using `"U"` (unknown) if it still does not resolve.

     > **Origin**: Service type resolution is implemented by [Service reference lookups](../../saif-business-claim-bill/operations/service-reference-lookups.md) in `SAIF.Business.Claim.Bill`.
   - If the resolved service requires nurse review, set `BillAuditService.IsNurseReviewRequired = True`.
   - Log when a service description could not be found for the service date.
4. **AdjustService — run `ADJUST_SERVICE#`.** Clear broken rules and execute the rule group (full-charge disallowance adjustments set `ReauditCode = "X"` and stop the service from further audit):
   - `cse_ServiceDate_InjuryDate` — if the service date precedes the claim's injury date: message `"{0} Adjustment SE-disallow service before date of injury"`, full-charge `SE` adjustment ([BR-010](../business-rules.md#br-010-services-before-the-date-of-injury-are-not-payable)).
   - `cse_ServiceDate_ReimbursementExpired` — for non-federal Worker Reimbursement bills received more than 730 days after the service date: message `"{0} Adjustment FN-disallow worker reimbursement"`, full-charge `FN` adjustment ([BR-011](../business-rules.md#br-011-non-federal-worker-reimbursement-requests-expire-after-730-days)).
   - `cse_ServiceLocation_ValidPlaceOfService` — for service types other than Ambulance, Dental, Pharmacy, or Worker Reimbursement, if the location is missing or inactive: message `"{0} Service location is invalid or does not exist"`, full-charge `TU` adjustment ([BR-012](../business-rules.md#br-012-a-valid-active-place-of-service-is-required-for-most-service-types)).
   - `cse_ServiceQuantity_MinimumInterpreterMileage` — for `D0041` below the era-specific minimum billed quantity (60.01 units before 4/1/2012, 15 units on/after): message `"{0} Adjustment IC-disallow service"`, full-charge `IC` adjustment ([BR-016](../business-rules.md#br-016-interpreter-mileage-service-lines-must-meet-minimum-quantity-thresholds)).
   - `cse_ProviderServiceCode_ValidateService` — dispatches by service type:
     - Pharmacy (`ValidatePharmacyServiceType`): if the national drug is valid, resolves NDC pricing effective on the service date; if pricing is missing, full-charge `FA` adjustment and `ReauditCode = "X"`; otherwise normalizes `NationalDrugCode` and blanks `ServiceCode`.
     - Non-pharmacy (`ValidateNonPharmacyServiceType`): if the service resolves, clears `NationalDrugCode`; if it does not resolve, message `"{0} Adjustment FF-disallow unknown service code"`, full-charge `FF` adjustment.
   - `ba_ValidatePharmacyInfo` — for Pharmacy provider type `PH` bills missing prescriber ID, Rx-written date, or prescriber last name: message `"Invalid pharmacy information ({0})."`, full-charge `GX` adjustment ([BR-017](../business-rules.md#br-017-pharmacy-bills-require-prescriber-id-rx-written-date-and-prescriber-last-name)).
   - `ba_ValidatePharmacyRXDate` — for Pharmacy provider type `PH` bills where the Rx-written date is after the service date: message `"Date rx written cannot be after the service date' ({0})."`, full-charge `GX` adjustment ([BR-017](../business-rules.md#br-017-pharmacy-bills-require-prescriber-id-rx-written-date-and-prescriber-last-name)).
   - Full-charge adjustments are created via the shared `GenerateAdjustment` helper on `clsBillAuditUtility`, which caps the requested amount to the current `AllowedAmount`, logs the request/cap, and updates `AllowedAmount`/`TotalAdjustmentAmount` when the resulting amount is non-zero.
5. **AdjustService — re-run `#EDIT_SERVICE#` if still auditable.** If the service is still `ReauditCode = "R"` after the adjustment rules above (i.e., it was not disallowed), re-execute the `#EDIT_SERVICE#` group described in step 2 so validation reflects any normalization performed in step 3.
6. **Return overall result.** `AdjustService` returns `ErrorCount = 0`.

## Process flow

```mermaid
flowchart TD
	Start([Per-service loop in AuditBill]) --> Edit[EditService:<br>#VALIDATE_SERVICE_LINE# rules]
	Edit --> Auditable{Service.IsAuditable?<br>ReauditCode = R}
	Auditable -->|No| Skip([No adjustment pass])
	Auditable -->|Yes| RemovePrior[Remove prior adjustments]
	RemovePrior --> Normalize[UpdateAuditService:<br>reset fee/MCO fields,<br>resolve NDC/service type]
	Normalize --> AdjustRules[ADJUST_SERVICE# rules:<br>DOI, reimbursement window,<br>place of service, mileage minimum,<br>service code, pharmacy info]
	AdjustRules --> Disallowed{Disallowed?<br>ReauditCode = X}
	Disallowed -->|Yes| Done([Service excluded from further audit])
	Disallowed -->|No| ReEdit[Re-run #EDIT_SERVICE#]
	ReEdit --> Done2([Return ErrorCount = 0])
```

## Failure and edge-case behavior

- `EditService` never itself sets `ReauditCode = "X"` except through `cse_ServiceDateExists`; most of its other checks are message-only and always allow the caller to proceed to `AdjustService`.*
- Once a service is disallowed in the `ADJUST_SERVICE#` group (`ReauditCode = "X"`), it is excluded from `#EDIT_SERVICE#` re-validation and from all downstream steps of [Bill audit rule execution](bill-audit-rule-execution.md) that require `ReauditCode = "R"`.
- `GenerateAdjustment` silently caps an adjustment request larger than the current `AllowedAmount`, logging `"Adjustment reduced to allowed."` rather than raising an error — a caller expecting the full requested disallowance amount will not see it if the allowed amount was already reduced by an earlier step.
- Because `UpdateAuditService` clears prior MCO/fee-schedule state on every adjustment pass, any MCO determination performed before this service's adjustment for the same run must be re-applied afterward by [MCO determination](mco-determination.md) and [Bill audit rule execution](bill-audit-rule-execution.md).*

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **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\clsServiceEditor.vb`
- `Business\SAIF.Business.Claim.Bill.AutomatedAudit\AuditUtilities\clsBillAuditUtility.vb`
- `Business\SAIF.Business.Claim.Bill.AutomatedAudit\clsBillAuditService.vb`
