Dave opencare corefeat(appointments): Implement Appointment Scheduling API for Patient-Health Worker Bookings#66
Open
King24Dave wants to merge 7 commits intobos-com:pr-4-patient-records-apifrom
Conversation
Resolve merge conflicts across 4 files
Appointment Scheduling API bos-com#5
- Add Role enum and role field to User model - Implement RoleRequired permission class - Secure all API endpoints with role-based access - Add comprehensive RBAC tests - Document roles and permissions Closes bos-com#6
feat: Implement RBAC for issue
- Enhanced Appointment model with conflict detection methods - Full CRUD endpoints with RBAC (Admin/Provider roles) - Comprehensive conflict detection (provider, patient, facility) - Email and SMS notification hooks - Custom actions: upcoming, by-provider, by-patient, cancel, complete, no-show - Comprehensive test coverage - Complete API documentation Closes bos-com#5
…ling feat: Comprehensive Appointment Scheduling API for issue bos-com#5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Related Issue
Closes #7
📋 Summary
This PR implements a fully functional Appointment Scheduling API for
OpenCare-Africa. Patients can now book, reschedule, and cancel
appointments with health workers. The system enforces availability
checks, prevents double-booking, and triggers Celery-based reminder
notifications. All appointment actions are tracked in the AuditTrail.
🔧 Changes Made
New Files
apps/patients/models.py— Appointment model with status transitionsapps/api/serializers/appointment_serializer.py— Request/response serializersapps/api/views/appointment_views.py— Appointment viewsetsapps/api/tests/test_appointments.py— Unit and integration testsconfig/tasks/appointment_reminders.py— Celery reminder taskModified Files
apps/api/urls.py— registered/api/v1/appointments/routesconfig/urls.py— included appointment URLsconfig/celery.py— registered reminder taskapps/core/models.py— extended AuditTrail for appointmentsdocs/appointments.md— updated with final API usage and safeguards📅 Appointment Status Flow
🔐 Role Permission Table
🧪 How to Test
✅ Checklist
409 ConflictWorkScheduleAuditTrail/api/docs/docs/appointments.mdupdated