Overview
The Payments module manages financial transactions in Nguhöe EHR. Payments are typically linked to consultations but can also be created independently. The module supports multiple payment methods and status tracking.Payment management is restricted to Admin and Receptionist roles. These users handle billing and financial record-keeping.
Payment Data Model
Core Fields
| Field | Type | Description |
|---|---|---|
patient_id | foreign key | Reference to patient |
consultation_id | foreign key (nullable) | Optional link to consultation |
amount | decimal(10,2) | Payment amount |
payment_method | string | Method of payment |
status | string | Payment status |
notes | text | Additional payment notes |
Payment Methods
- cash
- card
- transfer
Cash payment - most common for clinic visits
Payment Statuses
- paid
- pending
- cancelled
Payment has been received (default)
Creating Payments
During Consultation
Payments are typically created automatically when a consultation includes payment information:CreateConsultationAction handles automatic payment creation:
- Creates payment record linked to consultation
- Sets status to ‘paid’ by default
- Links to patient and consultation
Independent Payment Creation
Receptionists and admins can create payments independently through the payments interface: Route:payments.store → PaymentController@storeAction:
CreatePaymentActionEndpoint:
POST /payments
Payments don’t require a consultation link - useful for deposits, general charges, or administrative fees.
Viewing and Filtering Payments
Payments List
Access the complete payment history with search and filtering: Route:payments.index → PaymentController@indexEndpoint:
GET /payments
- Patient name (searchable)
- Consultation reference (if linked)
- Amount
- Payment method
- Status
- Date
- Notes
Payment Search
Search payments by patient name to quickly find specific transactions:Billing Workflows
Standard Consultation Payment
Walk-in Payment
Pending Payment Follow-up
Payment Notes
The notes field supports additional context:- Payment references
- Partial payment tracking
- Discounts or adjustments
- Special arrangements
- Receipt numbers
Relationships
The consultation relationship uses
nullable constraint, allowing payments without consultation links (database/migrations/*_payments_table.php:17).Access Control
Admin
Admin
- View all payments
- Create new payments
- Update payment status
- Search and filter payments
- Full financial access
Receptionist
Receptionist
- View all payments
- Create new payments
- Update payment status
- Search and filter payments
- Primary role for payment management
Doctor
Doctor
- Can add payment info during consultation creation
- Cannot access payments module directly
Patient
Patient
No access to payment management (view-only access may be implemented)
Database Schema
When a consultation is deleted, the payment remains but the
consultation_id is set to NULL (ON DELETE SET NULL).Common Scenarios
Standard Consultation Fee
Partial Payment
Administrative Fee
Pending Payment
Reporting and Analytics
Payment data supports financial reporting:- Daily/weekly/monthly revenue
- Payment method distribution
- Pending payments tracking
- Patient payment history
- Consultation revenue analysis
The reports module uses payment data for financial dashboards and analytics (routes/web.php:54).
Best Practices
Link to Consultations
Always link payments to consultations when applicable for tracking
Accurate Status
Update payment status promptly when pending payments are received
Clear Notes
Add meaningful notes for reference and audit purposes
Consistent Methods
Use standardized payment method codes for reporting