> ## Documentation Index
> Fetch the complete documentation index at: https://agents.nanonets.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Coding Validator Format

> This document covers deterministic CPT/ICD/modifier format validation for the realtime coding workflow.

This document covers deterministic CPT/ICD/modifier format validation for the realtime coding workflow. These checks are now implemented by the `coding_format_validation` backend tool (see [coding-format-validation.md](/docs/tools/coding-format-validation)); this page describes the rules it applies. Call the tool after the verifier step.

## Agent Format-Validation Instructions

Validate generated charge output after the LLM steps and before optional write-back.

### Inputs

Required:

* `charges`: Array of charges with `cpt_code`, `diagnosis_codes`, and `modifiers`.

### Validation Behavior

The agent should check:

* CPT/HCPCS format: five digits, four digits plus one uppercase letter, or one uppercase letter plus four digits.
* ICD-10 format: broad ICD-10 code pattern.
* Modifier length: warns on unexpected modifier length.

### Output Shape

```json theme={null}
{
  "success": true,
  "valid": false,
  "validation_issues": [
    {
      "severity": "error",
      "source": "format",
      "code_in_question": "ABC",
      "problem": "invalid CPT/HCPCS format"
    }
  ]
}
```

## Agent Instruction Guidance

If `valid=false`, do not write back to the EHR without human review.
