pranit144 commited on
Commit
cfac17f
·
verified ·
1 Parent(s): 7dca851

Upload 4 files

Browse files
Files changed (4) hide show
  1. app.py +213 -0
  2. requirements.txt +3 -0
  3. templates/doctor_dashboard.html +137 -0
  4. templates/index.html +272 -0
app.py ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, render_template, request, jsonify, session, redirect
2
+ import google.generativeai as genai
3
+ import PyPDF2
4
+ import os
5
+ import re
6
+ from datetime import datetime
7
+
8
+ app = Flask(__name__)
9
+ app.config['UPLOAD_FOLDER'] = 'uploads'
10
+ app.secret_key = '688ed745a74bdd7ac238f5b50f4104fb87d6774b8b0a4e06e7e18ac5ed0fa31c' # Add this for session management
11
+ os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
12
+
13
+ # Gemini API Configuration
14
+ genai.configure(api_key="AIzaSyA3joMQMnael_heUCwpNvoRznCUiU3avf4")
15
+
16
+ generation_config = {
17
+ "temperature": 1,
18
+ "top_p": 0.95,
19
+ "top_k": 40,
20
+ "max_output_tokens": 8192,
21
+ }
22
+
23
+ model = genai.GenerativeModel(
24
+ model_name="gemini-2.0-flash-exp",
25
+ generation_config=generation_config,
26
+ )
27
+
28
+
29
+ def extract_text_from_pdf(pdf_file):
30
+ try:
31
+ pdf_reader = PyPDF2.PdfReader(pdf_file)
32
+ text = ""
33
+ for page in pdf_reader.pages:
34
+ text += page.extract_text()
35
+ return text.strip()
36
+ except Exception as e:
37
+ print(f"Error extracting PDF text: {e}")
38
+ return ""
39
+
40
+
41
+ def extract_care_plan_format(pdf_text):
42
+ """Extract the care plan format from PDF text"""
43
+ try:
44
+ # Find sections and their content in the PDF using regex
45
+ sections = re.findall(
46
+ r'([A-Z][A-Z\s]+)[:|\n]((?:(?!\n[A-Z][A-Z\s]+[:|\n]).)*)',
47
+ pdf_text,
48
+ re.DOTALL
49
+ )
50
+
51
+ if sections:
52
+ format_template = ""
53
+ for section, content in sections:
54
+ format_template += f"{section.strip()}:\n"
55
+ # Extract bullet points if they exist and remove any asterisks
56
+ bullets = re.findall(r'[-•*]\s*(.*?)(?=[-•*]|\n|$)', content)
57
+ if bullets:
58
+ for bullet in bullets:
59
+ format_template += f"- {bullet.strip()}\n"
60
+ format_template += "\n"
61
+ return format_template
62
+ return None
63
+ except Exception as e:
64
+ print(f"Error extracting format: {e}")
65
+ return None
66
+
67
+
68
+ @app.route('/')
69
+ def index():
70
+ return render_template('index.html')
71
+
72
+
73
+ @app.route('/switch_role', methods=['POST'])
74
+ def switch_role():
75
+ role = request.form.get('role')
76
+ session['role'] = role
77
+ return jsonify({'success': True, 'role': role})
78
+
79
+
80
+ @app.route('/doctor_dashboard')
81
+ def doctor_dashboard():
82
+ if session.get('role') != 'doctor':
83
+ return redirect('/')
84
+ return render_template('doctor_dashboard.html')
85
+
86
+
87
+ @app.route('/submit_feedback', methods=['POST'])
88
+ def submit_feedback():
89
+ try:
90
+ feedback = request.form.get('feedback', '')
91
+ care_plan_text = ""
92
+ care_plan_format = None
93
+
94
+ if 'care_plan_pdf' in request.files:
95
+ pdf_file = request.files['care_plan_pdf']
96
+ if pdf_file.filename != '':
97
+ care_plan_text = extract_text_from_pdf(pdf_file)
98
+ care_plan_format = extract_care_plan_format(care_plan_text)
99
+
100
+ # If no format is found in the PDF, use a default format
101
+ if not care_plan_format:
102
+ care_plan_format = """
103
+ ASSESSMENT:
104
+ [Assessment details]
105
+
106
+ DAILY CARE PLAN:
107
+ Morning:
108
+ - [Morning activities]
109
+
110
+ Afternoon:
111
+ - [Afternoon activities]
112
+
113
+ Evening:
114
+ - [Evening activities]
115
+
116
+ MEDICATIONS:
117
+ - [Medication details]
118
+
119
+ ADDITIONAL RECOMMENDATIONS:
120
+ - [Recommendations]
121
+
122
+ FOLLOW-UP:
123
+ [Follow-up details]
124
+ """
125
+
126
+ # Define emergency keywords to check for severe symptoms
127
+ emergency_keywords = [
128
+ # Cardiovascular
129
+ "severe chest pain", "heart attack", "shortness of breath",
130
+ "dizziness", "loss of consciousness", "extreme pain",
131
+
132
+ # Neurological
133
+ "sudden weakness", "confusion", "slurred speech", "severe headache",
134
+
135
+ # Respiratory
136
+ "difficulty breathing", "severe shortness of breath", "wheezing", "respiratory distress",
137
+
138
+ # Gastrointestinal
139
+ "severe abdominal pain", "persistent vomiting", "uncontrolled bleeding",
140
+
141
+ # Others
142
+ "severe allergic reaction", "anaphylaxis"
143
+ ]
144
+
145
+ feedback_lower = feedback.lower()
146
+ is_emergency = any(keyword in feedback_lower for keyword in emergency_keywords)
147
+
148
+ if is_emergency:
149
+ # Store emergency notification
150
+ emergency_data = {
151
+ 'patient_feedback': feedback,
152
+ 'timestamp': datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
153
+ 'status': 'urgent'
154
+ }
155
+ # In a real application, you would store this in a database
156
+ # For now, we'll use a global variable (not recommended for production)
157
+ if not hasattr(app, 'emergency_notifications'):
158
+ app.emergency_notifications = []
159
+ app.emergency_notifications.append(emergency_data)
160
+
161
+ # If emergency symptoms are detected, instruct immediate emergency response
162
+ emergency_message = (
163
+ "Emergency symptoms detected. Please call emergency services immediately at 104/108/109/112."
164
+ )
165
+ return jsonify({
166
+ 'success': True,
167
+ 'updated_plan': emergency_message
168
+ })
169
+
170
+ # Prepare a prompt for Gemini AI for a perfect, attractively formatted day care plan.
171
+ prompt = f"""
172
+ Patient Care Plan Update Request:
173
+ Current Symptoms and Feedback: {feedback}
174
+ Current Care Plan (extracted from PDF): {care_plan_text}
175
+
176
+ Based on the patient's feedback and current care plan, please provide an updated, perfect daily care plan in the exact following format:
177
+
178
+ {care_plan_format}
179
+
180
+ Please ensure the following:
181
+ - The response is well-structured with clear section headings.
182
+ - Use bullet points for list items without including any asterisk (*) symbols.
183
+ - Format the text attractively and professionally.
184
+ - Remove any extraneous symbols.
185
+ """
186
+ # Get response from Gemini AI
187
+ response = model.generate_content(prompt)
188
+ # Remove any asterisk symbols from the response text
189
+ updated_plan = response.text.replace("*", "")
190
+
191
+ return jsonify({
192
+ 'success': True,
193
+ 'updated_plan': updated_plan
194
+ })
195
+
196
+ except Exception as e:
197
+ return jsonify({
198
+ 'success': False,
199
+ 'error': str(e)
200
+ })
201
+
202
+
203
+ @app.route('/get_emergency_notifications')
204
+ def get_emergency_notifications():
205
+ if session.get('role') != 'doctor':
206
+ return jsonify({'success': False, 'error': 'Unauthorized'})
207
+
208
+ notifications = getattr(app, 'emergency_notifications', [])
209
+ return jsonify({'success': True, 'notifications': notifications})
210
+
211
+
212
+ if __name__ == '__main__':
213
+ app.run(debug=True, port=5001)
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ Flask==3.0.2
2
+ google-generativeai==0.3.2
3
+ PyPDF2==3.0.1
templates/doctor_dashboard.html ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Doctor Dashboard - Care Plan Management System</title>
7
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
8
+ <style>
9
+ :root {
10
+ --primary-blue: #0d6efd;
11
+ --light-blue: #e7f1ff;
12
+ --dark-blue: #0a58ca;
13
+ }
14
+
15
+ body {
16
+ background-color: #f8f9fa;
17
+ }
18
+
19
+ .navbar {
20
+ background-color: var(--primary-blue);
21
+ padding: 1rem;
22
+ }
23
+
24
+ .navbar-brand {
25
+ color: white !important;
26
+ font-weight: bold;
27
+ }
28
+
29
+ .container {
30
+ max-width: 1000px;
31
+ margin-top: 30px;
32
+ }
33
+
34
+ .card {
35
+ border: none;
36
+ border-radius: 15px;
37
+ box-shadow: 0 0 15px rgba(0,0,0,0.1);
38
+ margin-bottom: 20px;
39
+ }
40
+
41
+ .card-header {
42
+ background-color: var(--light-blue);
43
+ border-radius: 15px 15px 0 0 !important;
44
+ border-bottom: none;
45
+ padding: 1.5rem;
46
+ }
47
+
48
+ .emergency-alert {
49
+ background-color: #dc3545;
50
+ color: white;
51
+ padding: 15px;
52
+ border-radius: 10px;
53
+ margin-bottom: 20px;
54
+ }
55
+
56
+ .role-switcher {
57
+ position: fixed;
58
+ top: 20px;
59
+ right: 20px;
60
+ z-index: 1000;
61
+ }
62
+ </style>
63
+ </head>
64
+ <body>
65
+ <nav class="navbar">
66
+ <div class="container">
67
+ <a class="navbar-brand" href="#">Doctor Dashboard</a>
68
+ <div class="role-switcher">
69
+ <select class="form-select" id="roleSelect" onchange="switchRole()">
70
+ <option value="doctor" selected>Doctor View</option>
71
+ <option value="patient">Patient View</option>
72
+ </select>
73
+ </div>
74
+ </div>
75
+ </nav>
76
+
77
+ <div class="container">
78
+ <div class="card">
79
+ <div class="card-header">
80
+ <h3 class="mb-0">Emergency Notifications</h3>
81
+ </div>
82
+ <div class="card-body">
83
+ <div id="emergencyNotifications">
84
+ <div class="text-center" id="noNotifications">
85
+ No emergency notifications at this time
86
+ </div>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+
92
+ <script>
93
+ function switchRole() {
94
+ const role = document.getElementById('roleSelect').value;
95
+ if (role === 'patient') {
96
+ window.location.href = '/';
97
+ }
98
+ }
99
+
100
+ async function fetchEmergencyNotifications() {
101
+ try {
102
+ const response = await fetch('/get_emergency_notifications');
103
+ const data = await response.json();
104
+
105
+ if (data.success) {
106
+ const notificationsDiv = document.getElementById('emergencyNotifications');
107
+ const noNotificationsDiv = document.getElementById('noNotifications');
108
+
109
+ if (data.notifications && data.notifications.length > 0) {
110
+ notificationsDiv.innerHTML = '';
111
+ data.notifications.forEach(notification => {
112
+ const notificationElement = document.createElement('div');
113
+ notificationElement.className = 'emergency-alert';
114
+ notificationElement.innerHTML = `
115
+ <h4>Emergency Alert</h4>
116
+ <p>Time: ${notification.timestamp}</p>
117
+ <p>Patient Feedback: ${notification.patient_feedback}</p>
118
+ `;
119
+ notificationsDiv.appendChild(notificationElement);
120
+ });
121
+ } else {
122
+ notificationsDiv.innerHTML = '<div class="text-center">No emergency notifications at this time</div>';
123
+ }
124
+ }
125
+ } catch (error) {
126
+ console.error('Error fetching notifications:', error);
127
+ }
128
+ }
129
+
130
+ // Initial fetch
131
+ fetchEmergencyNotifications();
132
+
133
+ // Poll for new notifications
134
+ setInterval(fetchEmergencyNotifications, 30000);
135
+ </script>
136
+ </body>
137
+ </html>
templates/index.html ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Care Plan Management System</title>
7
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" />
8
+ <style>
9
+ :root {
10
+ --primary-blue: #0d6efd;
11
+ --light-blue: #e7f1ff;
12
+ --dark-blue: #0a58ca;
13
+ --bg-light: #f8f9fa;
14
+ }
15
+
16
+ body {
17
+ background-color: var(--bg-light);
18
+ font-family: 'Roboto', sans-serif;
19
+ }
20
+
21
+ .navbar {
22
+ background-color: var(--primary-blue);
23
+ padding: 1rem;
24
+ }
25
+
26
+ .navbar-brand {
27
+ color: white !important;
28
+ font-weight: bold;
29
+ }
30
+
31
+ .container {
32
+ max-width: 1000px;
33
+ margin-top: 30px;
34
+ }
35
+
36
+ .card {
37
+ border: none;
38
+ border-radius: 15px;
39
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
40
+ margin-bottom: 20px;
41
+ }
42
+
43
+ .card-header {
44
+ background-color: var(--light-blue);
45
+ border-radius: 15px 15px 0 0;
46
+ border-bottom: none;
47
+ padding: 1.5rem;
48
+ }
49
+
50
+ .form-control {
51
+ border-radius: 10px;
52
+ border: 2px solid #e9ecef;
53
+ padding: 0.8rem;
54
+ }
55
+
56
+ .form-control:focus {
57
+ border-color: var(--primary-blue);
58
+ box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
59
+ }
60
+
61
+ .btn-primary {
62
+ background-color: var(--primary-blue);
63
+ border: none;
64
+ padding: 0.8rem 2rem;
65
+ border-radius: 10px;
66
+ font-weight: 600;
67
+ }
68
+
69
+ .btn-primary:hover {
70
+ background-color: var(--dark-blue);
71
+ }
72
+
73
+ /* Updated Care Plan Output Styling */
74
+ #updatedPlan {
75
+ white-space: pre-wrap;
76
+ background-color: white;
77
+ padding: 20px;
78
+ border-radius: 10px;
79
+ border-left: 4px solid var(--primary-blue);
80
+ font-size: 1rem;
81
+ line-height: 1.6;
82
+ opacity: 0;
83
+ transform: translateY(20px);
84
+ transition: opacity 0.5s ease, transform 0.5s ease;
85
+ }
86
+
87
+ #updatedPlan.visible {
88
+ opacity: 1;
89
+ transform: translateY(0);
90
+ }
91
+
92
+ .role-switcher {
93
+ position: fixed;
94
+ top: 20px;
95
+ right: 20px;
96
+ z-index: 1000;
97
+ }
98
+
99
+ .emergency-alert {
100
+ background-color: #dc3545;
101
+ color: white;
102
+ padding: 15px;
103
+ border-radius: 10px;
104
+ margin-bottom: 20px;
105
+ }
106
+
107
+ /* Loading Spinner Styles */
108
+ #loadingIndicator {
109
+ display: none;
110
+ text-align: center;
111
+ margin-top: 20px;
112
+ }
113
+ </style>
114
+ </head>
115
+ <body>
116
+ <nav class="navbar">
117
+ <div class="container">
118
+ <a class="navbar-brand" href="#">Care Plan Management System</a>
119
+ <div class="role-switcher">
120
+ <select class="form-select" id="roleSelect" onchange="switchRole()">
121
+ <option value="patient">Patient View</option>
122
+ <option value="doctor">Doctor View</option>
123
+ </select>
124
+ </div>
125
+ </div>
126
+ </nav>
127
+
128
+ <div class="container">
129
+ <!-- Patient View -->
130
+ <div id="patientView">
131
+ <div class="card">
132
+ <div class="card-header">
133
+ <h3 class="mb-0">Patient Feedback Form</h3>
134
+ </div>
135
+ <div class="card-body">
136
+ <form id="feedbackForm" class="mb-4">
137
+ <div class="mb-3">
138
+ <label for="feedback" class="form-label">Current Symptoms and Feedback</label>
139
+ <textarea class="form-control" id="feedback" name="feedback" rows="4" placeholder="Please describe your current symptoms and how you're feeling..." required></textarea>
140
+ </div>
141
+
142
+ <div class="mb-3">
143
+ <label for="care_plan_pdf" class="form-label">Upload Current Care Plan (PDF)</label>
144
+ <input type="file" class="form-control" id="care_plan_pdf" name="care_plan_pdf" accept=".pdf" />
145
+ <div class="form-text">Optional: Upload your current care plan in PDF format</div>
146
+ </div>
147
+
148
+ <button type="submit" class="btn btn-primary">Submit Feedback</button>
149
+ </form>
150
+ <!-- Loading Indicator -->
151
+ <div id="loadingIndicator">
152
+ <div class="spinner-border text-primary" role="status">
153
+ <span class="visually-hidden">Loading...</span>
154
+ </div>
155
+ <p>Generating updated care plan...</p>
156
+ </div>
157
+ </div>
158
+ </div>
159
+
160
+ <div id="responseSection" class="card d-none">
161
+ <div class="card-header">
162
+ <h3 class="mb-0">Updated Care Plan</h3>
163
+ </div>
164
+ <div class="card-body">
165
+ <div id="updatedPlan"></div>
166
+ </div>
167
+ </div>
168
+ </div>
169
+
170
+ <!-- Doctor View -->
171
+ <div id="doctorView" style="display: none;">
172
+ <div class="card">
173
+ <div class="card-header">
174
+ <h3 class="mb-0">Emergency Notifications</h3>
175
+ </div>
176
+ <div class="card-body">
177
+ <div id="emergencyNotifications"></div>
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </div>
182
+
183
+ <script>
184
+ let currentRole = 'patient';
185
+
186
+ function switchRole() {
187
+ const role = document.getElementById('roleSelect').value;
188
+ if (role === 'doctor') {
189
+ window.location.href = '/doctor_dashboard';
190
+ }
191
+
192
+ // Update server-side role
193
+ fetch('/switch_role', {
194
+ method: 'POST',
195
+ headers: {
196
+ 'Content-Type': 'application/x-www-form-urlencoded'
197
+ },
198
+ body: `role=${role}`
199
+ });
200
+ }
201
+
202
+ async function fetchEmergencyNotifications() {
203
+ try {
204
+ const response = await fetch('/get_emergency_notifications');
205
+ const data = await response.json();
206
+
207
+ if (data.success) {
208
+ const notificationsDiv = document.getElementById('emergencyNotifications');
209
+ notificationsDiv.innerHTML = '';
210
+
211
+ data.notifications.forEach(notification => {
212
+ const notificationElement = document.createElement('div');
213
+ notificationElement.className = 'emergency-alert';
214
+ notificationElement.innerHTML = `
215
+ <h4>Emergency Alert</h4>
216
+ <p>Time: ${notification.timestamp}</p>
217
+ <p>Patient Feedback: ${notification.patient_feedback}</p>
218
+ `;
219
+ notificationsDiv.appendChild(notificationElement);
220
+ });
221
+ }
222
+ } catch (error) {
223
+ console.error('Error fetching notifications:', error);
224
+ }
225
+ }
226
+
227
+ document.getElementById('feedbackForm').addEventListener('submit', async (e) => {
228
+ e.preventDefault();
229
+
230
+ // Show loading indicator
231
+ document.getElementById('loadingIndicator').style.display = 'block';
232
+ document.getElementById('responseSection').classList.add('d-none');
233
+
234
+ const formData = new FormData(e.target);
235
+
236
+ try {
237
+ const response = await fetch('/submit_feedback', {
238
+ method: 'POST',
239
+ body: formData
240
+ });
241
+
242
+ const data = await response.json();
243
+
244
+ // Hide loading indicator
245
+ document.getElementById('loadingIndicator').style.display = 'none';
246
+
247
+ if (data.success) {
248
+ const updatedPlanDiv = document.getElementById('updatedPlan');
249
+ updatedPlanDiv.textContent = data.updated_plan;
250
+ // Add animation effect
251
+ setTimeout(() => {
252
+ updatedPlanDiv.classList.add('visible');
253
+ }, 50);
254
+ document.getElementById('responseSection').classList.remove('d-none');
255
+ } else {
256
+ alert('Error: ' + data.error);
257
+ }
258
+ } catch (error) {
259
+ document.getElementById('loadingIndicator').style.display = 'none';
260
+ alert('Error submitting feedback: ' + error);
261
+ }
262
+ });
263
+
264
+ // Poll for emergency notifications when in doctor view
265
+ setInterval(() => {
266
+ if (currentRole === 'doctor') {
267
+ fetchEmergencyNotifications();
268
+ }
269
+ }, 30000);
270
+ </script>
271
+ </body>
272
+ </html>