Cobalt
Blog/Engineering Guide

Why AI Scheduling Teams Struggle with eClinicalWorks

eClinicalWorks schedule slots are a flexible primitive that clinics use in wildly different ways. If you’re building an AI scheduling product, here’s what you need to know.

Bryan, Founder & CEO7 min read

The Problem

Your AI scheduling model expects discrete time slots: “9:00–9:20 AM is available for a new patient visit.” But eClinicalWorks doesn’t think that way. It gives clinics a flexible system of schedule slot rules with time ranges and capacity counts — and every clinic uses them differently.

We’ve seen hundreds of eCW configurations across our customer base. They broadly fall into three patterns, and understanding which one you’re dealing with is the key to getting availability right.

Pattern 1: Single Appointment Slots

9:00–9:20 AM → “New Patient”, max_visits = 1
9:20–9:40 AM → “Follow-up”, max_visits = 1
9:40–10:00 AM → “New Patient”, max_visits = 1

This is the simplest case. Each slot maps directly to one appointment. The time range IS the appointment duration. These clinics are essentially using eCW like a traditional calendar. You can treat the gaps between booked appointments as available time.

Pattern 2: Multi-Capacity Slots

10:00–11:00 AM → “Established Patient”, max_visits = 3
1:00–2:00 PM → “New Patient”, max_visits = 2

Here the clinic is saying “between 10 and 11 AM, we can see up to 3 established patients.” The slot isn’t a single appointment — it’s a capacity block. You need to track how many appointments of the matching visit type have been booked against that slot to know remaining capacity. Importantly, a “new patient” appointment during the 10–11 AM block does NOT reduce the established patient capacity.

Pattern 3: Daily Capacity Blocks

9:00 AM–5:00 PM → “New Patient”, max_visits = 2
9:00 AM–5:00 PM → “Follow-up”, max_visits = 4

The entire day is one block. The clinic is saying “we can handle 2 new patients and 4 follow-ups today, scheduled whenever.” Any appointment during the day reduces capacity, regardless of visit type overlap. This is the trickiest pattern because a naive subdivision would show dozens of open slots when only a handful of appointments can actually be booked.

The Real Challenge: You Don’t Know Which Pattern You’re Dealing With

The person integrating your scheduling API is usually a developer — not the clinic admin who configured eCW. They get a blob of schedule slot data and have to figure out which pattern the clinic is using, then write the right logic to interpret it.

And that’s before you account for clinics that mix patterns, have business rules on spreadsheets outside of eCW, or have eCW configured incorrectly.

How Cobalt Handles This

Our GET /availability endpoint has a calculation_method parameter that maps to each of these patterns:

gaps — Pattern 1. Finds free time between appointments during working hours.

slots — Pattern 2. Uses pre-defined slots, blocked only by appointments matching that slot’s visit type.

equal_slots — Pattern 3. Pre-defined slots blocked by any appointment, regardless of type.

You set the calculation method once per clinic based on how they’ve configured eCW, and the API handles the rest — capacity tracking, conflict detection, and all the edge cases. See the full availability endpoint documentation for request parameters and response shapes.

Try It Yourself

We built an interactive playground where you can test all three calculation methods against real eCW schedule configurations — tweak parameters, see exactly how each method interprets the same data, and build your integration with confidence. Sign up for Cobalt Ignite to get access.

Get access through Cobalt Ignite

Bryan is the founder of Cobalt (usecobalt.com), which provides unified API infrastructure for health tech companies. If you’re building on eClinicalWorks and want to skip the integration tax, check out Cobalt Ignite: $3,500 in credits toward the Growth plan, live in 24 hours.