eClinicalWorks integrationSetup guide

eClinicalWorks nightly patient sync

Get MedScrub pulling your patient data automatically every night. 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 uses eCW’s backend bulk export (Group/$export), which 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

Activate the MedScrub Connect app

In eCW, open the App gallery / App Management and search medscrub. Open the MedScrub Connect card and activate it (paste the activation code MedScrub gives you). After you activate, the MedScrub team approves your practice in eCW’s developer portal — usually under one business day. You’ll get an email when it’s live; nothing below works until that approval lands.

Searching for MedScrub Connect in the eClinicalWorks app gallery
2

Create a patient group for bulk access

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

Connect to Production

Open IntegrationsEHReCW. Under Production, search and select your practice, then click Connect to Production 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).

5

Turn on nightly 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 (recommended for the first run), or leave Auto-sync on and let tonight’s window handle it.

6

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 dispatches its bulk 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 5 — is the eCW Group FHIR ID in MedScrub the same auto-generated ID from Manage Groups?

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.

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.