> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to AdvancedMD

The AdvancedMD connector lets your AI agent act in each user's AdvancedMD account. Each user signs in to AdvancedMD once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 89 tools.

**Authentication:** SMART On FHIR
**Categories:** Healthcare
**Tools:** 89: 53 read, 24 write, 12 destructive
**Users sign in with:** SMART on FHIR
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=ADVANCEDMD)

## What you can do

- **Read clinical records**: retrieve a Patient, Practitioner, Organization, Encounter, Condition, Observation, AllergyIntolerance, Immunization, MedicationRequest, DiagnosticReport, Procedure, or Appointment by its FHIR logical ID
- **Search clinical records**: find any supported FHIR resource using parameters like patient, clinical status, category, date, and code
- **Create clinical records**: add new records for any of the twelve supported FHIR resource types
- **Update clinical records**: modify an existing FHIR resource by its logical ID
- **Delete clinical records**: remove a FHIR resource by its logical ID
- **Retrieve everything for a patient**: invoke the `$everything` operation on a Patient to pull all associated clinical resources in a single Bundle

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the AdvancedMD connection

   In **AgentKit > Connections**, create an AdvancedMD connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   **Console steps with screenshots:**

   AdvancedMD uses the SMART on FHIR OAuth 2.0 authorization code flow with PKCE. Because each AdvancedMD FHIR environment exposes its own endpoints, you supply the authorization and token endpoints, the audience (`aud`), and the FHIR server domain when you create the connection. You also copy the **App Key** and **App Secret** from the **API Keys** section of the AdvancedMD dashboard — these are your client ID and client secret.

   1. ### Discover your AdvancedMD FHIR server's SMART configuration

      Your AdvancedMD FHIR server publishes its OAuth endpoints at a well-known discovery URL:

      ```text
      <advancedmd-fhir-base-url>/.well-known/smart-configuration
      ```

      Fetch that URL and note these values:

      - `authorization_endpoint` — the **Authorization endpoint**
      - `token_endpoint` — the **Token endpoint**
      - the AdvancedMD FHIR base URL, for example `https://providerapi.advancedmd.com/v1/r4` — this gives you both the **Audience (`aud`)** value and the **FHIR server domain** (the same URL without the `https://` scheme, for example `providerapi.advancedmd.com`)

      Find your exact FHIR base URL in the AdvancedMD developer program documentation for your office key and environment (sandbox vs. production).

      > note: Why aud is required
      >
      > SMART on FHIR requires every authorization request to include an `aud` parameter set to the FHIR resource server's base URL. If `aud` doesn't match the server exactly, the authorization request fails.

   2. ### Copy your App Key and App Secret from AdvancedMD

      Register an app through the AdvancedMD developer program, then open the **API Keys** section of the AdvancedMD dashboard. This is where AdvancedMD issues the credentials Scalekit needs:

      - **Key** — the **App Key**. Use this as your **client ID** in Scalekit.
      - **Secret** — the **App Secret**. Click **Show secret** to reveal it, then use it as your **client secret** in Scalekit.

      If no key is listed yet, click **Add key** to generate one, then copy both values.

      > Image: API Keys section in the AdvancedMD dashboard showing the Key value and the Show secret button

      > caution: Keep your App Secret private
      >
      > Treat the App Secret like a password. Store it in a secret manager or environment variable and never commit it to source control.

      When prompted for a redirect URI during app registration, leave the field open for now — you'll copy the exact value from Scalekit in the next step.

   3. ### Copy the redirect URI from Scalekit

      In the [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** > **Connections** > **Create Connection**. Find **AdvancedMD** and click **Create**. Copy the redirect URI — it looks like `https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback`.

      Return to your AdvancedMD app registration and paste this redirect URI into the app's allowed redirect URIs.

   4. ### Create the connection in Scalekit

      Back in the Scalekit dashboard, finish creating the connection with the values you gathered:

      - **Client ID** — the **Key** value (App Key) from the AdvancedMD **API Keys** section
      - **Client Secret** — the **Secret** value (App Secret) from the AdvancedMD **API Keys** section; click **Show secret** in AdvancedMD to reveal it
      - **Authorization Endpoint** — the `authorization_endpoint` from `.well-known/smart-configuration`
      - **Token Endpoint** — the `token_endpoint` from `.well-known/smart-configuration`
      - **Audience (`aud`)** — the AdvancedMD FHIR base URL, sent as the required `aud` parameter on the authorization request
      - **FHIR Server Domain** — the AdvancedMD FHIR server domain without the `https://` scheme, for example `providerapi.advancedmd.com`. Scalekit routes every tool call to this host

      > caution: FHIR server domain is required for tool calls
      >
      > Scalekit uses the **FHIR Server Domain** as the base host for every API request a tool makes. If you leave it blank, authorization can still succeed, but every tool call fails because Scalekit has no server to route the request to.

      Under **Scopes**, select the SMART on FHIR scopes your agent needs. Start with `openid` and `offline_access` for identity and refresh tokens, then add resource-specific scopes such as `patient/Patient.read`, `patient/Observation.read`, or the broader `patient/*.read` and `patient/*.rs` scopes. The scopes you select here must match what's enabled on your AdvancedMD app registration.

      Click **Save**.

   5. ### Verify the connection is active

      Go to **Connected Accounts** for your AdvancedMD connection and confirm the status shows **Active** after a user completes authorization.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'advancedmd_allergy_intolerance_read',
  toolInput: {
    allergy_intolerance_id: '<allergy_intolerance_id>',
  },
  connector: 'advancedmd',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="advancedmd_allergy_intolerance_read",
    tool_input={
        "allergy_intolerance_id": "<allergy_intolerance_id>",
    },
    connection_name="advancedmd",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `advancedmd_allergy_intolerance_read`

Get Allergy Intolerance · Read-only

Retrieve a single FHIR AllergyIntolerance resource by its logical ID. Represents a patient's allergy or intolerance to a substance.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `allergy_intolerance_id` (`string`, required): The logical ID of the AllergyIntolerance resource

Example input: `{"allergy_intolerance_id":"<allergy_intolerance_id>"}`

### `advancedmd_allergy_intolerance_search`

Search Allergy Intolerances · Read-only

Search for FHIR AllergyIntolerance resources using parameters like patient, clinical status, type, category, and criticality.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `category` (`string`, optional): Category: food, medication, environment, biologic
- `clinical_status` (`string`, optional): Clinical status: active, inactive, resolved
- `code` (`string`, optional): Substance code (RxNorm, SNOMED, or NDF-RT)
- `criticality` (`string`, optional): Criticality: low, high, unable-to-assess
- `patient` (`string`, optional): Patient ID to filter allergy intolerances by
- `type` (`string`, optional): Allergy or intolerance type: allergy, intolerance

Example input: `{}`

### `advancedmd_appointment_read`

Get Appointment · Read-only

Retrieve a single FHIR Appointment resource by its logical ID. Appointments represent bookings for a patient, practitioner, or location at a specific time.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `appointment_id` (`string`, required): The logical ID of the Appointment resource

Example input: `{"appointment_id":"<appointment_id>"}`

### `advancedmd_appointment_search`

Search Appointments · Read-only

Search for FHIR Appointment resources using parameters like patient, practitioner, status, and date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `date` (`string`, optional): Filter by appointment date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter appointments by
- `practitioner` (`string`, optional): Practitioner ID to filter appointments by
- `service_type` (`string`, optional): Type of service being delivered, e.g. 57 for Immunology
- `status` (`string`, optional): Appointment status: proposed, pending, booked, arrived, fulfilled, cancelled, noshow, entered-in-error, checked-in, waitlist

Example input: `{}`

### `advancedmd_care_plan_read`

Get Care Plan · Read-only

Retrieve a single FHIR CarePlan resource by its logical ID. Care plans describe planned activities to manage a patient's health issues.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `care_plan_id` (`string`, required): The logical ID of the CarePlan resource

Example input: `{"care_plan_id":"<care_plan_id>"}`

### `advancedmd_care_plan_search`

Search Care Plans · Read-only

Search for FHIR CarePlan resources describing planned patient care activities using parameters like patient, category, status, and date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `category` (`string`, optional): Category of the care plan, e.g. assess-plan
- `date` (`string`, optional): Filter by care plan period date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter care plans by
- `status` (`string`, optional): Care plan status: draft, active, on-hold, revoked, completed, entered-in-error, unknown

Example input: `{}`

### `advancedmd_care_team_read`

Get Care Team · Read-only

Retrieve a single FHIR CareTeam resource by its logical ID. Care teams represent the group of practitioners involved in a patient's care.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `care_team_id` (`string`, required): The logical ID of the CareTeam resource

Example input: `{"care_team_id":"<care_team_id>"}`

### `advancedmd_care_team_search`

Search Care Teams · Read-only

Search for FHIR CareTeam resources representing groups of practitioners involved in patient care, filtered by patient and status.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `patient` (`string`, optional): Patient ID to filter care teams by
- `status` (`string`, optional): Care team status: proposed, active, suspended, inactive, entered-in-error

Example input: `{}`

### `advancedmd_conceptmap_translate`

Translate Code · Read-only

Invoke the $translate operation on ConceptMap, as declared in AdvancedMD's FHIR CapabilityStatement, to map a source code to its equivalent code(s) in another coding system.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `code` (`string`, required): The source code to translate
- `system` (`string`, required): The source code system URI that the code belongs to
- `target` (`string`, optional): Target code system or value set URI to translate the code into
- `url` (`string`, optional): Canonical URL of a specific ConceptMap to use for the translation

Example input: `{"code":"<code>","system":"<system>"}`

### `advancedmd_condition_read`

Get Condition · Read-only

Retrieve a single FHIR Condition resource by its logical ID. Conditions represent clinical diagnoses, problems, or health concerns.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `condition_id` (`string`, required): The logical ID of the Condition resource

Example input: `{"condition_id":"<condition_id>"}`

### `advancedmd_condition_search`

Search Conditions · Read-only

Search for FHIR Condition resources representing diagnoses and health problems using parameters like patient, clinical status, category, and code.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `category` (`string`, optional): Category of condition, e.g. problem-list-item, encounter-diagnosis
- `clinical_status` (`string`, optional): Clinical status: active, recurrence, relapse, inactive, remission, resolved
- `code` (`string`, optional): ICD-10 or SNOMED code for the condition
- `onset_date` (`string`, optional): Filter by onset date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter conditions by

Example input: `{}`

### `advancedmd_coverage_read`

Get Coverage · Read-only

Retrieve a single FHIR Coverage resource by its logical ID. Coverage resources describe a patient's insurance or payment details.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `coverage_id` (`string`, required): The logical ID of the Coverage resource

Example input: `{"coverage_id":"<coverage_id>"}`

### `advancedmd_coverage_search`

Search Coverages · Read-only

Search for FHIR Coverage resources describing a patient's insurance or payment details, filtered by patient.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `patient` (`string`, optional): Patient ID to filter coverage records by

Example input: `{}`

### `advancedmd_device_read`

Get Device · Read-only

Retrieve a single FHIR Device resource by its logical ID. Devices represent implantable medical devices associated with a patient.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `device_id` (`string`, required): The logical ID of the Device resource

Example input: `{"device_id":"<device_id>"}`

### `advancedmd_device_search`

Search Devices · Read-only

Search for FHIR Device resources representing implantable medical devices using parameters like patient and device type.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `patient` (`string`, optional): Patient ID to filter devices by
- `type` (`string`, optional): Device type code, e.g. SNOMED code for the device type

Example input: `{}`

### `advancedmd_diagnostic_report_read`

Get Diagnostic Report · Read-only

Retrieve a single FHIR DiagnosticReport resource by its logical ID. Diagnostic reports represent the findings from diagnostic services such as laboratory tests and imaging studies.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `diagnostic_report_id` (`string`, required): The logical ID of the DiagnosticReport resource

Example input: `{"diagnostic_report_id":"<diagnostic_report_id>"}`

### `advancedmd_diagnostic_report_search`

Search Diagnostic Reports · Read-only

Search for FHIR DiagnosticReport resources representing lab and imaging findings using parameters like patient, category, code, date, and status.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `category` (`string`, optional): Report category: LAB, RAD (radiology), etc.
- `code` (`string`, optional): LOINC code for the type of report
- `date` (`string`, optional): Filter by report date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter diagnostic reports by
- `status` (`string`, optional): Report status: registered, partial, preliminary, final, amended, corrected, appended, cancelled, entered-in-error

Example input: `{}`

### `advancedmd_document_reference_read`

Get Document Reference · Read-only

Retrieve a single FHIR DocumentReference resource by its logical ID. Document references index clinical documents such as summaries and notes.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_reference_id` (`string`, required): The logical ID of the DocumentReference resource

Example input: `{"document_reference_id":"<document_reference_id>"}`

### `advancedmd_document_reference_search`

Search Document References · Read-only

Search for FHIR DocumentReference resources indexing clinical documents using parameters like patient, status, category, type, date, and period.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `category` (`string`, optional): Document category, e.g. clinical-note
- `date` (`string`, optional): Filter by document creation date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter document references by
- `period` (`string`, optional): Filter by the time period the document content covers
- `status` (`string`, optional): Document status: current, superseded, entered-in-error
- `type` (`string`, optional): Document type code, e.g. LOINC code for a discharge summary

Example input: `{}`

### `advancedmd_encounter_read`

Get Encounter · Read-only

Retrieve a single FHIR Encounter resource by its logical ID. Encounters represent patient visits, admissions, or interactions with healthcare providers.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `encounter_id` (`string`, required): The logical ID of the Encounter resource

Example input: `{"encounter_id":"<encounter_id>"}`

### `advancedmd_encounter_search`

Search Encounters · Read-only

Search for FHIR Encounter resources representing patient visits and admissions using parameters like patient, status, date, and class.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `class` (`string`, optional): Encounter class: AMB (ambulatory), IMP (inpatient), EMER (emergency)
- `date` (`string`, optional): Filter by encounter date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter encounters by
- `status` (`string`, optional): Encounter status: planned, arrived, triaged, in-progress, onleave, finished, cancelled
- `type` (`string`, optional): Specific type of encounter by code

Example input: `{}`

### `advancedmd_endpoint_read`

Get Endpoint · Read-only

Retrieve a single FHIR Endpoint resource by its logical ID. Endpoints describe technical details of a service endpoint used for exchanging data.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `endpoint_id` (`string`, required): The logical ID of the Endpoint resource

Example input: `{"endpoint_id":"<endpoint_id>"}`

### `advancedmd_endpoint_search`

Search Endpoints · Read-only

Search for FHIR Endpoint resources describing service endpoints for data exchange, filtered by category, status, patient, and date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `category` (`string`, optional): Connection type category for the endpoint
- `date` (`string`, optional): Filter by endpoint record date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter endpoints by
- `status` (`string`, optional): Endpoint status: active, suspended, error, off, entered-in-error, test

Example input: `{}`

### `advancedmd_goal_read`

Get Goal · Read-only

Retrieve a single FHIR Goal resource by its logical ID. Goals describe desired health outcomes for a patient.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `goal_id` (`string`, required): The logical ID of the Goal resource

Example input: `{"goal_id":"<goal_id>"}`

### `advancedmd_goal_search`

Search Goals · Read-only

Search for FHIR Goal resources describing desired patient health outcomes using parameters like patient, lifecycle status, and target date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `lifecycle_status` (`string`, optional): Goal lifecycle status: proposed, planned, accepted, active, on-hold, completed, cancelled, entered-in-error, rejected
- `patient` (`string`, optional): Patient ID to filter goals by
- `target_date` (`string`, optional): Filter by the goal's target date (YYYY-MM-DD or range with prefix)

Example input: `{}`

### `advancedmd_group_export`

Start Group Bulk Export · Read-only

Kick off a FHIR Bulk Data $export operation for all patients in a Group, as declared in AdvancedMD's FHIR CapabilityStatement. This starts an asynchronous export job and returns 202 Accepted with a Content-Location header pointing to the status endpoint; it does not return the exported data directly.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `group_id` (`string`, required): The logical ID of the Group resource whose members should be exported
- `_since` (`string`, optional): Only include resources updated after this instant (ISO 8601 datetime)
- `_type` (`string`, optional): Comma-separated list of resource types to include in the export (e.g. Patient,Observation,Condition)

Example input: `{"group_id":"<group_id>"}`

### `advancedmd_immunization_read`

Get Immunization · Read-only

Retrieve a single FHIR Immunization resource by its logical ID. Represents a vaccination event administered to a patient.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `immunization_id` (`string`, required): The logical ID of the Immunization resource

Example input: `{"immunization_id":"<immunization_id>"}`

### `advancedmd_immunization_search`

Search Immunizations · Read-only

Search for FHIR Immunization resources representing vaccination events using parameters like patient, status, vaccine code, and date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `date` (`string`, optional): Filter by vaccination date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter immunizations by
- `status` (`string`, optional): Immunization status: completed, entered-in-error, not-done
- `vaccine_code` (`string`, optional): CVX vaccine code

Example input: `{}`

### `advancedmd_location_read`

Get Location · Read-only

Retrieve a single FHIR Location resource by its logical ID. Locations represent physical places where care is delivered, such as clinics or rooms.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `location_id` (`string`, required): The logical ID of the Location resource

Example input: `{"location_id":"<location_id>"}`

### `advancedmd_location_search`

Search Locations · Read-only

Search for FHIR Location resources representing care facilities using parameters like name and address.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `address` (`string`, optional): Any part of the location's address
- `address_city` (`string`, optional): City of the location's address
- `address_postalcode` (`string`, optional): Postal code of the location's address
- `address_state` (`string`, optional): State of the location's address
- `name` (`string`, optional): Name of the location

Example input: `{}`

### `advancedmd_medication_dispense_read`

Get Medication Dispense · Read-only

Retrieve a single FHIR MedicationDispense resource by its logical ID. Medication dispenses record medications that have been provided to a patient.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `medication_dispense_id` (`string`, required): The logical ID of the MedicationDispense resource

Example input: `{"medication_dispense_id":"<medication_dispense_id>"}`

### `advancedmd_medication_dispense_search`

Search Medication Dispenses · Read-only

Search for FHIR MedicationDispense resources recording medications provided to a patient using parameters like status, type, patient, and medication.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `medication` (`string`, optional): Medication code or reference dispensed
- `patient` (`string`, optional): Patient ID to filter medication dispenses by
- `status` (`string`, optional): Dispense status: preparation, in-progress, completed, entered-in-error, stopped
- `type` (`string`, optional): Dispense type code, e.g. RFP for a refill

Example input: `{}`

### `advancedmd_medication_request_read`

Get Medication Request · Read-only

Retrieve a single FHIR MedicationRequest resource by its logical ID. MedicationRequests represent prescriptions and medication orders.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `medication_request_id` (`string`, required): The logical ID of the MedicationRequest resource

Example input: `{"medication_request_id":"<medication_request_id>"}`

### `advancedmd_medication_request_search`

Search Medication Requests · Read-only

Search for FHIR MedicationRequest resources representing prescriptions using parameters like patient, status, medication code, and authored date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `authoredon` (`string`, optional): Date the prescription was authored (YYYY-MM-DD or range with prefix)
- `intent` (`string`, optional): Intent of the request: proposal, plan, order, instance-order
- `medication` (`string`, optional): RxNorm or other medication code
- `patient` (`string`, optional): Patient ID to filter medication requests by
- `status` (`string`, optional): Medication request status: active, on-hold, cancelled, completed, entered-in-error, stopped, draft, unknown

Example input: `{}`

### `advancedmd_observation_lastn`

Get Last N Observations · Read-only

Invoke the $lastn operation on Observation to retrieve the most recent observations per code/category grouping (e.g. latest vitals or lab results) for a patient, as declared in AdvancedMD's FHIR CapabilityStatement.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `category` (`string`, optional): Observation category to filter by, e.g. vital-signs, laboratory
- `code` (`string`, optional): LOINC or local code identifying the observation type
- `date` (`string`, optional): Filter by observation effective date (YYYY-MM-DD or range with prefix)
- `max` (`number`, optional): Maximum number of observations to return per code/category grouping. Defaults to 1 if omitted.
- `patient` (`string`, optional): Patient ID to scope the most-recent observations to

Example input: `{}`

### `advancedmd_observation_read`

Get Observation · Read-only

Retrieve a single FHIR Observation resource by its logical ID. Observations represent measurements and simple assertions about a patient, such as vitals and lab results.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `observation_id` (`string`, required): The logical ID of the Observation resource

Example input: `{"observation_id":"<observation_id>"}`

### `advancedmd_observation_search`

Search Observations · Read-only

Search for FHIR Observation resources such as vitals and lab results using parameters like patient, category, code, and date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `category` (`string`, optional): Category of observation, e.g. vital-signs, laboratory, social-history
- `code` (`string`, optional): LOINC or SNOMED code for the observation type
- `date` (`string`, optional): Filter by observation date (YYYY-MM-DD or range with prefix e.g. ge2024-01-01)
- `patient` (`string`, optional): Patient ID to filter observations by
- `status` (`string`, optional): Observation status: registered, preliminary, final, amended

Example input: `{}`

### `advancedmd_organization_read`

Get Organization · Read-only

Retrieve a single FHIR Organization resource by its logical ID. Organizations represent formally or informally recognized groupings of people or entities in the healthcare domain.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): The logical ID of the Organization resource

Example input: `{"organization_id":"<organization_id>"}`

### `advancedmd_organization_search`

Search Organizations · Read-only

Search for FHIR Organization resources such as hospitals and clinics using parameters like name, type, identifier, and active status.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `active` (`string`, optional): Whether the organization record is active: true or false
- `identifier` (`string`, optional): Organization identifier such as NPI
- `name` (`string`, optional): Name of the organization
- `type` (`string`, optional): Organization type code, e.g. prov (provider), dept (department), govt

Example input: `{}`

### `advancedmd_patient_everything`

Get Patient Everything · Read-only

Invoke the $everything operation on a Patient to retrieve all clinical resources associated with that patient in a single Bundle response.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `patient_id` (`string`, required): The logical ID of the Patient resource
- `_count` (`number`, optional): Maximum number of resources to return per page
- `_since` (`string`, optional): Only include resources updated after this instant (ISO 8601 datetime)
- `_type` (`string`, optional): Comma-separated list of resource types to include (e.g. Observation,Condition)

Example input: `{"patient_id":"<patient_id>"}`

### `advancedmd_patient_read`

Get Patient · Read-only

Retrieve a single FHIR Patient resource by its logical ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `patient_id` (`string`, required): The logical ID of the Patient resource

Example input: `{"patient_id":"<patient_id>"}`

### `advancedmd_patient_search`

Search Patients · Read-only

Search for FHIR Patient resources using common search parameters such as name, birthdate, gender, and identifier.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `birthdate` (`string`, optional): Patient's date of birth in YYYY-MM-DD format
- `email` (`string`, optional): Patient's email address
- `family` (`string`, optional): Family (last) name of the patient
- `gender` (`string`, optional): Administrative gender: male, female, other, unknown
- `given` (`string`, optional): Given (first) name of the patient
- `identifier` (`string`, optional): Patient identifier (e.g. MRN) in system|value format
- `phone` (`string`, optional): Patient's phone number

Example input: `{}`

### `advancedmd_practitioner_read`

Get Practitioner · Read-only

Retrieve a single FHIR Practitioner resource by its logical ID. Practitioners represent healthcare professionals such as doctors and nurses.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `practitioner_id` (`string`, required): The logical ID of the Practitioner resource

Example input: `{"practitioner_id":"<practitioner_id>"}`

### `advancedmd_practitioner_search`

Search Practitioners · Read-only

Search for FHIR Practitioner resources representing healthcare professionals using parameters like name, identifier, and active status.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `active` (`string`, optional): Whether the practitioner record is active: true or false
- `family` (`string`, optional): Family (last) name of the practitioner
- `given` (`string`, optional): Given (first) name of the practitioner
- `identifier` (`string`, optional): Practitioner identifier such as NPI

Example input: `{}`

### `advancedmd_procedure_read`

Get Procedure · Read-only

Retrieve a single FHIR Procedure resource by its logical ID. Procedures represent actions performed on or for a patient.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `procedure_id` (`string`, required): The logical ID of the Procedure resource

Example input: `{"procedure_id":"<procedure_id>"}`

### `advancedmd_procedure_search`

Search Procedures · Read-only

Search for FHIR Procedure resources representing clinical actions performed on a patient using parameters like patient, status, code, and date.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `code` (`string`, optional): SNOMED or CPT code for the procedure
- `date` (`string`, optional): Filter by procedure date (YYYY-MM-DD or range with prefix)
- `patient` (`string`, optional): Patient ID to filter procedures by
- `status` (`string`, optional): Procedure status: preparation, in-progress, not-done, on-hold, stopped, completed, entered-in-error, unknown

Example input: `{}`

### `advancedmd_provenance_read`

Get Provenance · Read-only

Retrieve a single FHIR Provenance resource by its logical ID. Provenance records who created or changed a resource and when.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `provenance_id` (`string`, required): The logical ID of the Provenance resource

Example input: `{"provenance_id":"<provenance_id>"}`

### `advancedmd_related_person_read`

Get Related Person · Read-only

Retrieve a single FHIR RelatedPerson resource by its logical ID. Related persons represent individuals connected to a patient, such as family members or caregivers.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `related_person_id` (`string`, required): The logical ID of the RelatedPerson resource

Example input: `{"related_person_id":"<related_person_id>"}`

### `advancedmd_related_person_search`

Search Related Persons · Read-only

Search for FHIR RelatedPerson resources representing individuals connected to a patient, such as family members or caregivers, filtered by patient and name.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `name` (`string`, optional): Name of the related person
- `patient` (`string`, optional): Patient ID to filter related persons by

Example input: `{}`

### `advancedmd_service_request_read`

Get Service Request · Read-only

Retrieve a single FHIR ServiceRequest resource by its logical ID. Service requests represent orders for services such as lab tests or referrals.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `service_request_id` (`string`, required): The logical ID of the ServiceRequest resource

Example input: `{"service_request_id":"<service_request_id>"}`

### `advancedmd_service_request_search`

Search Service Requests · Read-only

Search for FHIR ServiceRequest resources representing orders for services such as lab tests or referrals, filtered by patient.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `patient` (`string`, optional): Patient ID to filter service requests by

Example input: `{}`

### `advancedmd_specimen_read`

Get Specimen · Read-only

Retrieve a single FHIR Specimen resource by its logical ID. Specimens represent samples collected from a patient for laboratory analysis.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `specimen_id` (`string`, required): The logical ID of the Specimen resource

Example input: `{"specimen_id":"<specimen_id>"}`

### `advancedmd_specimen_search`

Search Specimens · Read-only

Search for FHIR Specimen resources representing laboratory samples collected from a patient, filtered by patient.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `_count` (`number`, optional): Maximum number of results to return per page
- `_offset` (`number`, optional): Number of results to skip for pagination
- `patient` (`string`, optional): Patient ID to filter specimens by

Example input: `{}`

### `advancedmd_allergy_intolerance_create`

Create Allergy Intolerance · Write

Create a new FHIR AllergyIntolerance resource recording a patient's allergy or intolerance to a substance.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `code` (`string`, required): Code identifying the substance (RxNorm, SNOMED, or NDF-RT)
- `code_system` (`string`, required): Code system URI for the substance code
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `category` (`string`, optional): Category: food, medication, environment, biologic
- `clinical_status` (`string`, optional): Clinical status: active, inactive, resolved
- `code_display` (`string`, optional): Human-readable display for the substance
- `criticality` (`string`, optional): Criticality: low, high, unable-to-assess
- `note` (`string`, optional): Free-text note about the allergy
- `onset_date_time` (`string`, optional): Date/time of allergy onset (ISO 8601)
- `type` (`string`, optional): Type: allergy or intolerance

Example input: `{"code":"<code>","code_system":"<code_system>","patient_id":"<patient_id>"}`

### `advancedmd_allergy_intolerance_update`

Update Allergy Intolerance · Write

Update an existing FHIR AllergyIntolerance resource by its ID.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `allergy_intolerance_id` (`string`, required): The logical ID of the AllergyIntolerance resource to update
- `code` (`string`, required): Code identifying the substance
- `code_system` (`string`, required): Code system URI for the substance code
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `category` (`string`, optional): Category: food, medication, environment, biologic
- `clinical_status` (`string`, optional): Clinical status: active, inactive, resolved
- `code_display` (`string`, optional): Human-readable display for the substance
- `criticality` (`string`, optional): Criticality: low, high, unable-to-assess
- `note` (`string`, optional): Free-text note about the allergy
- `type` (`string`, optional): Type: allergy or intolerance

Example input: `{"allergy_intolerance_id":"<allergy_intolerance_id>","code":"<code>","code_system":"<code_system>","patient_id":"<patient_id>"}`

### `advancedmd_appointment_create`

Create Appointment · Write

Create a new FHIR Appointment resource to book a patient visit with a practitioner.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `end` (`string`, required): End date/time of the appointment (ISO 8601)
- `patient_id` (`string`, required): FHIR logical ID of the patient participant
- `start` (`string`, required): Start date/time of the appointment (ISO 8601)
- `status` (`string`, required): Appointment status: proposed, pending, booked, arrived, fulfilled, cancelled, noshow, entered-in-error, checked-in, waitlist
- `comment` (`string`, optional): Additional comments about the appointment
- `description` (`string`, optional): Short description of the appointment
- `practitioner_id` (`string`, optional): FHIR logical ID of the practitioner participant
- `service_type_code` (`string`, optional): Service type code for the appointment

Example input: `{"end":"<end>","patient_id":"<patient_id>","start":"<start>","status":"<status>"}`

### `advancedmd_appointment_update`

Update Appointment · Write

Update an existing FHIR Appointment resource by its ID, e.g. to reschedule or cancel.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `appointment_id` (`string`, required): The logical ID of the Appointment resource to update
- `end` (`string`, required): End date/time of the appointment (ISO 8601)
- `patient_id` (`string`, required): FHIR logical ID of the patient participant
- `start` (`string`, required): Start date/time of the appointment (ISO 8601)
- `status` (`string`, required): Appointment status: proposed, pending, booked, arrived, fulfilled, cancelled, noshow, entered-in-error, checked-in, waitlist
- `comment` (`string`, optional): Additional comments about the appointment
- `description` (`string`, optional): Short description of the appointment
- `practitioner_id` (`string`, optional): FHIR logical ID of the practitioner participant

Example input: `{"appointment_id":"<appointment_id>","end":"<end>","patient_id":"<patient_id>","start":"<start>","status":"<status>"}`

### `advancedmd_condition_create`

Create Condition · Write

Create a new FHIR Condition resource representing a diagnosis or health problem for a patient.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `code` (`string`, required): ICD-10 or SNOMED code for the condition
- `code_system` (`string`, required): Code system URI
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `category` (`string`, optional): Condition category: problem-list-item, encounter-diagnosis
- `clinical_status` (`string`, optional): Clinical status: active, recurrence, relapse, inactive, remission, resolved
- `code_display` (`string`, optional): Human-readable display for the condition code
- `note` (`string`, optional): Free-text note about the condition
- `onset_date_time` (`string`, optional): Date/time of condition onset (ISO 8601)
- `verification_status` (`string`, optional): Verification status: unconfirmed, provisional, differential, confirmed, refuted, entered-in-error

Example input: `{"code":"<code>","code_system":"<code_system>","patient_id":"<patient_id>"}`

### `advancedmd_condition_update`

Update Condition · Write

Update an existing FHIR Condition resource by its ID. Replaces the resource with the provided data.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `code` (`string`, required): ICD-10 or SNOMED code for the condition
- `code_system` (`string`, required): Code system URI
- `condition_id` (`string`, required): The logical ID of the Condition resource to update
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `category` (`string`, optional): Condition category: problem-list-item, encounter-diagnosis
- `clinical_status` (`string`, optional): Clinical status: active, recurrence, relapse, inactive, remission, resolved
- `code_display` (`string`, optional): Human-readable display for the condition code
- `note` (`string`, optional): Free-text note about the condition
- `onset_date_time` (`string`, optional): Date/time of condition onset (ISO 8601)
- `verification_status` (`string`, optional): Verification status: unconfirmed, provisional, differential, confirmed, refuted, entered-in-error

Example input: `{"code":"<code>","code_system":"<code_system>","condition_id":"<condition_id>","patient_id":"<patient_id>"}`

### `advancedmd_diagnostic_report_create`

Create Diagnostic Report · Write

Create a new FHIR DiagnosticReport resource representing findings from a laboratory, imaging, or other diagnostic service.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `code` (`string`, required): LOINC code identifying the type of report
- `code_system` (`string`, required): Code system URI for the report code
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Report status: registered, partial, preliminary, final, amended, corrected, appended, cancelled, entered-in-error
- `category` (`string`, optional): Report category: LAB, RAD, etc.
- `code_display` (`string`, optional): Human-readable display for the report type
- `conclusion` (`string`, optional): Clinical interpretation of the report findings
- `effective_date_time` (`string`, optional): Date/time the report is clinically relevant (ISO 8601)

Example input: `{"code":"<code>","code_system":"<code_system>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_diagnostic_report_update`

Update Diagnostic Report · Write

Update an existing FHIR DiagnosticReport resource by its ID.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `code` (`string`, required): LOINC code identifying the type of report
- `code_system` (`string`, required): Code system URI for the report code
- `diagnostic_report_id` (`string`, required): The logical ID of the DiagnosticReport resource to update
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Report status: registered, partial, preliminary, final, amended, corrected, appended, cancelled, entered-in-error
- `category` (`string`, optional): Report category: LAB, RAD, etc.
- `code_display` (`string`, optional): Human-readable display for the report type
- `conclusion` (`string`, optional): Clinical interpretation of the report findings
- `effective_date_time` (`string`, optional): Date/time the report is clinically relevant (ISO 8601)

Example input: `{"code":"<code>","code_system":"<code_system>","diagnostic_report_id":"<diagnostic_report_id>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_encounter_create`

Create Encounter · Write

Create a new FHIR Encounter resource representing a patient visit or admission.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `class_code` (`string`, required): Encounter class code: AMB (ambulatory), IMP (inpatient), EMER (emergency), HH (home health)
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Encounter status: planned, arrived, triaged, in-progress, onleave, finished, cancelled
- `period_end` (`string`, optional): End date/time of the encounter (ISO 8601)
- `period_start` (`string`, optional): Start date/time of the encounter (ISO 8601)
- `reason_code` (`string`, optional): SNOMED code for the reason of the encounter
- `type_code` (`string`, optional): Specific type of encounter by SNOMED code
- `type_display` (`string`, optional): Human-readable display for the encounter type

Example input: `{"class_code":"<class_code>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_encounter_update`

Update Encounter · Write

Update an existing FHIR Encounter resource by its ID. Replaces the resource with the provided data.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `class_code` (`string`, required): Encounter class: AMB (ambulatory), IMP (inpatient), EMER (emergency), HH (home health)
- `encounter_id` (`string`, required): The logical ID of the Encounter resource to update
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Encounter status: planned, arrived, triaged, in-progress, onleave, finished, cancelled
- `period_end` (`string`, optional): End date/time of the encounter (ISO 8601)
- `period_start` (`string`, optional): Start date/time of the encounter (ISO 8601)
- `reason_code` (`string`, optional): SNOMED code for the reason of the encounter
- `type_code` (`string`, optional): Specific type of encounter by SNOMED code
- `type_display` (`string`, optional): Human-readable display for the encounter type

Example input: `{"class_code":"<class_code>","encounter_id":"<encounter_id>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_immunization_create`

Create Immunization · Write

Create a new FHIR Immunization resource recording a vaccination event for a patient.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `occurrence_date_time` (`string`, required): Date/time the vaccination occurred (ISO 8601)
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Immunization status: completed, entered-in-error, not-done
- `vaccine_code` (`string`, required): CVX vaccine code
- `vaccine_system` (`string`, required): Code system URI for the vaccine code
- `lot_number` (`string`, optional): Vaccine lot number
- `note` (`string`, optional): Additional notes about the immunization
- `vaccine_display` (`string`, optional): Human-readable display for the vaccine

Example input: `{"occurrence_date_time":"<occurrence_date_time>","patient_id":"<patient_id>","status":"<status>","vaccine_code":"<vaccine_code>","vaccine_system":"<vaccine_system>"}`

### `advancedmd_immunization_update`

Update Immunization · Write

Update an existing FHIR Immunization resource by its ID.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `immunization_id` (`string`, required): The logical ID of the Immunization resource to update
- `occurrence_date_time` (`string`, required): Date/time the vaccination occurred (ISO 8601)
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Immunization status: completed, entered-in-error, not-done
- `vaccine_code` (`string`, required): CVX vaccine code
- `vaccine_system` (`string`, required): Code system URI for the vaccine code
- `lot_number` (`string`, optional): Vaccine lot number
- `note` (`string`, optional): Additional notes about the immunization
- `vaccine_display` (`string`, optional): Human-readable display for the vaccine

Example input: `{"immunization_id":"<immunization_id>","occurrence_date_time":"<occurrence_date_time>","patient_id":"<patient_id>","status":"<status>","vaccine_code":"<vaccine_code>","vaccine_system":"<vaccine_system>"}`

### `advancedmd_medication_request_create`

Create Medication Request · Write

Create a new FHIR MedicationRequest resource representing a prescription or medication order for a patient.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `intent` (`string`, required): Intent: proposal, plan, order, instance-order
- `medication_code` (`string`, required): RxNorm or other medication code
- `medication_system` (`string`, required): Code system URI for the medication code
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Status: active, on-hold, cancelled, completed, entered-in-error, stopped, draft, unknown
- `authored_on` (`string`, optional): Date the prescription was authored (ISO 8601)
- `dosage_text` (`string`, optional): Free-text dosage instructions
- `medication_display` (`string`, optional): Human-readable medication name
- `note` (`string`, optional): Additional notes about the prescription

Example input: `{"intent":"<intent>","medication_code":"<medication_code>","medication_system":"<medication_system>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_medication_request_update`

Update Medication Request · Write

Update an existing FHIR MedicationRequest resource by its ID. Replaces the resource with the provided data.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `intent` (`string`, required): Intent: proposal, plan, order, instance-order
- `medication_code` (`string`, required): RxNorm or other medication code
- `medication_request_id` (`string`, required): The logical ID of the MedicationRequest resource to update
- `medication_system` (`string`, required): Code system URI for the medication code
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Status: active, on-hold, cancelled, completed, entered-in-error, stopped, draft, unknown
- `authored_on` (`string`, optional): Date the prescription was authored (ISO 8601)
- `dosage_text` (`string`, optional): Free-text dosage instructions
- `medication_display` (`string`, optional): Human-readable medication name
- `note` (`string`, optional): Additional notes about the prescription

Example input: `{"intent":"<intent>","medication_code":"<medication_code>","medication_request_id":"<medication_request_id>","medication_system":"<medication_system>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_observation_create`

Create Observation · Write

Create a new FHIR Observation resource such as a vital sign or lab result for a patient.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `code` (`string`, required): Code identifying the observation type (e.g. LOINC code)
- `code_system` (`string`, required): Code system URI for the observation code
- `patient_id` (`string`, required): FHIR logical ID of the patient this observation belongs to
- `status` (`string`, required): Observation status: registered, preliminary, final, amended
- `category` (`string`, optional): Observation category: vital-signs, laboratory, social-history, imaging, etc.
- `code_display` (`string`, optional): Human-readable display for the code
- `effective_date_time` (`string`, optional): Date/time the observation was clinically relevant (ISO 8601)
- `note` (`string`, optional): Free-text note about the observation
- `unit` (`string`, optional): Unit of measure for the value (UCUM code)
- `value` (`number`, optional): Numeric value of the observation

Example input: `{"code":"<code>","code_system":"<code_system>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_observation_update`

Update Observation · Write

Update an existing FHIR Observation resource by its ID. Replaces the resource with the provided data.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `code` (`string`, required): Code identifying the observation type (e.g. LOINC code)
- `code_system` (`string`, required): Code system URI for the observation code
- `observation_id` (`string`, required): The logical ID of the Observation resource to update
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Observation status: registered, preliminary, final, amended
- `category` (`string`, optional): Observation category: vital-signs, laboratory, social-history, imaging, etc.
- `code_display` (`string`, optional): Human-readable display for the code
- `effective_date_time` (`string`, optional): Date/time the observation was clinically relevant (ISO 8601)
- `note` (`string`, optional): Free-text note about the observation
- `unit` (`string`, optional): Unit of measure for the value (UCUM code)
- `value` (`number`, optional): Numeric value of the observation

Example input: `{"code":"<code>","code_system":"<code_system>","observation_id":"<observation_id>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_organization_create`

Create Organization · Write

Create a new FHIR Organization resource representing a hospital, clinic, or other healthcare entity.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Name of the organization
- `active` (`boolean`, optional): Whether the organization is active
- `address_line` (`string`, optional): Street address line
- `city` (`string`, optional): City
- `email` (`string`, optional): Organization's email address
- `phone` (`string`, optional): Organization's main phone number
- `postal_code` (`string`, optional): Postal or ZIP code
- `state` (`string`, optional): State or province
- `type_code` (`string`, optional): Organization type: prov (provider), dept (department), team, govt, ins (insurer), cg (clinical group)

Example input: `{"name":"<name>"}`

### `advancedmd_organization_update`

Update Organization · Write

Update an existing FHIR Organization resource by its ID.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): Name of the organization
- `organization_id` (`string`, required): The logical ID of the Organization resource to update
- `active` (`boolean`, optional): Whether the organization is active
- `address_line` (`string`, optional): Street address line
- `city` (`string`, optional): City
- `email` (`string`, optional): Organization's email address
- `phone` (`string`, optional): Organization's main phone number
- `postal_code` (`string`, optional): Postal or ZIP code
- `state` (`string`, optional): State or province
- `type_code` (`string`, optional): Organization type: prov, dept, team, govt, ins, cg

Example input: `{"name":"<name>","organization_id":"<organization_id>"}`

### `advancedmd_patient_create`

Create Patient · Write

Create a new FHIR Patient resource with demographic information including name, gender, birth date, contact details, and address.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `family_name` (`string`, required): Patient's family (last) name
- `address_line` (`string`, optional): Street address line
- `birth_date` (`string`, optional): Date of birth in YYYY-MM-DD format
- `city` (`string`, optional): City
- `country` (`string`, optional): Country code (ISO 3166)
- `email` (`string`, optional): Patient's email address
- `gender` (`string`, optional): Administrative gender: male, female, other, unknown
- `given_names` (`array`, optional): List of given (first/middle) names
- `phone` (`string`, optional): Patient's phone number
- `postal_code` (`string`, optional): Postal or ZIP code
- `state` (`string`, optional): State or province

Example input: `{"family_name":"<family_name>"}`

### `advancedmd_patient_update`

Update Patient · Write

Update an existing FHIR Patient resource by its ID. Replaces the resource with the provided demographic data.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `family_name` (`string`, required): Patient's family (last) name
- `patient_id` (`string`, required): The logical ID of the Patient resource to update
- `address_line` (`string`, optional): Street address line
- `birth_date` (`string`, optional): Date of birth in YYYY-MM-DD format
- `city` (`string`, optional): City
- `country` (`string`, optional): Country code (ISO 3166)
- `email` (`string`, optional): Patient's email address
- `gender` (`string`, optional): Administrative gender: male, female, other, unknown
- `given_names` (`array`, optional): List of given (first/middle) names
- `phone` (`string`, optional): Patient's phone number
- `postal_code` (`string`, optional): Postal or ZIP code
- `state` (`string`, optional): State or province

Example input: `{"family_name":"<family_name>","patient_id":"<patient_id>"}`

### `advancedmd_practitioner_create`

Create Practitioner · Write

Create a new FHIR Practitioner resource representing a healthcare professional such as a doctor or nurse.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `family_name` (`string`, required): Practitioner's family (last) name
- `email` (`string`, optional): Practitioner's email address
- `gender` (`string`, optional): Administrative gender: male, female, other, unknown
- `given_names` (`array`, optional): List of given (first/middle) names
- `npi` (`string`, optional): National Provider Identifier (NPI)
- `phone` (`string`, optional): Practitioner's phone number

Example input: `{"family_name":"<family_name>"}`

### `advancedmd_practitioner_update`

Update Practitioner · Write

Update an existing FHIR Practitioner resource by its ID.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `family_name` (`string`, required): Practitioner's family (last) name
- `practitioner_id` (`string`, required): The logical ID of the Practitioner resource to update
- `email` (`string`, optional): Practitioner's email address
- `gender` (`string`, optional): Administrative gender: male, female, other, unknown
- `given_names` (`array`, optional): List of given (first/middle) names
- `npi` (`string`, optional): National Provider Identifier (NPI)
- `phone` (`string`, optional): Practitioner's phone number

Example input: `{"family_name":"<family_name>","practitioner_id":"<practitioner_id>"}`

### `advancedmd_procedure_create`

Create Procedure · Write

Create a new FHIR Procedure resource recording a clinical action performed on or for a patient.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `code` (`string`, required): SNOMED or CPT code for the procedure
- `code_system` (`string`, required): Code system URI for the procedure code
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `status` (`string`, required): Procedure status: preparation, in-progress, not-done, on-hold, stopped, completed, entered-in-error, unknown
- `code_display` (`string`, optional): Human-readable display for the procedure code
- `note` (`string`, optional): Free-text note about the procedure
- `performed_date_time` (`string`, optional): Date/time the procedure was performed (ISO 8601)
- `reason_code` (`string`, optional): SNOMED code for the reason the procedure was performed

Example input: `{"code":"<code>","code_system":"<code_system>","patient_id":"<patient_id>","status":"<status>"}`

### `advancedmd_procedure_update`

Update Procedure · Write

Update an existing FHIR Procedure resource by its ID.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `code` (`string`, required): SNOMED or CPT code for the procedure
- `code_system` (`string`, required): Code system URI for the procedure code
- `patient_id` (`string`, required): FHIR logical ID of the patient
- `procedure_id` (`string`, required): The logical ID of the Procedure resource to update
- `status` (`string`, required): Procedure status: preparation, in-progress, not-done, on-hold, stopped, completed, entered-in-error, unknown
- `code_display` (`string`, optional): Human-readable display for the procedure code
- `note` (`string`, optional): Free-text note about the procedure
- `performed_date_time` (`string`, optional): Date/time the procedure was performed (ISO 8601)
- `reason_code` (`string`, optional): SNOMED code for the reason the procedure was performed

Example input: `{"code":"<code>","code_system":"<code_system>","patient_id":"<patient_id>","procedure_id":"<procedure_id>","status":"<status>"}`

### `advancedmd_allergy_intolerance_delete`

Delete Allergy Intolerance · Destructive

Delete a FHIR AllergyIntolerance resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `allergy_intolerance_id` (`string`, required): The logical ID of the AllergyIntolerance resource to delete

Example input: `{"allergy_intolerance_id":"<allergy_intolerance_id>"}`

### `advancedmd_appointment_delete`

Delete Appointment · Destructive

Delete a FHIR Appointment resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `appointment_id` (`string`, required): The logical ID of the Appointment resource to delete

Example input: `{"appointment_id":"<appointment_id>"}`

### `advancedmd_condition_delete`

Delete Condition · Destructive

Delete a FHIR Condition resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `condition_id` (`string`, required): The logical ID of the Condition resource to delete

Example input: `{"condition_id":"<condition_id>"}`

### `advancedmd_diagnostic_report_delete`

Delete Diagnostic Report · Destructive

Delete a FHIR DiagnosticReport resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `diagnostic_report_id` (`string`, required): The logical ID of the DiagnosticReport resource to delete

Example input: `{"diagnostic_report_id":"<diagnostic_report_id>"}`

### `advancedmd_encounter_delete`

Delete Encounter · Destructive

Delete a FHIR Encounter resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `encounter_id` (`string`, required): The logical ID of the Encounter resource to delete

Example input: `{"encounter_id":"<encounter_id>"}`

### `advancedmd_immunization_delete`

Delete Immunization · Destructive

Delete a FHIR Immunization resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `immunization_id` (`string`, required): The logical ID of the Immunization resource to delete

Example input: `{"immunization_id":"<immunization_id>"}`

### `advancedmd_medication_request_delete`

Delete Medication Request · Destructive

Delete a FHIR MedicationRequest resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `medication_request_id` (`string`, required): The logical ID of the MedicationRequest resource to delete

Example input: `{"medication_request_id":"<medication_request_id>"}`

### `advancedmd_observation_delete`

Delete Observation · Destructive

Delete a FHIR Observation resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `observation_id` (`string`, required): The logical ID of the Observation resource to delete

Example input: `{"observation_id":"<observation_id>"}`

### `advancedmd_organization_delete`

Delete Organization · Destructive

Delete a FHIR Organization resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): The logical ID of the Organization resource to delete

