> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended**:
> ```bash
> npx @scalekit-inc/cli setup
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for 40+ agents.
> Features: full-stack-auth, agent-auth, mcp-auth, modular-sso, modular-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# SMART App on FHIR connector

SMART App on FHIR is a healthcare interoperability provider that enables secure access to electronic health records and clinical data using the SMART on...

**Authentication:** SMART On FHIR
**Categories:** Healthcare
1. ### Install the SDK

   
     ### Node.js

```bash frame="terminal"
npm install @scalekit-sdk/node
```

     ### Python

```bash frame="terminal"
pip install scalekit
```

   

   Full SDK reference: [Node.js](/agentkit/sdks/node/) | [Python](/agentkit/sdks/python/)

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 showLineNumbers=false title=".env"
SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
SCALEKIT_CLIENT_ID=<your-client-id>
SCALEKIT_CLIENT_SECRET=<your-client-secret>
```

3. ### Set up the connector

   Register your SMART App on FHIR credentials with Scalekit so it can authenticate requests on your behalf. You do this once per environment.

   ## Dashboard setup steps

SMART App on FHIR uses an OAuth 2.0 authorization code flow with PKCE. Because every FHIR server 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 register a client with your FHIR server to obtain a client ID, and a client secret if the server issues one.

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

   Every SMART on FHIR server publishes its OAuth endpoints at a well-known discovery URL:

   ```text
   <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 FHIR server base URL, for example `https://fhir.example.com/r4` — this gives you both the **Audience (`aud`)** value and the **FHIR server domain** (the same URL without the `https://` scheme, for example `fhir.example.com`)

   {/* TODO: add provider-specific steps — where to find the FHIR base URL for this specific EHR/FHIR server (for example, an Epic App Orchard sandbox URL or a Cerner Code Console tenant URL) */}

   > 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. ### Register an app with your FHIR server

   - Register a new app in your FHIR server's developer portal or app-registration console to obtain a **client ID**. Scalekit uses PKCE, so a public client works; if your FHIR server issues a **client secret**, note it as well and add it in the next step.

     {/* TODO: add provider-specific steps — app registration flow for this FHIR server (for example, Epic App Orchard "Build Apps", Cerner Code Console, or a custom EHR admin portal) */}

     {/* TODO: add screenshot — alt: "App registration form in the FHIR server developer portal" */}

   - When prompted for a redirect URI, 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 **SMART App on FHIR** and click **Create**. Copy the redirect URI — it looks like `https:///sso/v1/oauth//callback`.

   {/* TODO: add screenshot — alt: "Copy redirect URI from Scalekit dashboard for SMART App on FHIR" */}

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

   {/* TODO: add provider-specific steps — where to paste the redirect URI back into this FHIR server's app settings */}

4. ### Create the connection in Scalekit

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

   - **Client ID** — the client ID from your FHIR server app registration
   - **Client Secret** — the client secret from your FHIR server app registration, if one was issued; leave blank for a public PKCE client
   - **Authorization Endpoint** — the `authorization_endpoint` from `.well-known/smart-configuration`
   - **Token Endpoint** — the `token_endpoint` from `.well-known/smart-configuration`
   - **Audience (`aud`)** — the FHIR server base URL, sent as the required `aud` parameter on the authorization request
   - **FHIR Server Domain** — the FHIR server domain without the `https://` scheme, for example `fhir.example.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 FHIR server app registration.

   {/* TODO: add screenshot — alt: "SMART App on FHIR connection configuration form in Scalekit dashboard" */}

   Click **Save**.

5. ### Verify the connection is active

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

   {/* TODO: add screenshot — alt: "Active connected account status for SMART App on FHIR" */}

## What you can do

Connect this agent connector to let your agent:

- **Create allergy intolerance, appointment, condition** — Create a new FHIR AllergyIntolerance resource recording a patient's allergy or intolerance to a substance
- **Delete allergy intolerance, appointment, condition** — Delete a FHIR AllergyIntolerance resource by its logical ID
- **Read allergy intolerance, appointment, condition** — Retrieve a single FHIR AllergyIntolerance resource by its logical ID
- **Search allergy intolerance, appointment, condition** — Search for FHIR AllergyIntolerance resources using parameters like patient, clinical status, type, category, and criticality
- **Update allergy intolerance, appointment, condition** — Update an existing FHIR AllergyIntolerance resource by its ID
- **Everything patient** — Invoke the $everything operation on a Patient to retrieve all clinical resources associated with that patient in a single Bundle response

## Common workflows

export const sectionTitle = 'Common 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: 'customsmartfhir',
  identifier: 'user_123',
  path: '/Patient?family=Smith&_count=10',
  method: 'GET',
});
console.log(result);
```

  ### Python

```python
result = actions.request(
    connection_name='customsmartfhir',
    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: 'customsmartfhir',
  identifier: 'user_123',
  toolName: 'customsmartfhir_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='customsmartfhir',
    identifier='user_123',
    tool_name="customsmartfhir_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: 'customsmartfhir',
  identifier: 'user_123',
  toolName: 'customsmartfhir_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='customsmartfhir',
    identifier='user_123',
    tool_name="customsmartfhir_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: 'customsmartfhir',
  identifier: 'user_123',
  toolName: 'customsmartfhir_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='customsmartfhir',
    identifier='user_123',
    tool_name="customsmartfhir_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: 'customsmartfhir',
  identifier: 'user_123',
  toolName: 'customsmartfhir_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='customsmartfhir',
    identifier='user_123',
    tool_name="customsmartfhir_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)
```

## Tool list

