Reports - Marketing
Referred By Patients
| Path | /referral-patients |
|---|---|
| Status | todo |
| 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
| Table | Columns used |
|---|---|
dh_procedures_current view | (columns not named in the SQL) |
agent_referred_by_patients | ascend_patient_id, office_name, referred_by, referred_by_encrypted |
dentrix_offices | app, dentrix_id, name |
dh_ledger_transactions | amount, is_active, ledger_type, location_id, org_ledger_type_id, patient_id, transaction_date |
dh_next_appointments | next_date, patient_id |
dh_patient_balances | balance, patient_id |
dh_patient_procedures | read through the view dh_procedures_current |
dh_patient_referrals | patient_id, referral_name, referral_name_encrypted |
dh_patients | dentrix_id, email, first_name, last_name, phone |
website_inquiries | email, email_encrypted, source |
File structure
Its own files
- apps/
- web/
- src/
- pages/
- ReferralPatients.tsx
- pages/
- src/
- web/
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
- reports/
- hooks/
- useApi.ts
- lib/
- dentrix.ts
- office.ts
- services/
- api.ts
- components/
- src/
- worker/
- src/
- routes/
- data.ts
- services/
- phi-read.ts
- utils/
- crypto.ts
- office.ts
- phi-access.ts
- phi-crypto.ts
- routes/
- src/
- web/