Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to MEDITECH

Scalekit connector
Open markdown

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

Tools
61
What they doRead · write · destructive
59 · 2 · 059 read2 write0 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the MEDITECH connection

    In AgentKit > Connections, create a MEDITECH connection. The name you give it is the connection_name your code passes. See Configure connections.

    Console steps with screenshots

    MEDITECH connections use SMART on FHIR and act as the signed-in clinician, through MEDITECH Expanse’s provider-facing FHIR API. Every hospital runs its own MEDITECH API host, so each connection carries that host’s authorization endpoint, token endpoint, audience (aud) and FHIR server domain, plus the client ID and secret the hospital issues for your app.

    1. Create the connection and copy the redirect URI

      In the Scalekit dashboard, go to AgentKit > Connections > Create Connection, find MEDITECH and click Create. Copy the Redirect URI.

    2. Get a client from the hospital

      Each hospital approves your app and onboards it with MEDITECH. The hospital’s MEDITECH system administrator issues the client ID and client secret:

      • Register the redirect URI you copied.
      • Request refresh tokens (offline_access).

      For development, MEDITECH’s Greenfield Workspace provides a sandbox with test clinicians.

    3. Find the hospital’s endpoints

      The FHIR base is https://<hospital-api-host>/v2/uscore/STU6. MEDITECH lists hospital API hosts at https://fhir-apis.meditech.com/v1/brands; that list shows each host’s v1/uscore/R4 base, so replace that path with v2/uscore/STU6. Which versions a hospital enables is confirmed at onboarding.

      Open https://<hospital-api-host>/.well-known/smart-configuration and copy authorization_endpoint and token_endpoint.

    4. Enter the values on the connection

      Back on the MEDITECH connection, enter:

      • Client ID and Client Secret: from the hospital.
      • Authorization Endpoint and Token Endpoint: from .well-known/smart-configuration.
      • Audience (aud): the full FHIR base URL, ending in /v2/uscore/STU6.
      • FHIR Server Domain: the FHIR base without https://, including its path, such as <hospital-api-host>/v2/uscore/STU6.

      Select openid, fhirUser and offline_access, plus the resource scopes your agent needs. Click Save.

      To test against the Greenfield Workspace sandbox, use these values:

      FieldSandbox value
      Authorization Endpointhttps://greenfield-apis.meditech.com/oauth/authorize
      Token Endpointhttps://greenfield-apis.meditech.com/oauth/token
      Audience (aud)https://greenfield-apis.meditech.com/v2/uscore/STU6
      FHIR Server Domaingreenfield-apis.meditech.com/v2/uscore/STU6

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • meditech_allergy_intolerance_readGet one allergy from MEDITECH by its FHIR ID.Read-only

    Get Allergy Intolerance

    Get one allergy from MEDITECH by its FHIR ID. Returns a FHIR AllergyIntolerance resource with substance code, clinical and verification status, criticality, reactions, and recorded date. Use meditech_allergy_intolerance_read to fetch one known ID. Use meditech_allergy_intolerance_search to find allergies.

    Inputs

    allergy_intolerance_idstringrequired
    FHIR logical ID of the allergy, without the 'AllergyIntolerance/' prefix. Example: 12345
  • meditech_appointment_readGet one appointment from MEDITECH by its FHIR ID.Read-only

    Get Appointment

    Get one appointment from MEDITECH by its FHIR ID. Returns a FHIR Appointment resource with status, start and end time, appointment type, participants (patient, practitioner, location), and reason. Use meditech_appointment_read to fetch one known ID. Use meditech_appointment_search to find appointments.

    Inputs

    appointment_idstringrequired
    FHIR logical ID of the appointment, without the 'Appointment/' prefix. Example: 12345
  • meditech_binary_readGet one binary file from MEDITECH by its FHIR ID.Read-only

    Get Binary

    Get one binary file from MEDITECH by its FHIR ID. Returns a FHIR Binary resource with the content type and base64-encoded data of a document attachment. Use meditech_binary_read to download an attachment that a document or report links to as Binary/<id>. Use meditech_document_reference_search to find documents first.

    Inputs

    binary_idstringrequired
    FHIR logical ID of the binary file, without the 'Binary/' prefix. Example: 12345
  • meditech_care_plan_readGet one care plan from MEDITECH by its FHIR ID.Read-only

    Get Care Plan

    Get one care plan from MEDITECH by its FHIR ID. Returns a FHIR CarePlan resource with category, status, intent, narrative text, period, and linked goals and activities. Use meditech_care_plan_read to fetch one known ID. Use meditech_care_plan_search to find care plans.

    Inputs

    care_plan_idstringrequired
    FHIR logical ID of the care plan, without the 'CarePlan/' prefix. Example: 12345
  • meditech_care_team_readGet one care team from MEDITECH by its FHIR ID.Read-only

    Get Care Team

    Get one care team from MEDITECH by its FHIR ID. Returns a FHIR CareTeam resource with status, the patient, and participants with their roles. Use meditech_care_team_read to fetch one known ID. Use meditech_care_team_search to find care teams.

    Inputs

    care_team_idstringrequired
    FHIR logical ID of the care team, without the 'CareTeam/' prefix. Example: 12345