Example input: `{"organization_id":"<organization_id>"}`

### `advancedmd_patient_delete`

Delete Patient · Destructive

Delete a FHIR Patient resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `patient_id` (`string`, required): The logical ID of the Patient resource to delete

Example input: `{"patient_id":"<patient_id>"}`

### `advancedmd_practitioner_delete`

Delete Practitioner · Destructive

Delete a FHIR Practitioner resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `practitioner_id` (`string`, required): The logical ID of the Practitioner resource to delete

Example input: `{"practitioner_id":"<practitioner_id>"}`

### `advancedmd_procedure_delete`

Delete Procedure · Destructive

Delete a FHIR Procedure resource by its logical ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `procedure_id` (`string`, required): The logical ID of the Procedure resource to delete

Example input: `{"procedure_id":"<procedure_id>"}`

## Workflows

**Proxy API call**

Call the FHIR server's REST API directly through the Scalekit proxy. Use standard FHIR search paths such as `/Patient` or `/Observation`.

  **Node.js**

  ```typescript
  const result = await actions.request({
    connectionName: 'advancedmd',
    identifier: 'user_123',
    path: '/Patient?family=Smith&_count=10',
    method: 'GET',
  });
  console.log(result);
  ```

  **Python**

  ```python
  result = actions.request(
      connection_name='advancedmd',
      identifier='user_123',
      path="/Patient?family=Smith&_count=10",
      method="GET"
  )
  print(result)
  ```

