From 160b94573ddcc7a76c988dfc46b266470c6007f5 Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Sat, 23 Nov 2024 00:52:51 +0530 Subject: [PATCH] Show patient number in report --- librevax.py | 4 +++- templates/report.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/librevax.py b/librevax.py index a9ce250..ba2bf1c 100644 --- a/librevax.py +++ b/librevax.py @@ -832,13 +832,15 @@ def report(mid): (ok, center)=multicenter.read(cursor, g.mid) if(not ok): raise Exception(center) + individual=set() count={} for i in data: + individual.add(i["cid"]) try: count[i["vaccine"]]=count[i["vaccine"]]+i["dosage"] except KeyError: count[i["vaccine"]]=i["dosage"] - return render_template("report.html", data=data, count=count, center=center, date=date) + return render_template("report.html", data=data, count=count, individual=individual, center=center, date=date) except Exception as e: raise(e) return render_template("error.html", data=e) diff --git a/templates/report.html b/templates/report.html index df345b5..cb39fe7 100644 --- a/templates/report.html +++ b/templates/report.html @@ -53,6 +53,7 @@ You should have received a copy of the GNU General Public License along with Lib {% endfor %} +

Vaccine Candidates: {{ individual|length }}

Vaccine Administerd: {% for k,v in count.items() %}  {{k}} ({{v}}) -- 2.39.5