From 673f28dabc5c42130478c2a5fa7d5a176f8b6641 Mon Sep 17 00:00:00 2001
From: Aakash Singh
Date: Tue, 22 Aug 2023 16:58:20 +0530
Subject: [PATCH] feat: add list of uploaded files to discharge summary
Signed-off-by: Aakash Singh
---
.../utils/reports/discharge_summary.py | 7 ++++
.../patient_discharge_summary_pdf.html | 40 +++++++++++++++++++
2 files changed, 47 insertions(+)
diff --git a/care/facility/utils/reports/discharge_summary.py b/care/facility/utils/reports/discharge_summary.py
index 6177ab6ef5..bf5f2ed27d 100644
--- a/care/facility/utils/reports/discharge_summary.py
+++ b/care/facility/utils/reports/discharge_summary.py
@@ -81,6 +81,12 @@ def get_discharge_summary_data(consultation: PatientConsultation):
prescription_type=PrescriptionType.DISCHARGE.value,
is_prn=True,
)
+ files = FileUpload.objects.filter(
+ associating_id=consultation.id,
+ file_type=FileUpload.FileType.CONSULTATION.value,
+ upload_completed=True,
+ is_archived=False,
+ )
return {
"patient": consultation.patient,
@@ -96,6 +102,7 @@ def get_discharge_summary_data(consultation: PatientConsultation):
"dailyrounds": daily_rounds,
"medical_history": medical_history,
"investigations": investigations,
+ "files": files,
}
diff --git a/care/templates/reports/patient_discharge_summary_pdf.html b/care/templates/reports/patient_discharge_summary_pdf.html
index 7866a23bb4..c0c422166b 100644
--- a/care/templates/reports/patient_discharge_summary_pdf.html
+++ b/care/templates/reports/patient_discharge_summary_pdf.html
@@ -861,6 +861,46 @@
+ {% if files %}
+
+
+ Annexes
+
+
+
+
+ Uploaded Files:
+
+
+
+
+
+
+ Uploaded at
+ |
+
+ Name
+ |
+
+
+
+ {% for file in files %}
+
+
+ {{file.modified_date}}
+ |
+
+ {{file.name}}
+ |
+
+ {% endfor %}
+
+
+
+
+ {% endif %}
+