From 7486dcecdfbd47ef0b8006d549e33176c1a0b934 Mon Sep 17 00:00:00 2001
From: ABHISEK PANDA <117925314+abhisek2004@users.noreply.github.com>
Date: Sun, 1 Sep 2024 16:06:23 +0530
Subject: [PATCH 1/2] patient discharge form ok , super add hospital working
---
.../templates/Patient_discharge.html | 63 +++++++------------
.../templates/super_add_hospital.html | 38 +++++++----
2 files changed, 51 insertions(+), 50 deletions(-)
diff --git a/Government of NCT of Delhi/templates/Patient_discharge.html b/Government of NCT of Delhi/templates/Patient_discharge.html
index 7693840..66482c5 100644
--- a/Government of NCT of Delhi/templates/Patient_discharge.html
+++ b/Government of NCT of Delhi/templates/Patient_discharge.html
@@ -1,5 +1,6 @@
+
@@ -8,7 +9,6 @@
body {
font-family: Arial, sans-serif;
background-image: url("../static/images/Patient_Discharge.avif");
- /* Replace with your image URL */
background-size: cover;
background-position: center;
margin: 0;
@@ -31,7 +31,6 @@
margin: 30px auto;
padding: 20px;
background-color: rgba(255, 255, 255, 0.9);
- /* Semi-transparent white background */
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
@@ -45,7 +44,8 @@
input[type="text"],
input[type="date"],
- textarea {
+ textarea,
+ select {
width: 100%;
padding: 10px;
margin-bottom: 20px;
@@ -75,12 +75,26 @@
-
+
+
\ No newline at end of file
diff --git a/Government of NCT of Delhi/templates/super_add_hospital.html b/Government of NCT of Delhi/templates/super_add_hospital.html
index f9f1b42..7db2b97 100644
--- a/Government of NCT of Delhi/templates/super_add_hospital.html
+++ b/Government of NCT of Delhi/templates/super_add_hospital.html
@@ -128,22 +128,38 @@
-
Government of NCT of Delhi
-
-
-
From d729ac1b70487378c1411bb67b34d97d005ab726 Mon Sep 17 00:00:00 2001
From: debaraja-394
Date: Sun, 1 Sep 2024 16:07:04 +0530
Subject: [PATCH 2/2] discharge_details
---
Government of NCT of Delhi/app.py | 36 +++++++++++++++++--
.../templates/Patient_discharge.html | 1 -
2 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/Government of NCT of Delhi/app.py b/Government of NCT of Delhi/app.py
index 5b3eb91..6db7311 100644
--- a/Government of NCT of Delhi/app.py
+++ b/Government of NCT of Delhi/app.py
@@ -3,6 +3,16 @@
from pymongo import MongoClient
import jwt
from functools import wraps
+from reportlab.lib.pagesizes import A4
+from reportlab.lib import colors
+from reportlab.lib.units import inch
+from reportlab.lib.styles import getSampleStyleSheet
+from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, Table, TableStyle
+from reportlab.graphics.barcode.qr import QrCodeWidget
+from reportlab.graphics.shapes import Drawing
+from reportlab.graphics import renderPDF
+import qrcode
+import io
#test pull
app = Flask(__name__)
@@ -479,6 +489,8 @@ def superadmin_login():
# Check if the username and password match an entry in the admin_collection
if superadmin_collection.find_one({"username": username, "password": password}):
+ session['username']=username
+ session['role']='superadmin'
return redirect('/superadmin')
else:
return redirect('/superadmin_login')
@@ -487,7 +499,7 @@ def superadmin_login():
@app.route('/superadmin/addHospital', methods=['GET', 'POST'])
-
+@login_required('superadmin')
def add_hospital():
if request.method == 'POST':
hospital_name = request.form['hospitalName']
@@ -522,6 +534,7 @@ def add_hospital():
@app.route('/superadmin/checkHospitalStatus', methods=['GET', 'POST'])
+@login_required('superadmin')
def check_hospital():
if request.method == 'POST':
hospital_name = request.form.get('hname')
@@ -554,6 +567,7 @@ def submit_discharge():
follow_up_instructions = request.form.get('follow_up_instructions')
medications = request.form.get('medications')
contact_info = request.form.get('contact_info')
+ gender=request.form.get('gender')
data_discharge={
'patient_id': patient_id,
@@ -568,7 +582,21 @@ def submit_discharge():
'medications': medications,
'contact_info': contact_info
}
-
+ # Generate PDF with the provided details
+ pdf_buffer = io.BytesIO()
+ doc = SimpleDocTemplate(pdf_buffer, pagesize=A4)
+ styles = getSampleStyleSheet()
+ #Patient details inside the pdf
+ elements = []
+ elements.append(Paragraph("Patient ID Card", styles['Title']))
+ elements.append(Spacer(1, 12))
+ elements.append(Paragraph(f"Full Name: {patient_name}", styles['Normal']))
+ elements.append(Paragraph(f"Admission Date: {admission_date}", styles['Normal']))
+ elements.append(Paragraph(f"Gender: {gender}", styles['Normal']))
+ elements.append(Paragraph(f"Address: {address}", styles['Normal']))
+ elements.append(Paragraph(f"Phone Number: {contact_info}", styles['Normal']))
+ elements.append(Paragraph(f"Email: {email}", styles['Normal']))
+ elements.append(Paragraph(f"Discharge Summary: {discharge_summary}", styles['Normal']))
hospital_discharge_collection.insert_one(data_discharge)
return redirect('/admin')
return render_template('Patient_discharge.html')
@@ -585,6 +613,10 @@ def user_logout():
def admin_logout():
session.clear()
return redirect('/')
+@app.route('/superadmin_logout')
+def sueperadmin_logout():
+ session.clear()
+ return redirect('/')
if __name__ == '__main__':
diff --git a/Government of NCT of Delhi/templates/Patient_discharge.html b/Government of NCT of Delhi/templates/Patient_discharge.html
index 7693840..132de25 100644
--- a/Government of NCT of Delhi/templates/Patient_discharge.html
+++ b/Government of NCT of Delhi/templates/Patient_discharge.html
@@ -104,7 +104,6 @@ Hospital Discharge Details Form
cols="50"
required
>
-