Dashboard

Dashboard - Dental Days

Path/
Statuslive
Drill-down pages—
Pop-ups—
Tabs—
API routes/api/dashboard/dental-days-by-month
/api/dashboard/patients-by-month
/api/dashboard/patients-by-office-month
/api/dashboard/stats
/api/data/offices

What's on the page

  • Cards (all time): Dental Day Calendars, Dental Day Appointments, Total Office Locations, Patients Booked, Total Patients Treated, Total Patients Scheduled. Each has a tooltip with its rule.
  • Charts (this year, by month): Dental Days MoM, DD Patients MoM, Office MoM.
  • Links: none (the KPI button was removed 26 Nov).
  • No filters; the page opens for logins with the dashboard access.

Business rules

Data comes from: HubSpot (Dental Day calendars and their dates) and the booking app (patients booked). No Dentrix data.

How the numbers are worked out:

  • Dental Day Calendars: every calendar ever created, any status.
  • Dental Day Appointments: calendars that are approved (coming up) or complete (done).
  • Total Office Locations: offices in the office list that are not turned off.
  • Patients Booked: bookings on approved or complete Dental Days. Cancelled, removed, broken and no-show bookings are not counted.
  • Total Patients Treated: the same bookings, on complete Dental Days only.
  • Total Patients Scheduled: the same bookings, on approved (upcoming) Dental Days only.
  • Dental Days MoM: Dental Days per month this year, completed vs approved. The Completed total adds 45 Dental Days held before Pulse existed.
  • DD Patients MoM: patients per month this year, treated vs scheduled.
  • Office MoM: patients per office per month this year (by office id; the name is only the label).

Open questions (need your answer)

Open questions: should the +45 be added every year, or only to an all-time total?

Database tables & columns

TableColumns used
bookingsapp, calendar_id, date, status
calendarsdentrix_office_id, short_code, status
dentrix_officesdentrix_id, name
schedulescalendar_id, date, id

File structure

Its own files

  • apps/
    • web/
      • src/
        • features/
          • dashboard/
            • components/
              • Charts.tsx
              • MonthLineChart.tsx
            • pages/
              • DashboardPage.tsx
            • api.ts
            • hooks.ts
            • index.ts
    • worker/
      • src/
        • features/
          • dashboard/
            • __tests__/
              • service.test.ts
            • index.ts
            • queries.ts
            • routes.ts
            • service.ts

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/
          • dashboard/
            • MetricCard.tsx
        • hooks/
          • useApi.ts
        • services/
          • api.ts
    • worker/
      • src/
        • routes/
          • data.ts
        • utils/
          • booking-status.ts
          • office.ts