Skip to content

Commit

Permalink
feat: add list of uploaded files to discharge summary (#1544)
Browse files Browse the repository at this point in the history
Signed-off-by: Aakash Singh <[email protected]>
  • Loading branch information
sainak authored Aug 24, 2023
1 parent 20a575d commit 9519d70
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
7 changes: 7 additions & 0 deletions care/facility/utils/reports/discharge_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -96,6 +102,7 @@ def get_discharge_summary_data(consultation: PatientConsultation):
"dailyrounds": daily_rounds,
"medical_history": medical_history,
"investigations": investigations,
"files": files,
}


Expand Down
40 changes: 40 additions & 0 deletions care/templates/reports/patient_discharge_summary_pdf.html
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,46 @@ <h4 class="mt-6 font-medium text-gray-500">
</p>
</div>

{% if files %}
<div class="mt-6 px-4 py-5 border-b border-t border-gray-200">
<h3 class="text-lg leading-6 font-medium text-gray-900">
Annexes
</h3>
</div>
<div class="px-4 py-5">
<h4 class="font-medium text-gray-500">
Uploaded Files:
</h4>
<div class="">
<table class="min-w-full">
<thead>
<tr
class="border-b border-gray-200 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">
<th class="p-2">
Uploaded at
</th>
<th class="p-2">
Name
</th>
</tr>
</thead>
<tbody>
{% for file in files %}
<tr class="bg-white border-b">
<td class="p-1 whitespace-normal text-sm">
{{file.modified_date}}
</td>
<td class="p-1 whitespace-no-wrap text-sm">
{{file.name}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}

<div class="m-4 mb-12">
<div class="text-sm leading-5 font-bold text-gray-500">
Verified By
Expand Down

0 comments on commit 9519d70

Please sign in to comment.