Skip to content

Commit

Permalink
Fix discharge summary filters (#2210)
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak authored Jun 1, 2024
1 parent 51235a9 commit 59c05b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion care/facility/templatetags/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def suggestion_string(suggestion_code: str):

@register.filter()
def field_name_to_label(value):
return value.replace("_", " ").capitalize()
if value:
return value.replace("_", " ").capitalize()


@register.filter(expects_localtime=True)
Expand Down
2 changes: 1 addition & 1 deletion care/templates/reports/patient_discharge_summary_pdf.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h3 class="text-lg text-gray-900">
<span class="text-sm text-gray-500">Address:</span> {{patient.address}}
</p>
<p class="flex-grow">
<span class="text-sm text-gray-500">Ration Card Category:</span> {{patient.get_ration_card_category_display|field_name_to_label}}
<span class="text-sm text-gray-500">Ration Card Category:</span> {{patient.get_ration_card_category_display}}
</p>
</div>
</div>
Expand Down

0 comments on commit 59c05b9

Please sign in to comment.