Run one week
Input: the week of Nov 16–20, 2026 as staff would export it: visit rows, bank deposits and 5 daily close-out logs. Press the button to run the same steps the scheduled script runs.
Raw visit log (as exported)
1Billing summary
Visits grouped by payer, charges checked against the clinic's fee schedule, and anything that would get a claim rejected pulled out for review.
By payer
Needs review before billing
2Bookkeeping: deposits vs. what was billed
Bank deposits are matched to open claims by payer and amount. Unmatched deposits and claims older than 30 days are listed so nothing slips.
Deposit matching
Unpaid claims by age
3Daily logs
Each day's close-out log (visits seen, cash and card collected) is checked against the visit sheet and the card terminal total.
4Monday 7am email
How it runs in the clinic's Google account
- Staff keep using the same Excel/Sheets files in a shared Drive folder.
- A time-based trigger runs the script every Monday at 7am (and on demand from a custom menu).
- The script writes the results into a "Weekly Review" tab and emails the office manager.
- Rules (fee schedule, payers, alert thresholds) live in a "Settings" tab staff can edit without code.
- Acceptance test: run it on a past week the team already did by hand. Totals must match to the cent.
// Apps Script (excerpt): weekly trigger + duplicate check
function installWeeklyTrigger() {
ScriptApp.newTrigger('runWeeklyReview')
.timeBased().onWeekDay(ScriptApp.WeekDay.MONDAY)
.atHour(7).create();
}
function findDuplicates(rows) {
const seen = new Map(), dups = [];
rows.forEach(r => {
const key = [r.patientId, r.date, r.cpt].join('|');
if (seen.has(key)) dups.push(r); else seen.set(key, r);
});
return dups;
}
function runWeeklyReview() {
const ss = SpreadsheetApp.getActive();
const visits = readTable(ss.getSheetByName('Visits'));
const fees = readSettings(ss.getSheetByName('Settings'));
const issues = [...findDuplicates(visits),
...checkCodesAndFees(visits, fees)];
writeReview(ss, visits, issues);
MailApp.sendEmail(fees.managerEmail,
'Weekly billing review', buildSummary(visits, issues));
}