Skip to main content
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); 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

Agent Instruction Guidance

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