mirror of
https://github.com/reiyua/HospitalWaitTimeCalc.git
synced 2026-11-17 06:12:05 +11:00
clean up of files
This commit is contained in:
parent
4281958d02
commit
bb1f7faa1c
8 changed files with 0 additions and 11418 deletions
|
Can't render this file because it is too large.
|
Binary file not shown.
|
|
@ -1,39 +0,0 @@
|
||||||
from flask import Flask, request, render_template
|
|
||||||
import joblib
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
app = Flask('IndigoWaitingTime')
|
|
||||||
|
|
||||||
@app.route('/', methods=['GET'])
|
|
||||||
def greet():
|
|
||||||
return app.send_static_file('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=prediction[0])
|
|
||||||
|
|
||||||
|
|
@ -1,153 +0,0 @@
|
||||||
<!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>
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,15 +0,0 @@
|
||||||
<!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>
|
|
||||||
Loading…
Add table
Reference in a new issue