Reports - Marketing

Referred By Patients

Path/referral-patients
Statustodo
Drill-down pages—
Pop-ups(+2 inline)
Tabs—
API routes/api/data/offices
/api/data/referral-patients

Business rules

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

Database tables & columns

TableColumns used
dh_procedures_current view(columns not named in the SQL)
agent_referred_by_patientsascend_patient_id, office_name, referred_by, referred_by_encrypted
dentrix_officesapp, dentrix_id, name
dh_ledger_transactionsamount, is_active, ledger_type, location_id, org_ledger_type_id, patient_id, transaction_date
dh_next_appointmentsnext_date, patient_id
dh_patient_balancesbalance, patient_id
dh_patient_proceduresread through the view dh_procedures_current
dh_patient_referralspatient_id, referral_name, referral_name_encrypted
dh_patientsdentrix_id, email, first_name, last_name, phone
website_inquiriesemail, email_encrypted, source

File structure

Its own files

  • apps/
    • web/
      • src/
        • pages/
          • ReferralPatients.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/
            • date-range.tsx
            • DentrixSourceNote.tsx
            • HowItWorksNote.tsx
            • sortable-grid.tsx
            • TableLoading.tsx
        • hooks/
          • useApi.ts
        • lib/
          • dentrix.ts
          • office.ts
        • services/
          • api.ts
    • worker/
      • src/
        • routes/
          • data.ts
        • services/
          • phi-read.ts
        • utils/
          • crypto.ts
          • office.ts
          • phi-access.ts
          • phi-crypto.ts