Skip to content

Commit

Permalink
Make it easier to read NHS numbers in the patient list
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarton committed Jan 11, 2025
1 parent 9f338a5 commit 92ca361
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion project/npda/templates/partials/patient_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
{% endif %}
</span>
<strong class="font-mono text-xs">
{{ patient.nhs_number }}
{{ patient.nhs_number|format_nhs_number }}
</span>
</a>
</td>
Expand Down
7 changes: 7 additions & 0 deletions project/npda/templatetags/npda_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,10 @@ def get_item(dictionary:dict, key:str):
@register.simple_tag
def docs_url():
return settings.DOCS_URL

@register.filter
def format_nhs_number(nhs_number):
if nhs_number and len(nhs_number) >= 10:
return f"{nhs_number[:3]} {nhs_number[3:6]} {nhs_number[6:]}"

return nhs_number

0 comments on commit 92ca361

Please sign in to comment.