From: Agnibho Mondal Date: Fri, 22 Nov 2024 19:22:51 +0000 (+0530) Subject: Show patient number in report X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=160b94573ddcc7a76c988dfc46b266470c6007f5;p=librevax.git Show patient number in report --- 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}})