Reports - Marketing

Klaviyo Report

Path/klaviyo-report
Statustodo
Drill-down pages—
Pop-ups(+2 inline)
Tabs—
API routes/api/reports/klaviyo

Business rules

Written when this page is worked on (docs/BUSINESS-RULES.md).

Database tables & columns

TableColumns used
dh_procedures_current viewada_code, category, patient_id, status
bookingsapp, patient_id
dentrix_officesdentrix_id, display_name, name
dh_appointmentspatient_id, start_time, status
dh_dcode_categoriesada_code, ada_code_range_end, ada_code_range_start, category
dh_patient_proceduresread through the view dh_procedures_current
dh_patientsdentrix_id, email, email_hash, first_name, id, insurance_eligible, last_name, patient_status, phone, preferred_location_id, primary_source
patientsdentrix_patient_id, id

File structure

Its own files

  • apps/
    • web/
      • src/
        • pages/
          • KlaviyoReport.tsx

Shared code it uses (followed through its imports and the helpers its API calls; sign-in/access plumbing and UI primitives left out)

  • apps/
    • web/
      • src/
        • components/
          • reports/
            • DentrixSourceNote.tsx
            • HowItWorksNote.tsx
            • ReportHeader.tsx
          • LastSynced.tsx
          • TablePagination.tsx
        • hooks/
          • useApi.ts
    • worker/
      • src/
        • db/
          • index.ts
        • routes/
          • reports.ts
        • services/
          • phi-read-dh.ts
          • phi-read.ts
        • utils/
          • crypto.ts
          • phi-access.ts
          • phi-crypto.ts