> ## 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 CPT Generation

> `coding_cpt_generation` produces the final CPT charges and coding suggestions for a visit.

`coding_cpt_generation` produces the final CPT charges and coding suggestions for a visit. It is part of the **Nanonets Coding Engine** tool group.

The CPT system prompt (payer-specific CPT rules, E/M MDM and time rules, psychotherapy rules, Spravato Buy & Bill handling, telehealth modifier rules, PA/chart-alert directives, and CCI/NCCI compliance instructions, ported from Fleming `BuildSystemPrompt`) is baked into the tool. Organization/user coding rules are appended at runtime.

## Inputs

* `current_documentation` (required): the encounter documentation to code. May wrap the target encounter in `<current_encounter>` tags.
* `encounter_metadata` (optional): appointment type, facility, provider, insurance order, etc.
* `diagnosis_output` (optional): the ICD-10 codes (in claim order) from the diagnosis step.
* `chart_alert_directives` (optional): chart-alert / prior-authorization directives.
* `insurance_context` (optional): active/inactive and primary/secondary/tertiary insurance details and PA context.
* `nearby_encounter_context` (optional): same-patient nearby encounters (same-day, modifier 25, treatment series).
* `coding_rules` (optional): organization/user coding rules appended after the baked rule set.

## Output

```json theme={null}
{
  "tool_name": "coding_cpt_generation",
  "charges": [{ "cpt_code": "99214", "diagnosis_codes": ["F33.1"], "modifiers": ["25"], "pos": "11", "units": 1, "fee": 0, "line_item_note": "" }],
  "coding_suggestions": [{ "suggestion_type": "ADD_CPT", "current_value": "", "suggested_value": "99214", "confidence_score": 0.92, "reason": "..." }],
  "completed_at": "2026-06-01T00:00:00Z"
}
```

## Human-readable text

In the task feed the tool renders a `## CPT Generation` charges table (CPT, diagnosis, modifiers, POS, TOS, units, fee, note) and a `## Coding Suggestions` table. The full result struct stays in `structuredContent`.

## Note on the prompt source

The CPT **system** prompt is ported verbatim from Fleming `BuildSystemPrompt` (up to the rule-insertion point). The CPT **user** prompt is an assign-authored template with labeled slots (the verbatim body in the workflow doc's reference section is an ICD-filter prompt and does not match the CPT-generation behavior, so it is not used here).

## Notes

* LLM tool. Billed per call. `default_enabled` is false.
