> ## 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.

# AdvancedMD Update Patient

> Native AdvancedMD patient-update tool exposed through the Agents Platform.

This document covers `advancedmd_update_patient`, the native AdvancedMD patient-update tool exposed through the Agents Platform.

## Authentication

AdvancedMD tools use the existing AdvancedMD connector (`office_code`, `username`, `password`). See [advancedmd-find-patient.md](/docs/tools/advancedmd-find-patient) for details.

## `advancedmd_update_patient`

Updates an existing patient's demographics in AdvancedMD with the `updatepatient` API. **This is a mutating tool.**

`dry_run` defaults to `false`: the tool applies the update. Set `dry_run=true` to only build and return the payload without writing anything.

Only populated fields are sent; empty fields are left unchanged.

### Inputs

Required:

* `patient_id`: AdvancedMD patient id to update.
* At least one field to change.

Changeable fields (all optional, but at least one required):

* `sex`: `M`, `F`, or `U` (`male`/`female` also accepted).
* `dob`: ISO-8601 (`YYYY-MM-DD`); converted to `MM/DD/YYYY` internally.
* `email`
* `phone`: home phone; `+1`/`+` prefixes are stripped.
* `address1`, `address2`, `city`, `state`, `zip`

Optional:

* `dry_run`: Defaults to `false` (the update is applied). Set `true` to preview only.

### Output

Dry run returns the fields that would change under `changes` with `dry_run: true, updated: false`.

A real run returns:

```json theme={null}
{
  "success": true,
  "updated": true,
  "dry_run": false,
  "patient_id": "pat999",
  "changes": {
    "email": "new@b.com",
    "phone": "5559998888"
  }
}
```

`advancedmd_not_connected` indicates AdvancedMD is not connected; the agent should ask the user to connect and try again, or stop the task.

## Agent Instruction Guidance

Find the patient first with `advancedmd_find_patient` to confirm the correct `patient_id`. This tool applies the update by default (`dry_run=false`); when you want to verify the `changes` before committing, call it once with `dry_run=true` to preview, then call again without `dry_run`.
