mirror of
https://github.com/reiyua/HospitalWaitTimeCalc.git
synced 2026-11-17 06:12:05 +11:00
dear god even i dont know whats going on here
This commit is contained in:
parent
d0a2cc585e
commit
5da9e5dbb5
14 changed files with 11480 additions and 2504 deletions
20
Original Assessment Files/Data/SurveyClientResponses.txt
Normal file
20
Original Assessment Files/Data/SurveyClientResponses.txt
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"It would be helpful to know in advance if my appointment is delayed so I can plan my time better."
|
||||
"I had to wait 30 minutes without any update; it was very frustrating."
|
||||
"If delays are unavoidable, a notification would be appreciated."
|
||||
"I often feel stressed not knowing how long I’ll have to wait."
|
||||
"Sometimes I bring my kids, and the wait times make it difficult to keep them calm."
|
||||
"An update via text or app would be great if the appointment is running late."
|
||||
"The waiting area can get crowded. Knowing about delays could help me avoid peak times."
|
||||
"I don't mind small delays, but long waits with no explanation are frustrating."
|
||||
"A simple alert would allow me to do other errands nearby while waiting."
|
||||
"It would be nice if reception staff could provide more accurate wait times."
|
||||
"I’ve had to reschedule appointments multiple times due to long waits."
|
||||
"The lack of communication on delays makes me feel like my time isn't valued."
|
||||
"I appreciate the quality of care here, but waiting so long is tough to manage."
|
||||
"Knowing ahead of time about delays would reduce my frustration."
|
||||
"If I could check for delays online, it would be easier for me."
|
||||
"Being informed about wait times would make my visits less stressful."
|
||||
"If doctors are running behind, I’d like to be given an option to reschedule."
|
||||
"I'd love an option to receive updates directly on my phone."
|
||||
"Sometimes I need to make additional childcare arrangements, which is hard with long waits."
|
||||
"Waiting without updates is stressful; I'd rather receive a heads-up."
|
||||
20
Original Assessment Files/Data/SurveyStaffResponses.txt
Normal file
20
Original Assessment Files/Data/SurveyStaffResponses.txt
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
"We spend a lot of time trying to reassure clients about delays."
|
||||
"Clients often get frustrated when we can’t provide an exact wait time."
|
||||
"If we had a way to notify clients about delays, it would reduce tension."
|
||||
"Clients want accurate information on wait times, but it’s difficult to provide."
|
||||
"Many clients ask repeatedly about their position in the queue, which is challenging."
|
||||
"If we could streamline our communication about delays, it would be less stressful for everyone."
|
||||
"We could really benefit from a system that shows clients real-time wait updates."
|
||||
"A better scheduling system might reduce unexpected delays and client frustration."
|
||||
"Communicating delays upfront would prevent many of the daily confrontations we face."
|
||||
"An app or message system could save us time by reducing client queries."
|
||||
"We need a solution for managing last-minute appointments without major disruptions."
|
||||
"Some clients become hostile when we can't give exact timings, which is challenging."
|
||||
"It’s exhausting dealing with constant complaints about delays all day."
|
||||
"If clients had updates on delays, they wouldn’t be as likely to get upset."
|
||||
"There’s so much pressure to manage wait times and keep clients informed."
|
||||
"Better communication would make the waiting room less tense."
|
||||
"A proactive notification system could cut down on front desk stress."
|
||||
"The unpredictability of our schedules makes it hard to give clients accurate info."
|
||||
"We are constantly explaining delays, which takes time away from other tasks."
|
||||
"A system for alerting clients would reduce client complaints and our stress."
|
||||
|
Can't render this file because it is too large.
|
61
Website Files/app.py
Normal file
61
Website Files/app.py
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
from flask import Flask, request, render_template
|
||||
import joblib
|
||||
import numpy as np
|
||||
import os
|
||||
from flask import Flask
|
||||
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
model_path = os.path.join(BASE_DIR, "model.pkl")
|
||||
# to get your model: joblib.dump(model, "model.pkl")
|
||||
|
||||
model = joblib.load(model_path)
|
||||
|
||||
app = Flask(
|
||||
'IndigoWaitingTime',
|
||||
template_folder=os.path.join(BASE_DIR, 'templates')
|
||||
)
|
||||
|
||||
# app = Flask('IndigoWaitingTime')
|
||||
|
||||
@app.route('/debug')
|
||||
def debug():
|
||||
return str(os.listdir('templates'))
|
||||
|
||||
@app.route('/', methods=['GET'])
|
||||
def greet():
|
||||
# return app.send_static_file('CheckWaitingTime.html')
|
||||
return render_template('CheckWaitingTime.html')
|
||||
|
||||
@app.route('/show_waiting_time',methods=['POST'])
|
||||
def show_waiting_time():
|
||||
data = dict(request.form)
|
||||
# This list needs to be in the same order as
|
||||
# the features when the model was initially trained
|
||||
featureList = ['day_of_week', 'time_of_day',
|
||||
'patient_age', 'patient_gender',
|
||||
'num_doctors', 'num_receptionists',
|
||||
'temperature', 'rainfall',
|
||||
'pct_prior_vacant_slots',
|
||||
'prior_emergency',
|
||||
'avg_doctor_experience',
|
||||
'pct_switch', 'avg_age_prior',
|
||||
'avg_gender_prior']
|
||||
X = [data[f] for f in featureList]
|
||||
X = [float(x) for x in X]
|
||||
|
||||
# Convert percentage values to proportions
|
||||
idx = featureList.index('pct_prior_vacant_slots')
|
||||
X[idx] = X[idx] / 100
|
||||
idx = featureList.index('pct_switch')
|
||||
X[idx] = X[idx] / 100
|
||||
|
||||
Xnp = np.array(X).reshape(1,-1)
|
||||
# model = joblib.load({folder and model name})
|
||||
prediction = model.predict(Xnp)
|
||||
|
||||
return render_template('WaitingTime.html', waittime=round(prediction[0]))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
BIN
Website Files/model.pkl
Normal file
BIN
Website Files/model.pkl
Normal file
Binary file not shown.
11211
Website Files/static/css/main.css
Normal file
11211
Website Files/static/css/main.css
Normal file
File diff suppressed because it is too large
Load diff
153
Website Files/templates/CheckWaitingTime.html
Normal file
153
Website Files/templates/CheckWaitingTime.html
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href='static/css/main.css'>
|
||||
<title>Indigo | Waiting time predictor</title>
|
||||
</head>
|
||||
<body>
|
||||
<br><br>
|
||||
<h1>Indigo Community Services and Health Hub | Waiting time predictor</h1>
|
||||
<form action="/show_waiting_time" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="day_of_week">Day of Week</label></td>
|
||||
<td>
|
||||
<select id="day_of_week" name="day_of_week" required>
|
||||
<option value=1>Monday</option>
|
||||
<option value=2>Tuesday</option>
|
||||
<option value=3>Wednesday</option>
|
||||
<option value=4>Thursday</option>
|
||||
<option value=5>Friday</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="time_of_day">Time of Day</label></td>
|
||||
<td>
|
||||
<select id="time_of_day" name="time_of_day" required>
|
||||
<option value=1>8:00 am</option>
|
||||
<option value=2>8:15 am</option>
|
||||
<option value=3>8:30 am</option>
|
||||
<option value=4>8:45 am</option>
|
||||
<option value=5>9:00 am</option>
|
||||
<option value=6>9:15 am</option>
|
||||
<option value=7>9:30 am</option>
|
||||
<option value=8>9:45 am</option>
|
||||
<option value=9>10:00 am</option>
|
||||
<option value=10>10:15 am</option>
|
||||
<option value=11>10:30 am</option>
|
||||
<option value=12>10:45 am</option>
|
||||
<option value=13>11:00 am</option>
|
||||
<option value=14>11:15 am</option>
|
||||
<option value=15>11:30 am</option>
|
||||
<option value=16>11:45 am</option>
|
||||
<option value=17>1:00 pm</option>
|
||||
<option value=18>1:15 pm</option>
|
||||
<option value=19>1:30 pm</option>
|
||||
<option value=20>1:45 pm</option>
|
||||
<option value=21>2:00 pm</option>
|
||||
<option value=22>2:15 pm</option>
|
||||
<option value=23>2:30 pm</option>
|
||||
<option value=24>2:45 pm</option>
|
||||
<option value=25>3:00 pm</option>
|
||||
<option value=26>3:15 pm</option>
|
||||
<option value=27>3:30 pm</option>
|
||||
<option value=28>3:45 pm</option>
|
||||
<option value=29>4:00 pm</option>
|
||||
<option value=30>4:15 pm</option>
|
||||
<option value=31>4:30 pm</option>
|
||||
<option value=32>4:45 pm</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="patient_age">Patient Age</label></td>
|
||||
<td><input type="number" id="patient_age" name="patient_age" min=0 required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="patient_gender">Patient Gender</label></td>
|
||||
<td>
|
||||
<select id="patient_gender" name="patient_gender" required>
|
||||
<option value=1>Female</option>
|
||||
<option value=0>Male</option>
|
||||
</select>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="num_doctors">No. of Doctors on Duty</label></td>
|
||||
<td>
|
||||
<select id="num_doctors" name="num_doctors" required>
|
||||
<option value=1>1</option>
|
||||
<option value=2>2</option>
|
||||
<option value=3 selected>3</option>
|
||||
<option value=4>4</option>
|
||||
<option value=5>5</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="num_receptionists">No. of Receptionists on Duty</label></td>
|
||||
<td>
|
||||
<select id="num_receptionists" name="num_receptionists" required>
|
||||
<option value=1>1</option>
|
||||
<option value=2 selected>2</option>
|
||||
<option value=3>3</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="temperature">Temperature (deg. C)</label></td>
|
||||
<td><input type="number" id="temperature" name="temperature" min=-50 max=50 value=22 required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="rainfall">Rainfall (mm)</label></td>
|
||||
<td><input type="number" id="rainfall" name="rainfall" min=0 max=1000 value=5 required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="pct_prior_vacant_slots">% Prior Vacant Slots</label></td>
|
||||
<td><input type="number" id="pct_prior_vacant_slots" name="pct_prior_vacant_slots" min=0 max=100 value=32 required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="prior_emergency">Prior Emergency</label></td>
|
||||
<td>
|
||||
<select id="prior_emergency" name="prior_emergency" required>
|
||||
<option value=0 selected>No</option>
|
||||
<option value=1>Yes</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="avg_doctor_experience">Avg. Doctor Experience (yrs)</label></td>
|
||||
<td><input type="number" id="avg_doctor_experience" name="avg_doctor_experience" min=0 value=8 required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="pct_switch">% Willing to Switch</label></td>
|
||||
<td><input type="number" id="pct_switch" name="pct_switch" min=0 max=100 value=28 required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="avg_age_prior">Avg. Age Prior Patients</label></td>
|
||||
<td><input type="number" id="avg_age_prior" name="avg_age_prior" min=0 value=36 required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="avg_gender_prior">Avg. Gender Prior Patients</label></td>
|
||||
<td><input type="number" id="avg_gender_prior" name="avg_gender_prior" min=0 max=1 value=0.6 step=0.01 required></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input type="submit" value="Submit"></td>
|
||||
</tr>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
15
Website Files/templates/WaitingTime.html
Normal file
15
Website Files/templates/WaitingTime.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="static/css/main.css">
|
||||
<title>Indigo | Waiting time prediction</title>
|
||||
</head>
|
||||
<body>
|
||||
<img src="static/img/logo.svg" width=300/>
|
||||
<br><br>
|
||||
<h1>Indigo Community Services and Health Hub | Waiting time prediction</h1>
|
||||
<br>
|
||||
Your predicted waiting time is {{waittime}} minutes.<br><br>
|
||||
<a href="/">Return to main page</a>
|
||||
</body>
|
||||
</html>
|
||||
2504
mod03-XGBoost.ipynb
2504
mod03-XGBoost.ipynb
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue