Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add list of uploaded files to discharge summary #1544

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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