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

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:
eCW assigns an auto-generated Group ID — find it in the Manage Groups window and copy it. You’ll paste it into MedScrub in ②.

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
Open Integrations → EHR → eCW. 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).
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.
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.
The most common cause: the patient group is empty or not enabled for MedScrub. Recheck:
invalid_client when connectingeCW 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.
Confirm Auto-sync is on and the machine wasn’t shut down overnight, and that Docker Desktop is running with MedScrub’s services healthy.