> ## 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 Skip Check

> `coding_skip_check` deterministically decides whether a coding encounter should be skipped before the workflow spends API/LLM budget.

`coding_skip_check` deterministically decides whether a coding encounter should be skipped before the workflow spends API/LLM budget. It is part of the **Nanonets Coding Engine** tool group and implements the rules described in [coding-skip-checks.md](/docs/tools/coding-skip-checks).

This is a pure-compute tool (no LLM, no external calls). Run it twice: once after the summary fetch, and again after the patient-level signal fetch.

## Inputs

Required:

* `ehr_type`: `athenaHealth`, `DrChrono`, or `amd`.

Raw EHR payloads (used for best-effort derivation). Each is declared as a
`string` in the schema and should be passed as the `${VAR_N}` variable that holds
the matching tool's output — the EHR read tools register their `structuredContent`
as a variable, and the reference is expanded to JSON before the tool runs. A
literal JSON string is also accepted; the tool parses either. They are typed as
`string` (not `object`) so the model reliably passes the `${VAR_N}` reference
rather than an empty object to satisfy a strict object schema.

* `summary`: output of the matching EHR summary tool (e.g. `${VAR_1}`).
* `chart_alert`: AthenaHealth chart-alert output.
* `doctor_flags`: DrChrono doctor-flags output.
* `referral_authorization`: AthenaHealth referral-authorization output.
* `documentation`: optional (reserved).

Config:

* `force_recode` (bool): when true, existing procedure codes do not trigger a skip.
* `allowed_appointment_types` (\[]string): when non-empty, an appointment type outside this list triggers a skip.
* `blocked_department_ids` (\[]string): department IDs that should be skipped.

Explicit override signals (win over derived values when provided):

* `has_existing_procedure_codes`, `encounter_ready`, `note_locked`, `multi_appointment_same_day`, `chart_alert_self_pay`, `cash_pay` (booleans)
* `department_id`, `appointment_type` (strings)
* `spravato_status_mismatch`, `required_provider_mismatch` (booleans; explicit-only, no derivation)

## Derivation behavior

When an explicit field is not provided, the tool derives the signal from the raw payloads:

* existing procedure codes: a non-empty array under a procedure-code-ish key, or a positive `*procedure_codes_found` counter.
* department id / appointment type: derived from common summary keys.
* DrChrono note-locked: derived from a `lock`-ish boolean (only applied when `ehr_type` is DrChrono).
* Athena multi-appointment same-day (only applied for AthenaHealth): the nearby `appointments` are grouped by calendar day (parsing each appointment's date/time) and the check fires when 2+ fall on the encounter's day (from `encounter_date`/`encounterdate`). When the encounter date is unknown it falls back to flagging any day with 2+ appointments. This deliberately does not flag a ±window that merely returns several appointments on different days. The explicit `multi_appointment_same_day` override always wins.
* self-pay / cash-pay: parsed boolean true values under self-pay/cash-pay keys count, and text values containing self-pay/cash-pay keywords count. Key names alone do not count when the value is false, so payloads such as `{"is_self_pay": false}` or text like `is_self_pay:false` do not trigger a skip. Raw chart-alert / doctor-flags prose still counts when it contains phrases like `self-pay`, `cash pay`, or `cash-pay`.

## Output

```json theme={null}
{
  "tool_name": "coding_skip_check",
  "success": true,
  "skip": true,
  "status": "skipped",
  "reason": "EHR already has procedure codes",
  "reasons": ["EHR already has procedure codes"]
}
```

When nothing matches, `skip=false`, `status="proceed"`, and `reasons` is empty.

## Agent Instruction Guidance

If `skip=true`, stop the workflow, set `status: "skipped"` and `escalation_reason` to the reason, and do not fetch documentation or call LLM tools.

## Human-readable text

In the task feed the tool renders a `## Skip Check` table (decision SKIP/PROCEED, status) and a `## Reasons` list with every skip reason. The full result struct stays in `structuredContent`.

## Notes

* Deterministic tool. Free to call. `default_enabled` is false.
