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

  1. Add a data_source parameter to _format_data_source() with a label map:

``python
{"simplepractice": "SimplePractice", "therapynotes": "TherapyNotes", "theranest": "TheraNest"}
``

  1. Add data_source kwarg to all notify_* methods in ETLSlackNotifier
  2. Pass data_source through sync_ctx in _validate_and_mark_running() (transform_task.py) — look up from OrganizationConnection.source_type
  3. Pass data_source in sync_task.py notification calls — detect via SyncOrchestrator._detect_data_source()

Affected notifications

  • notify_sync_started
  • notify_sync_completed
  • notify_extraction_failed
  • notify_transform_failed

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