Glitche commited on
Commit
513cacb
·
verified ·
1 Parent(s): bb1cf1c

Upload 3 files

Browse files
templates/base.html ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>{% block title %}TalkToDoc{% endblock %}</title>
7
+ <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
8
+ </head>
9
+ <body class="{% block body_class %}{% endblock %}">
10
+ <div class="app-shell {% block shell_class %}{% endblock %}">
11
+ {% block header %}{% endblock %}
12
+ <main class="app-main">
13
+ {% block content %}{% endblock %}
14
+ </main>
15
+ </div>
16
+ <div class="toast" id="toast" role="status" aria-live="polite"></div>
17
+ <script src="{{ url_for('static', filename='js/shared.js') }}"></script>
18
+ {% block scripts %}{% endblock %}
19
+ </body>
20
+ </html>
templates/patient.html ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}TalkToDoc{% endblock %}
4
+
5
+ {% block body_class %}patient-page{% endblock %}
6
+ {% block shell_class %}patient-shell{% endblock %}
7
+
8
+ {% block header %}
9
+ <div class="app-header">
10
+ <div class="brand">
11
+ <span class="brand-mark">
12
+ <svg viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
13
+ <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>
14
+ </svg>
15
+ </span>
16
+ <div>
17
+ <h1>TalkToDoc</h1>
18
+ <span class="role-tag">Patient</span>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ {% endblock %}
23
+
24
+ {% block content %}
25
+
26
+ <div id="status-banner" role="alert" aria-live="assertive"></div>
27
+
28
+ <!-- Step 1: language selection -->
29
+ <section class="step active" data-step="1">
30
+ <div class="hero">
31
+ <div class="hero-orb-wrap">
32
+ <div class="hero-orb-glow"></div>
33
+ <div class="hero-orb">
34
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
35
+ <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>
36
+ </svg>
37
+ </div>
38
+ </div>
39
+ <h2>Hi, how can we help?</h2>
40
+ <p>Choose your language, then tell us how you're feeling, by typing or speaking.</p>
41
+ </div>
42
+
43
+ <div class="card">
44
+ <h3>Choose your language</h3>
45
+ <div class="language-grid" id="language-grid">
46
+ {% for lang in languages %}
47
+ <button type="button" class="language-option" data-language="{{ lang }}" aria-pressed="false">
48
+ {{ lang | capitalize }}
49
+ </button>
50
+ {% endfor %}
51
+ </div>
52
+ </div>
53
+ <button type="button" class="btn btn-primary" id="to-step-2" disabled>Continue</button>
54
+
55
+ <div class="card" id="history-card" style="display: none;">
56
+ <h3>Your past messages</h3>
57
+ <div id="history-list"></div>
58
+ </div>
59
+ </section>
60
+
61
+ <!-- Step 2: query input -->
62
+ <section class="step" data-step="2">
63
+ <div class="card">
64
+ <h2>Describe how you're feeling</h2>
65
+ <p>Type your message, tap a quick option, or speak it instead.</p>
66
+
67
+ <div class="chip-row" id="symptom-chips">
68
+ <button type="button" class="chip" data-text="I have a headache">Headache</button>
69
+ <button type="button" class="chip" data-text="I have a fever">Fever</button>
70
+ <button type="button" class="chip" data-text="I have a stomach ache">Stomach ache</button>
71
+ <button type="button" class="chip" data-text="I have a cough">Cough</button>
72
+ <button type="button" class="chip" data-text="I feel dizzy">Dizziness</button>
73
+ </div>
74
+
75
+ <div id="input-panel">
76
+ <label for="patient-text">Type your message</label>
77
+ <div class="input-bar">
78
+ <textarea id="patient-text" rows="4" placeholder="For example: I have a headache and a fever since yesterday"></textarea>
79
+ <button type="button" class="mic-inline-btn" id="record-btn" title="Record your voice" aria-label="Record your voice">
80
+ <span id="record-icon">
81
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
82
+ <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>
83
+ <path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="23"/><line x1="8" y1="23" x2="16" y2="23"/>
84
+ </svg>
85
+ </span>
86
+ </button>
87
+ </div>
88
+ <p class="helper-text" id="record-status"></p>
89
+ </div>
90
+
91
+ <!-- Listening state, shown instead of the input bar while recording -->
92
+ <div class="listening-panel" id="listening-panel" style="display: none;">
93
+ <div class="listening-orb-wrap">
94
+ <span class="listening-ring"></span>
95
+ <span class="listening-ring"></span>
96
+ <span class="listening-ring"></span>
97
+ <button type="button" class="listening-core" id="stop-recording-btn" title="Stop recording" aria-label="Stop recording">
98
+ <svg viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="6" width="12" height="12" rx="2"/></svg>
99
+ </button>
100
+ </div>
101
+ <div class="listening-caption">We're listening<span class="record-timer" id="record-timer">&nbsp;0:00</span></div>
102
+ <p class="helper-text">Tap the button when you're done.</p>
103
+ </div>
104
+ </div>
105
+
106
+ <div class="btn-row">
107
+ <button type="button" class="btn btn-secondary" id="back-to-step-1">Back</button>
108
+ <button type="button" class="btn btn-primary" id="submit-input">
109
+ <span class="btn-icon">
110
+ <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
111
+ <line x1="22" y1="2" x2="11" y2="13"/>
112
+ <polygon points="22 2 15 22 11 13 2 9 22 2"/>
113
+ </svg>
114
+ </span>
115
+ <span class="btn-spinner spinner" style="display: none;"></span>
116
+ <span class="btn-label">Send to provider</span>
117
+ </button>
118
+ </div>
119
+ </section>
120
+
121
+ <!-- Step 3: waiting / response -->
122
+ <section class="step" data-step="3">
123
+ <div class="card">
124
+ <h2>Your conversation</h2>
125
+ <p>Reference number: <span class="interaction-id" id="interaction-id-display"></span></p>
126
+ <div class="chat-thread" id="chat-thread">
127
+ <div class="chat-bubble from-patient">
128
+ <span class="chat-label">You</span>
129
+ <span id="heard-text"></span>
130
+ </div>
131
+ </div>
132
+ <p class="helper-text" id="waiting-text">Your provider hasn't replied yet.</p>
133
+ <button type="button" class="btn btn-secondary" id="check-response-btn">
134
+ <span class="btn-spinner spinner" style="display: none;"></span>
135
+ <span class="btn-label">Check for reply</span>
136
+ </button>
137
+ </div>
138
+
139
+ <div class="card" id="response-card" style="display: none;">
140
+ <audio id="response-audio" controls></audio>
141
+ </div>
142
+
143
+ <button type="button" class="btn btn-secondary" id="new-conversation-btn">Start a new conversation</button>
144
+ </section>
145
+
146
+ <div class="nav-link"><a href="/provider">Go to provider view</a></div>
147
+
148
+ {% endblock %}
149
+
150
+ {% block scripts %}
151
+ <script src="{{ url_for('static', filename='js/patient.js') }}"></script>
152
+ {% endblock %}
templates/provider.html ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}TalkToDoc - Provider{% endblock %}
4
+
5
+ {% block body_class %}provider-page{% endblock %}
6
+ {% block shell_class %}provider-shell{% endblock %}
7
+
8
+ {% block header %}
9
+ <div class="app-header provider">
10
+ <div class="brand">
11
+ <span class="brand-mark">
12
+ <svg viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
13
+ <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>
14
+ </svg>
15
+ </span>
16
+ <div>
17
+ <h1>TalkToDoc</h1>
18
+ <span class="role-tag">Provider</span>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ {% endblock %}
23
+
24
+ {% block content %}
25
+
26
+ <div id="status-banner" role="alert" aria-live="assertive"></div>
27
+
28
+ <div class="provider-layout">
29
+
30
+ <!-- Pending list -->
31
+ <section class="step active provider" data-step="list">
32
+ <div class="hero provider">
33
+ <div class="hero-orb-wrap">
34
+ <div class="hero-orb-glow"></div>
35
+ <div class="hero-orb">
36
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
37
+ <polyline points="20 6 9 17 4 12"/>
38
+ </svg>
39
+ </div>
40
+ </div>
41
+ <h2><span class="queue-heading-text" id="queue-heading">Messages waiting for you</span></h2>
42
+ <p>Review what each patient said, then send your reply.</p>
43
+ </div>
44
+
45
+ <div class="card">
46
+ <div id="pending-list"></div>
47
+ <p class="helper-text" id="empty-pending" style="display: none;">Nothing waiting right now.</p>
48
+ </div>
49
+ </section>
50
+
51
+ <!-- Respond to a selected interaction -->
52
+ <section class="step provider" data-step="respond">
53
+ <div class="detail-placeholder" id="detail-placeholder">
54
+ <span class="brand-mark detail-placeholder-mark">
55
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
56
+ <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>
57
+ </svg>
58
+ </span>
59
+ <p>Select a message from the list to read it and reply.</p>
60
+ </div>
61
+
62
+ <div id="detail-content" style="display: none;">
63
+ <div class="card">
64
+ <p>Reference number: <span class="interaction-id" id="respond-interaction-id"></span></p>
65
+ <div class="chat-thread">
66
+ <div class="chat-bubble from-patient">
67
+ <span class="chat-label" id="respond-language-label">Patient</span>
68
+ <span id="respond-translated-text"></span>
69
+ </div>
70
+ </div>
71
+ <div class="nlu-summary" id="respond-nlu-summary"></div>
72
+ </div>
73
+
74
+ <div class="card">
75
+ <label for="response-text-input">Your reply (in English)</label>
76
+ <div class="chip-row" id="quick-reply-chips">
77
+ <button type="button" class="chip" data-text="Please come in for a check-up so we can look at this properly.">Come in for a check-up</button>
78
+ <button type="button" class="chip" data-text="Please rest and stay hydrated, drink plenty of water.">Rest and stay hydrated</button>
79
+ <button type="button" class="chip" data-text="This doesn't sound urgent. Please monitor it and reach out again if it gets worse.">Monitor and follow up</button>
80
+ <button type="button" class="chip" data-text="I need a bit more detail, please describe your symptoms further.">Need more detail</button>
81
+ </div>
82
+ <textarea id="response-text-input" rows="4" placeholder="Type your reply here"></textarea>
83
+ </div>
84
+
85
+ <div class="btn-row">
86
+ <button type="button" class="btn btn-secondary" id="back-to-list">Back</button>
87
+ <button type="button" class="btn btn-provider" id="submit-response">
88
+ <span class="btn-icon">
89
+ <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
90
+ <polyline points="20 6 9 17 4 12"/>
91
+ </svg>
92
+ </span>
93
+ <span class="btn-spinner spinner" style="display: none;"></span>
94
+ <span class="btn-label">Send reply</span>
95
+ </button>
96
+ </div>
97
+ </div>
98
+ </section>
99
+
100
+ </div>
101
+
102
+ <div class="nav-link provider"><a href="/">Go to patient view</a></div>
103
+
104
+ {% endblock %}
105
+
106
+ {% block scripts %}
107
+ <script src="{{ url_for('static', filename='js/provider.js') }}"></script>
108
+ {% endblock %}