Skip to content

Commit

Permalink
Added deceased filter in patients listing
Browse files Browse the repository at this point in the history
  • Loading branch information
xispa committed Nov 14, 2023
1 parent adb71ed commit e3e80d2
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/senaite/patient/browser/patientfolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def __init__(self, context, request):
"title": _("Inactive"),
"contentFilter": {'is_active': False},
"columns": self.columns.keys(),
}, {
"id": "deceased",
"title": _("Deceased"),
"contentFilter": {'patient_deceased': True},
"columns": self.columns.keys(),
}, {
"id": "all",
"title": _("All"),
Expand Down Expand Up @@ -170,11 +175,16 @@ def folderitem(self, obj, item, index):
self.get_identifier_tags(identifiers))

# Fullname
fullname = obj.getFullname()
if fullname:
fullname = api.safe_unicode(fullname).encode("utf8")
item["fullname"] = fullname
item["replace"]["fullname"] = get_link(url, value=fullname)
fullname_nd = t(_sp("fullname_not_defined", default="Not defined"))
fullname = obj.getFullname() or fullname_nd
fullname = api.safe_unicode(fullname).encode("utf8")

# Death dagger
if obj.getDeceased():
fullname = "{} <sup>&dagger;</sup>".format(fullname)

item["fullname"] = fullname
item["replace"]["fullname"] = get_link(url, value=fullname)

# Email
email = obj.getEmail()
Expand Down

0 comments on commit e3e80d2

Please sign in to comment.