**Search for patients**

  **Node.js**

  ```typescript
  const patients = await actions.executeTool({
    connector: 'advancedmd',
    identifier: 'user_123',
    toolName: 'advancedmd_patient_search',
    toolInput: {
      family: 'Smith',
      given: 'Jane',
      birthdate: '1985-04-12',
      _count: 10,
    },
  });
  console.log('Matching patients:', patients);
  ```

  **Python**

  ```python
  patients = actions.execute_tool(
      connection_name='advancedmd',
      identifier='user_123',
      tool_name="advancedmd_patient_search",
      tool_input={
          "family": "Smith",
          "given": "Jane",
          "birthdate": "1985-04-12",
          "_count": 10,
      },
  )
  print("Matching patients:", patients)
  ```

**Retrieve everything for a patient**

Invoke the FHIR `$everything` operation to pull all clinical resources for one patient in a single Bundle. Pass `_type` to limit the response to specific resource types.

  **Node.js**

  ```typescript
  const bundle = await actions.executeTool({
    connector: 'advancedmd',
    identifier: 'user_123',
    toolName: 'advancedmd_patient_everything',
    toolInput: {
      patient_id: 'a1b2c3d4-0000-1111-2222-333344445555',
      _type: 'Condition,Observation,MedicationRequest',
      _count: 50,
    },
  });
  console.log('Bundle entries:', bundle);
  ```

  **Python**

  ```python
  bundle = actions.execute_tool(
      connection_name='advancedmd',
      identifier='user_123',
      tool_name="advancedmd_patient_everything",
      tool_input={
          "patient_id": "a1b2c3d4-0000-1111-2222-333344445555",
          "_type": "Condition,Observation,MedicationRequest",
          "_count": 50,
      },
  )
  print("Bundle entries:", bundle)
  ```

