2.5 KiB
2.5 KiB
Signing Edit Prevention Implementation Plan
Overview
Implement edit prevention after signing for all clinical documents across all apps.
Apps with Signing Functionality
- ABA - ABASession, ABAConsult (2 models)
- OT - OTSession, OTConsult (2 models)
- SLP - SLPConsult, SLPAssessment, SLPIntervention, SLPProgressReport (4 models)
- Medical - MedicalConsultation, MedicalFollowUp (2 models)
- Nursing - NursingEncounter (1 model)
Total: 11 models
Implementation Strategy
1. Create Mixin for Edit Prevention
Create SignedDocumentEditPreventionMixin in core/mixins.py that:
- Checks if document is signed in
dispatch()method - Prevents access to update views for signed documents
- Shows appropriate error message
- Redirects to detail view
2. Update All UpdateView Classes
Add the mixin to all 11 update views:
ABASessionUpdateViewABAConsultUpdateViewOTSessionUpdateViewOTConsultUpdateViewSLPConsultUpdateViewSLPAssessmentUpdateViewSLPInterventionUpdateViewSLPProgressReportUpdateViewMedicalConsultationUpdateViewMedicalFollowUpUpdateViewNursingEncounterUpdateView
3. Update Confirmation Messages
Update all sign view confirmation messages to include: "Are you sure you want to sign this document? Once signed, no further editing will be allowed. This action cannot be undone."
4. Update Templates
Update detail templates to:
- Hide "Edit" button if document is signed
- Show "Signed - No Editing Allowed" message
Files to Modify
Python Files (12 files)
core/mixins.py- Add new mixinaba/views.py- Update 2 viewsot/views.py- Update 2 viewsslp/views.py- Update 4 viewsmedical/views.py- Update 2 viewsnursing/views.py- Update 1 view
Template Files (11 files)
aba/templates/aba/session_detail.htmlaba/templates/aba/consult_detail.htmlot/templates/ot/session_detail.htmlot/templates/ot/consult_detail.htmlslp/templates/slp/consultation_detail.htmlslp/templates/slp/assessment_detail.htmlslp/templates/slp/intervention_detail.htmlslp/templates/slp/progress_detail.htmlmedical/templates/medical/consultation_detail.htmlmedical/templates/medical/followup_detail.htmlnursing/templates/nursing/encounter_detail.html
Implementation Steps
- ✅ Create mixin in core/mixins.py
- ✅ Update all UpdateView classes
- ✅ Update all sign view confirmation messages
- ✅ Update all detail templates
- ✅ Test implementation