diff --git a/CLINICAL_SIGNING_COMPLETE.md b/CLINICAL_SIGNING_COMPLETE.md new file mode 100644 index 00000000..2c77e361 --- /dev/null +++ b/CLINICAL_SIGNING_COMPLETE.md @@ -0,0 +1,429 @@ +# Clinical Document Signing - Implementation Complete + +## ✅ BACKEND IMPLEMENTATION - 100% COMPLETE + +All backend code (views and URLs) has been successfully implemented across all modules. + +### Summary of Completed Work + +#### 1. ABA Module - ✅ FULLY COMPLETE +**Models:** ABASession, ABAConsult (2 models) +- ✅ Views: Sign views added +- ✅ URLs: Sign routes added +- ✅ Templates: ALL updated (session_detail, session_list, session_list_partial) + +#### 2. OT Module - ✅ FULLY COMPLETE +**Models:** OTSession, OTConsult (2 models) +- ✅ Views: Sign views added +- ✅ URLs: Sign routes added +- ✅ Templates: ALL updated (6 templates) + +#### 3. SLP Module - ✅ BACKEND COMPLETE +**Models:** SLPConsult, SLPAssessment, SLPIntervention, SLPProgressReport (4 models) +- ✅ Views: 4 sign views added (`SLPConsultSignView`, `SLPAssessmentSignView`, `SLPInterventionSignView`, `SLPProgressReportSignView`) +- ✅ URLs: 4 sign routes added +- ✅ List views: All 4 updated with unsigned counts +- ⏳ Templates: Need updates (16 files - see below) + +#### 4. Medical Module - ✅ BACKEND COMPLETE +**Models:** MedicalConsultation, MedicalFollowUp (2 models) +- ✅ Views: 2 sign views added (`MedicalConsultationSignView`, `MedicalFollowUpSignView`) +- ✅ URLs: 2 sign routes added +- ✅ List views: Both updated with unsigned counts +- ⏳ Templates: Need updates (8 files - see below) + +#### 5. Nursing Module - ✅ BACKEND COMPLETE +**Models:** NursingEncounter (1 model) +- ✅ Views: Sign view added (`NursingEncounterSignView`) +- ✅ URLs: Sign route added +- ✅ List view: Updated with unsigned counts +- ⏳ Templates: Need updates (4 files - see below) + +--- + +## 📋 REMAINING WORK: TEMPLATE UPDATES + +### Templates That Need Updates + +All templates need the same 2 types of updates demonstrated in ABA/OT modules: + +1. **Detail Templates** - Add signature status card +2. **List Templates** - Add unsigned notification banner +3. **List Partial Templates** - Add signature status column + +### SLP Module Templates (16 files) + +#### Consultation Templates +1. **`slp/templates/slp/consultation_detail.html`** + - Add signature status card (copy from `aba/templates/aba/session_detail.html`) + - Update URL: `{% url 'slp:consult_sign' consultation.pk %}` + - Object name: `consultation` + +2. **`slp/templates/slp/consultation_list.html`** + - Add unsigned notification banner before search filters + - Use context: `unsigned_count`, `unsigned_items` + - Link to: `{% url 'slp:consult_detail' item.pk %}` + +3. **`slp/templates/slp/partials/consultation_list_partial.html`** + - Add "Signature" column header + - Add signature badge in table row + - Check: `consultation.signed_by` + +#### Assessment Templates +4. **`slp/templates/slp/assessment_detail.html`** + - Add signature status card + - URL: `{% url 'slp:assessment_sign' assessment.pk %}` + - Object: `assessment` + +5. **`slp/templates/slp/assessment_list.html`** + - Add unsigned notification banner + - Context: `unsigned_count`, `unsigned_items` + +6. **`slp/templates/slp/partials/assessment_list_partial.html`** + - Add signature column + - Badge for `assessment.signed_by` + +#### Intervention Templates +7. **`slp/templates/slp/intervention_detail.html`** + - Add signature status card + - URL: `{% url 'slp:intervention_sign' intervention.pk %}` + - Object: `intervention` + +8. **`slp/templates/slp/intervention_list.html`** + - Add unsigned notification banner + +9. **`slp/templates/slp/partials/intervention_list_partial.html`** + - Add signature column + +#### Progress Report Templates +10. **`slp/templates/slp/progress_detail.html`** + - Add signature status card + - URL: `{% url 'slp:progress_report_sign' report.pk %}` + - Object: `report` + +11. **`slp/templates/slp/progress_list.html`** + - Add unsigned notification banner + +12. **`slp/templates/slp/partials/progress_list_partial.html`** + - Add signature column + +### Medical Module Templates (8 files) + +#### Consultation Templates +1. **`medical/templates/medical/consultation_detail.html`** + - Add signature status card + - URL: `{% url 'medical:consultation_sign' consultation.pk %}` + +2. **`medical/templates/medical/consultation_list.html`** + - Add unsigned notification banner + +3. **`medical/templates/medical/partials/consultation_list_partial.html`** + - Add signature column + +#### Follow-up Templates +4. **`medical/templates/medical/followup_detail.html`** + - Add signature status card + - URL: `{% url 'medical:followup_sign' followup.pk %}` + +5. **`medical/templates/medical/followup_list.html`** + - Add unsigned notification banner + +6. **`medical/templates/medical/partials/followup_list_partial.html`** + - Add signature column + +### Nursing Module Templates (4 files) + +1. **`nursing/templates/nursing/encounter_detail.html`** + - Add signature status card + - URL: `{% url 'nursing:encounter_sign' encounter.pk %}` + - Note: Check field is `filled_by` not `provider` + +2. **`nursing/templates/nursing/encounter_list.html`** + - Add unsigned notification banner + +3. **`nursing/templates/nursing/partials/encounter_list_partial.html`** + - Add signature column + +--- + +## 📝 Template Update Pattern + +### Pattern 1: Signature Status Card (Detail Templates) + +```django + +
+ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ OBJECT.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ OBJECT.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the provider or an administrator can sign this document" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned document that requires your signature. + {% plural %} + You have {{ counter }} unsigned documents that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned documents:" %}
+- {% trans "Not signed" %} +
+ {% trans "Only the session provider or an administrator can sign this session" %}
{% endif %} + {% endif %}+ {% blocktrans count counter=unsigned_sessions_count %} + You have {{ counter }} unsigned session that requires your signature. + {% plural %} + You have {{ counter }} unsigned sessions that require your signature. + {% endblocktrans %} +
+ {% if unsigned_sessions %} +{% trans "Recent unsigned sessions:" %}
+{% trans "No sessions found" %}
+ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ consultation.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ consultation.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the consultation provider or an administrator can sign this consultation" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned consultation that requires your signature. + {% plural %} + You have {{ counter }} unsigned consultations that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned consultations:" %}
++ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ followup.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ followup.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the follow-up provider or an administrator can sign this follow-up" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned follow-up that requires your signature. + {% plural %} + You have {{ counter }} unsigned follow-ups that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned follow-ups:" %}
++ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ encounter.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ encounter.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the nurse who filled this encounter or an administrator can sign it" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned encounter that requires your signature. + {% plural %} + You have {{ counter }} unsigned encounters that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned encounters:" %}
++ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ consult.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ consult.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the consultation provider or an administrator can sign this consultation" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned consultation that requires your signature. + {% plural %} + You have {{ counter }} unsigned consultations that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned consultations:" %}
++ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ session.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ session.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the session provider or an administrator can sign this session" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned session that requires your signature. + {% plural %} + You have {{ counter }} unsigned sessions that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned sessions:" %}
+| {% trans "Session Date" %} | +{% trans "Patient" %} | +{% trans "Skill Name" %} | +{% trans "Score" %} | +{% trans "Provider" %} | +{% trans "Actions" %} | +
|---|---|---|---|---|---|
| {{ skill.session.session_date|date:"M d, Y" }} | +
+
+ {% patient_name skill.session.patient %}
+
+ + {{ skill.session.patient.mrn }} + |
+ + {{ skill.skill_name }} + | ++ + {{ skill.score }}/10 + + | +{{ skill.session.provider.get_full_name }} | ++ + {% trans "View Session" %} + + | +
{% trans "Target skills are tracked within OT sessions" %}
+ + {% trans "View Sessions" %} + ++ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ assessment.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ assessment.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the assessment provider or an administrator can sign this assessment" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned assessment that requires your signature. + {% plural %} + You have {{ counter }} unsigned assessments that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned assessments:" %}
++ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ consultation.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ consultation.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the consultation provider or an administrator can sign this consultation" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned consultation that requires your signature. + {% plural %} + You have {{ counter }} unsigned consultations that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned consultations:" %}
++ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ intervention.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ intervention.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the intervention provider or an administrator can sign this intervention" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned intervention that requires your signature. + {% plural %} + You have {{ counter }} unsigned interventions that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned interventions:" %}
++ {% trans "Signed" %} +
+
+ {% trans "Signed by" %}: {{ report.signed_by.get_full_name }}
+ {% trans "Signed at" %}: {{ report.signed_at|date:"Y-m-d H:i" }}
+
+ {% trans "Only the report provider or an administrator can sign this progress report" %} +
+ {% endif %} + {% endif %} ++ {% blocktrans count counter=unsigned_count %} + You have {{ counter }} unsigned progress report that requires your signature. + {% plural %} + You have {{ counter }} unsigned progress reports that require your signature. + {% endblocktrans %} +
+ {% if unsigned_items %} +{% trans "Recent unsigned progress reports:" %}
+