fix: ETL Slack notifications always show 'SimplePractice' regardless of actual data source
Resolved 💬 2 comments Opened Mar 24, 2026 by hrsaev Closed Mar 27, 2026
Summary
The ETL Sync Slack alert notifications hardcode "SimplePractice" as the data source for all EHR syncs. When triggering a TherapyNotes (or future TheraNest) sync, the notification still says:
Data source: SimplePractice
Root Cause
services/practice_etl_service/integrations/slack.py line 130:
def _format_data_source(request_type: str | None) -> str:
if request_type == "regenerate":
return "Synthetic"
if request_type == "generate_day":
return "Synthetic (incremental)"
return "SimplePractice" # <-- hardcoded fallback
The request_type for all EHR syncs is "sync" regardless of the source (SP, TN, TheraNest), so it always hits the default.
Fix
- Add a
data_sourceparameter to_format_data_source()with a label map:
``python``
{"simplepractice": "SimplePractice", "therapynotes": "TherapyNotes", "theranest": "TheraNest"}
- Add
data_sourcekwarg to allnotify_*methods inETLSlackNotifier - Pass
data_sourcethroughsync_ctxin_validate_and_mark_running()(transform_task.py) — look up fromOrganizationConnection.source_type - Pass
data_sourceinsync_task.pynotification calls — detect viaSyncOrchestrator._detect_data_source()
Affected notifications
notify_sync_startednotify_sync_completednotify_extraction_failednotify_transform_failed
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