Accounts Receivable

Payments

Path/payments
Statustodo
Drill-down pages—
Pop-ups(+2 inline)
Tabs—
API routes/api/payment-requests
/api/payment-requests/:x/cancel
/api/payment-requests/offices
/api/payment-requests/patients
/api/payment-requests/patients/:x/items

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, service_date, status
dentrix_officesdentrix_id, name
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_patientschart_number, date_of_birth, dentrix_id, email, email_encrypted, first_name, id, last_name, phone
email_sendsapp, error, lang, provider, recipients, ref, sent_by, status, subject, subject_encrypted, template_key, to_email, to_email_encrypted, to_email_hash
email_templatesactive, bcc_emails, body_en, body_es, from_email, key, reply_to, subject_en, subject_es, to_emails
payment_requestsamount_cents, cancelled_at, cancelled_by, channels, created_at, created_by, emailed_at, expires_at, id, items, note, office_dentrix_id, paid_amount_cents, paid_at, patient_id, sent_to_email, sent_to_phone, status, stripe_payment_intent_id, token_hash

File structure

Its own files

  • apps/
    • web/
      • src/
        • pages/
          • Payments.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/
        • db/
          • index.ts
        • routes/
          • payment-requests.ts
        • services/
          • email-templates.ts
        • utils/
          • crypto.ts
          • email.ts
          • office.ts
          • phi-access.ts
          • phi-crypto.ts