Reports - Agent

AR Aging Report

Path/aged-receivables-report
Statustodo
Drill-down pages—
Pop-ups(+2 inline)
Tabs—
API routes/api/data/agent-aged-receivables
/api/data/offices
/api/reports/dental-day-production

Business rules

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

Database tables & columns

TableColumns used
dh_procedures_current viewada_code, amount, description, id, location_id, patient_id, provider_id, service_date, status
agent_daily_aged_receivablesbalance, before_30, before_60, before_90, date, guarantor_before_30, guarantor_before_60, guarantor_before_90, guarantor_over_90, guarantor_total, insurance_before_30, insurance_before_60, insurance_before_90, insurance_over_90, insurance_total, office_name, over_90, procedure_filter, total, unapplied_credits, writeoff_before_30, writeoff_before_60, writeoff_before_90, writeoff_over_90, writeoff_total
agent_unsent_claimscarrier_name, patient_id, service_date
bookingscalendar_id, date, dentrix_appointment_id, patient_id, status
calendarscalendar_name, city, dental_day_location, dentrix_office_id, short_code, state, status, street_address
dd_staff_assignmentscalendar_id, position, schedule_date, staff_id
dentrix_officesactive, dentrix_id, name
dh_appointments(columns not named in the SQL)
dh_claim_proceduresclaim_state, is_active, patient_portion, primary_insurance_portion, procedure_id, secondary_insurance_portion
dh_ledger_distributionsapplied_amount, charge_id, is_active, transaction_id
dh_ledger_transactionsis_active, ledger_type, patient_procedure_id, transaction_id
dh_patient_proceduresread through the view dh_procedures_current
dh_patientsdentrix_id, insurance_eligible, is_active
dh_providers(columns not named in the SQL)
patientsid, insurance_encrypted
schedulescalendar_id, date, id
staffcity, first_name, id, last_name, state, status

File structure

Its own files

  • apps/
    • web/
      • src/
        • pages/
          • AgedReceivablesReport.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/
            • DentalDayArPanel.tsx
            • DentrixSourceNote.tsx
            • HowItWorksNote.tsx
        • hooks/
          • useApi.ts
        • lib/
          • office.ts
        • services/
          • api.ts
    • worker/
      • src/
        • db/
          • index.ts
        • routes/
          • data.ts
          • reports.ts
        • services/
          • dental-day-production.ts
          • phi-read.ts
        • utils/
          • crypto.ts
          • office.ts
          • phi-access.ts
          • phi-crypto.ts
          • timestamps.ts