Reports - Marketing

CallRail Leads

Path/callrail-leads
Statustodo
Drill-down pages—
Pop-ups(+2 inline)
Tabs—
API routes/api/callrail/calls

Business rules

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

Database tables & columns

TableColumns used
dh_procedures_current viewamount, patient_id, service_date, status
callrail_callsanswered, archived_at, archived_by, campaign, customer_city, customer_name, customer_phone, customer_phone_hash, customer_state, direction, duration_seconds, first_call, gclid, id, keywords, lead_notes, lead_notes_by, lead_status, lead_status_at, lead_status_by, medium, recording_url, source, source_name, started_at, tags, tracking_label, tracking_phone, utm_source
dh_patient_proceduresread through the view dh_procedures_current
dh_patientsdentrix_id, phone_hash
website_inquiriescreated_at, email, id, phone, source

File structure

Its own files

  • apps/
    • web/
      • src/
        • pages/
          • CallRailLeads.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
        • hooks/
          • useApi.ts
        • services/
          • api.ts
    • worker/
      • src/
        • routes/
          • callrail.ts
        • services/
          • phi-read-contacts.ts
          • phi-read.ts
        • utils/
          • crypto.ts
          • phi-access.ts
          • phi-crypto.ts