**Search a patient's observations**

  **Node.js**

  ```typescript
  const observations = await actions.executeTool({
    connector: 'advancedmd',
    identifier: 'user_123',
    toolName: 'advancedmd_observation_search',
    toolInput: {
      patient: 'a1b2c3d4-0000-1111-2222-333344445555',
      category: 'vital-signs',
      date: 'ge2026-01-01',
      _count: 25,
    },
  });
  console.log('Observations:', observations);
  ```

  **Python**

  ```python
  observations = actions.execute_tool(
      connection_name='advancedmd',
      identifier='user_123',
      tool_name="advancedmd_observation_search",
      tool_input={
          "patient": "a1b2c3d4-0000-1111-2222-333344445555",
          "category": "vital-signs",
          "date": "ge2026-01-01",
          "_count": 25,
      },
  )
  print("Observations:", observations)
  ```

**Record a vital-sign observation**

Create an Observation such as a heart-rate reading. The `code` and `code_system` identify the measurement — this example uses the LOINC code `8867-4` (Heart rate).

  **Node.js**

  ```typescript
  const observation = await actions.executeTool({
    connector: 'advancedmd',
    identifier: 'user_123',
    toolName: 'advancedmd_observation_create',
    toolInput: {
      patient_id: 'a1b2c3d4-0000-1111-2222-333344445555',
      status: 'final',
      code: '8867-4',
      code_system: 'http://loinc.org',
      code_display: 'Heart rate',
      category: 'vital-signs',
      effective_date_time: new Date().toISOString(),
      value: 72,
      unit: '/min',
    },
  });
  console.log('Created observation:', observation);
  ```

  **Python**

  ```python
  from datetime import datetime, timezone

  observation = actions.execute_tool(
      connection_name='advancedmd',
      identifier='user_123',
      tool_name="advancedmd_observation_create",
      tool_input={
          "patient_id": "a1b2c3d4-0000-1111-2222-333344445555",
          "status": "final",
          "code": "8867-4",
          "code_system": "http://loinc.org",
          "code_display": "Heart rate",
          "category": "vital-signs",
          "effective_date_time": datetime.now(timezone.utc).isoformat(),
          "value": 72,
          "unit": "/min",
      },
  )
  print("Created observation:", observation)
  ```

## Related

Other Healthcare & life sciences connectors ([all 16](/agentkit/connectors/?category=healthcare)):

- [Synapse MCP server](/agentkit/connectors/synapsemcp/): Vendor MCP, OAuth, 48 tools
- [Availity](/agentkit/connectors/availity/): Scalekit connector, Service account, 11 tools
- [Healthie](/agentkit/connectors/healthie/): Scalekit connector, API key, 44 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