Use the exact tool names from the **Tool list** below when you call `execute_tool`. If you're not sure which name to use, list the tools available for the current user first.

## Tool list

### `customsmartfhir_allergy_intolerance_create`

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

Parameters:

- `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

### `customsmartfhir_allergy_intolerance_delete`

Delete a FHIR AllergyIntolerance resource by its logical ID.

Parameters:

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

### `customsmartfhir_allergy_intolerance_read`

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

Parameters:

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

### `customsmartfhir_allergy_intolerance_search`

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

Parameters:

- `_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

### `customsmartfhir_allergy_intolerance_update`

Update an existing FHIR AllergyIntolerance resource by its ID.

Parameters:

- `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

### `customsmartfhir_appointment_create`

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

Parameters:

- `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

### `customsmartfhir_appointment_delete`

Delete a FHIR Appointment resource by its logical ID.

Parameters:

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

### `customsmartfhir_appointment_read`

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

Parameters:

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

### `customsmartfhir_appointment_search`

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

Parameters:

- `_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

### `customsmartfhir_appointment_update`

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

Parameters:

- `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

### `customsmartfhir_condition_create`

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

Parameters:

- `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

### `customsmartfhir_condition_delete`

Delete a FHIR Condition resource by its logical ID.

Parameters:

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

### `customsmartfhir_condition_read`

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

Parameters:

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

### `customsmartfhir_condition_search`

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

Parameters:

- `_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

### `customsmartfhir_condition_update`

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

Parameters:

- `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

### `customsmartfhir_diagnostic_report_create`

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

Parameters:

- `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)

### `customsmartfhir_diagnostic_report_delete`

Delete a FHIR DiagnosticReport resource by its logical ID.

Parameters:

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

### `customsmartfhir_diagnostic_report_read`

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.

Parameters:

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

### `customsmartfhir_diagnostic_report_search`

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

Parameters:

- `_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

### `customsmartfhir_diagnostic_report_update`

Update an existing FHIR DiagnosticReport resource by its ID.

Parameters:

- `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)

### `customsmartfhir_encounter_create`

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

Parameters:

- `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

### `customsmartfhir_encounter_delete`

Delete a FHIR Encounter resource by its logical ID.

Parameters:

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

### `customsmartfhir_encounter_read`

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

Parameters:

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

### `customsmartfhir_encounter_search`

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

Parameters:

- `_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

### `customsmartfhir_encounter_update`

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

Parameters:

- `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

### `customsmartfhir_immunization_create`

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

Parameters:

- `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

### `customsmartfhir_immunization_delete`

Delete a FHIR Immunization resource by its logical ID.

Parameters:

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

### `customsmartfhir_immunization_read`

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

Parameters:

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

### `customsmartfhir_immunization_search`

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

Parameters:

- `_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

### `customsmartfhir_immunization_update`

Update an existing FHIR Immunization resource by its ID.

Parameters:

- `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

### `customsmartfhir_medication_request_create`

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

Parameters:

- `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

### `customsmartfhir_medication_request_delete`

Delete a FHIR MedicationRequest resource by its logical ID.

Parameters:

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

### `customsmartfhir_medication_request_read`

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

Parameters:

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

### `customsmartfhir_medication_request_search`

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

Parameters:

- `_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

### `customsmartfhir_medication_request_update`

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

Parameters:

- `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

### `customsmartfhir_observation_create`

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

Parameters:

- `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

### `customsmartfhir_observation_delete`

Delete a FHIR Observation resource by its logical ID.

Parameters:

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

### `customsmartfhir_observation_read`

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.

Parameters:

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

### `customsmartfhir_observation_search`

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

Parameters:

- `_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

### `customsmartfhir_observation_update`

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

Parameters:

- `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

### `customsmartfhir_organization_create`

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

Parameters:

- `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)

### `customsmartfhir_organization_delete`

Delete a FHIR Organization resource by its logical ID.

Parameters:

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

### `customsmartfhir_organization_read`

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.

Parameters:

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

### `customsmartfhir_organization_search`

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

Parameters:

- `_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

### `customsmartfhir_organization_update`

Update an existing FHIR Organization resource by its ID.

Parameters:

- `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

### `customsmartfhir_patient_create`

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

Parameters:

- `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

### `customsmartfhir_patient_delete`

Delete a FHIR Patient resource by its logical ID.

Parameters:

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

### `customsmartfhir_patient_everything`

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

Parameters:

- `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)

### `customsmartfhir_patient_read`

Retrieve a single FHIR Patient resource by its logical ID.

Parameters:

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

### `customsmartfhir_patient_search`

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

Parameters:

- `_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

### `customsmartfhir_patient_update`

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

Parameters:

- `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

### `customsmartfhir_practitioner_create`

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

Parameters:

- `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

### `customsmartfhir_practitioner_delete`

Delete a FHIR Practitioner resource by its logical ID.

Parameters:

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

### `customsmartfhir_practitioner_read`

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

Parameters:

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

### `customsmartfhir_practitioner_search`

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

Parameters:

- `_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

### `customsmartfhir_practitioner_update`

Update an existing FHIR Practitioner resource by its ID.

Parameters:

- `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

### `customsmartfhir_procedure_create`

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

Parameters:

- `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

### `customsmartfhir_procedure_delete`

Delete a FHIR Procedure resource by its logical ID.

Parameters:

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

### `customsmartfhir_procedure_read`

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

Parameters:

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

### `customsmartfhir_procedure_search`

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

Parameters:

- `_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

### `customsmartfhir_procedure_update`

Update an existing FHIR Procedure resource by its ID.

Parameters:

- `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


---

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