eClinicalWorks integrationSetup guide

Connect eClinicalWorks

Connect MedScrub to eCW and get your patient data flowing in automatically. There are two sides to set up: ① in eClinicalWorks (your eCW admin, once) and ② in the MedScrub app (once). Do them in order — about 20 minutes total, then it runs on its own.

Read this first

MedScrub’s nightly sync pulls from a patient group you create in eCW — not from “all patients.” If you skip the group, the nightly sync imports zero records. The three eCW-side steps below are the part practices miss.

① In eClinicalWorks — your eCW admin

Register the app, create the group, enable it

1

Add and activate the MedScrub Connect app

In eCW, go to Admin → Product Activation → FHIR APIs → Bulk/Backend Apps. In the app gallery, search medscrub and open MedScrub Connect. Click Add, paste the App Activation Code MedScrub gives you, and click Activate.

After you add the code, the MedScrub team approves your practice on eCW’s developer portal — usually under one business day — and clicking Activate completes the handshake. You’ll get an email when it’s live; nothing below works until that approval lands.

Finding MedScrub Connect in the eClinicalWorks Bulk/Backend Apps
2

Create a patient group for the nightly sync

Go to Main Menu → Registry → Registry. Build a query that selects the patients MedScrub should see (by demographics and/or clinical conditions — for most practices a broad query like all active patients is right). Click Save Queries, then OK on the confirmation.

In the Save Registry Query Report dialog:

  • Enter a description in Report Criteria (this becomes the group label shared with MedScrub — e.g. “MedScrub — all active patients”).
  • ✅ Check “Save the query as a group to use with the backend/bulk access apps.” This is the critical box — without it there is no group to export.
  • Click OK.

eCW assigns an auto-generated Group ID — find it in the Manage Groups window and copy it. You’ll paste it into MedScrub in ②.

The eClinicalWorks Save Registry Query Report dialog with the backend/bulk access checkbox
3

Enable the group for MedScrub Connect

Go to Admin → Product Activation → FHIR APIs → Bulk/Backend Apps. On the MedScrub Connect tile, click Manage Groups, select your group under Available Groups, and move it to Enabled Groups with the right caret (). The group now exists, has patients, and is enabled for MedScrub.

② In the MedScrub desktop app

Connect, paste the Group ID, turn on Auto-sync

4

Create your Production environment

Open ConnectivityEHReCW and expand the Environments section. Search for your practice and select it — this creates your Production environment and fills in your practice-code FHIR URL automatically.

Design-partner practices (like Monarch) come pre-populated, so you may already see a Production environment — everyone else creates it here once.

The MedScrub desktop Connectivity → EHR → eCW Environments screen: the practice search and the Production environment with only a Practice FHIR URL field
5

Connect to Production

In the Connection area, pick Production from the environment dropdown (it reads “No environments configured” until step 4 is done), then click Connect and wait for the green Connected status. MedScrub handles the backend OAuth (client-credentials + an RS384-signed JWT); you don’t enter secrets. An invalid_client error means eCW hasn’t finished approving the app yet (step 1).

The MedScrub Connection panel: Environment set to Production, a green Connected status, and the eClinicalWorks FHIR Server details (R4, resources available)
6

Turn on automatic sync

On the same page, scroll to the CDR Sync section. Paste the Group ID from step 2 into the eCW Group FHIR ID field, then turn on the Auto-sync toggle. Click Sync Now to pull immediately (outside the nightly window this reads Queue for tonight), or just leave Auto-sync on and let the overnight window handle it.

The MedScrub CDR Sync panel: the eCW Group FHIR ID field, the Auto-sync toggle on, the keep-awake window note, and the Queue for tonight button
7

Confirm it worked

  • After the first sync, Patients in the sidebar shows a non-zero count.
  • The next morning, the Dashboard shows an overnight sync banner summarizing what came in.

When the nightly sync runs

eCW runs its nightly export around midnight Eastern. MedScrub’s nightly window is 22:00–03:00 ET, with catch-up if the machine was asleep during the window. The computer must be awake (or asleep, not shut down) during that window — MedScrub keeps it awake automatically, but the app must be running with Docker up. Don’t fully shut the machine down overnight if you want the morning data ready.

Troubleshooting

“Nightly export completed but imported no records” / Patients shows 0

The most common cause: the patient group is empty or not enabled for MedScrub. Recheck:

  • Step 2 — did the query match patients, and did you check the backend/bulk access box?
  • Step 3 — is the group in Enabled Groups on the MedScrub Connect tile?
  • Step 6 — is the eCW Group FHIR ID in MedScrub the same auto-generated ID from Manage Groups?

“Search patient failed / unauthorized” or “No valid token” right after enabling the group

Expected for a few minutes. After you enable a group in eCW (step 3), eCW takes a little time to propagate it before the sync token is authorized against it — so the first Sync Now immediately after enabling can fail with unauthorized, invalid token, or search patient failed. Wait a few minutes and click Sync Now again. If it’s still failing after ~15 minutes, recheck that the group is in Enabled Groups (step 3) and actually contains patients (step 2).

invalid_client when connecting

eCW hasn’t approved the app yet (step 1), or it’s a transient eCW-side hiccup. Wait for the approval email; if it persists, email cj@medscrub.dev with a screenshot of the activated app.

Nightly sync didn’t fire

Confirm Auto-sync is on and the machine wasn’t shut down overnight, and that Docker Desktop is running with MedScrub’s services healthy.

If a manual Sync Now works but the overnight run never fires, quit and reopen MedScrub once after enabling Auto-sync, then confirm the toggle is still on. Builds before v2.51.12 only started the nightly scheduler at launch, so enabling Auto-sync mid-session left it idle until the next restart. Make sure you’re on the latest version — the app updates itself automatically, and the version shows in the footer.

Stuck on any step?

Don’t struggle for more than ten minutes — we’ll get on a call and set up the group and sync with you.