-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
513 lines (494 loc) · 28.3 KB
/
Copy pathindex.html
File metadata and controls
513 lines (494 loc) · 28.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CRDW Sweep & Specify</title>
<!-- DataTables CSS -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.7/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- ---- Header ---- -->
<header class="app-header">
<h1>CRDW Sweep & Specify</h1>
<span class="subtitle">OUHSC BBMC — CDW Dictionary Metadata Generator</span>
<button class="btn-settings" onclick="DictApp.openSettings()" title="AI Settings">
⚙ Settings
</button>
</header>
<!-- ---- Settings Modal ---- -->
<div class="modal-overlay" id="settings-modal">
<div class="modal">
<div class="modal-header">
<h2>Settings</h2>
<button class="modal-close" onclick="DictApp.closeSettings()">×</button>
</div>
<div class="modal-body">
<p class="modal-description">
The AI Expand feature uses Claude to generate comprehensive keyword lists from natural language
(e.g., "all GLP-1 receptor agonists" → every brand name, generic, and variant).
Enter your Anthropic API key below to enable it.
</p>
<div class="settings-group">
<label for="settings-email">Your OU Email</label>
<input type="email" id="settings-email" placeholder="jdoe@ouhsc.edu"
autocomplete="email">
<span class="settings-hint">Required for team proxy access. Your email must be on the approved list. Stored only in your browser.</span>
</div>
<div class="settings-group">
<label for="settings-apikey">Anthropic API Key</label>
<input type="password" id="settings-apikey" placeholder="sk-ant-api03-..."
autocomplete="off" spellcheck="false">
<span class="settings-hint">
Get your key at <a href="https://console.anthropic.com/settings/keys" target="_blank" rel="noopener">console.anthropic.com/settings/keys</a>.
Stored only in your browser's local storage — never sent to our server.
Cost: ~$0.008 per AI Expand query (~1 cent).
</span>
</div>
<div class="settings-divider">
<span>Team Proxy (AI Expand + Send to CRDW)</span>
</div>
<div class="settings-group">
<label for="settings-worker">Worker URL</label>
<input type="url" id="settings-worker" placeholder="https://crdw-sweep-specify.your-account.workers.dev"
autocomplete="off">
<span class="settings-hint">
The shared Cloudflare Worker URL. Handles both AI keyword expansion and pushing files
to GitHub — no API keys or tokens needed in your browser. Contact the project admin for this URL.
</span>
</div>
<div class="settings-status" id="settings-status"></div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" onclick="DictApp.closeSettings()">Cancel</button>
<button class="btn btn-primary" onclick="DictApp.testAiConnection()">Test Connection</button>
<button class="btn btn-success" onclick="DictApp.saveSettings()">Save</button>
</div>
</div>
</div>
<!-- ---- Project Setup Bar ---- -->
<div class="setup-bar">
<div class="setup-group">
<label for="project-name">Project Name</label>
<input type="text" id="project-name" placeholder="e.g., smith-lung-cancer-1">
</div>
<div class="setup-group">
<label for="date-start">Date Start</label>
<input type="date" id="date-start" value="2020-01-01">
</div>
<div class="setup-group">
<label for="date-end">Date End</label>
<input type="date" id="date-end" value="2025-12-31">
</div>
<div class="setup-group">
<label>Visit Context</label>
<div class="checkbox-group">
<label><input type="checkbox" id="ctx-outpatient" checked> Outpatient</label>
<label><input type="checkbox" id="ctx-inpatient" checked> Inpatient</label>
</div>
</div>
<div class="setup-group">
<label>Active Systems</label>
<div class="system-badges" id="active-systems">
<!-- Populated by JS based on date/context -->
</div>
</div>
</div>
<!-- ---- Tab Navigation ---- -->
<nav class="tab-nav">
<button class="tab-btn active" data-tab="dx">
Diagnoses <span class="badge" id="badge-dx">0</span>
</button>
<button class="tab-btn" data-tab="medication">
Medications <span class="badge" id="badge-medication">0</span>
</button>
<button class="tab-btn" data-tab="lab">
Labs <span class="badge" id="badge-lab">0</span>
</button>
<button class="tab-btn" data-tab="location">
Locations <span class="badge" id="badge-location">0</span>
</button>
<button class="tab-btn" data-tab="procedure">
Procedures <span class="badge" id="badge-procedure">0</span>
</button>
</nav>
<!-- ---- Diagnoses Tab ---- -->
<div class="tab-content active" id="tab-dx">
<div class="search-action-bar">
<div class="keyword-search-wrapper" id="kw-wrapper-dx">
<span class="search-icon">🔍</span>
<div class="keyword-chips" id="kw-chips-dx"></div>
<input type="text" id="search-dx"
placeholder="Type keyword + Enter (e.g. breast, ovar*, C50)"
class="keyword-input">
</div>
<button class="btn btn-secondary btn-clear-kw" onclick="DictApp.clearKeywords('dx')" title="Clear all keywords" style="display:none" id="btn-clear-kw-dx">✕ Clear</button>
</div>
<div class="ai-panel visible" id="ai-panel-dx">
<textarea id="ai-input-dx" placeholder="Describe what diagnoses you need, e.g. 'all types of diabetes including type 1 and type 2'"></textarea>
<div class="ai-actions">
<button class="btn btn-ai" onclick="DictApp.runAiExpand('dx')">★ Generate Keywords with AI</button>
<span class="ai-status" id="ai-status-dx"></span>
<span class="ai-hint">Tip: Be specific about what codes you need. The AI will generate comprehensive search keywords.</span>
</div>
</div>
<div class="tab-actions">
<button class="btn btn-success" onclick="DictApp.downloadCsv('dx')" title="Downloads all matching rows. Each row has a desired column (TRUE/FALSE) you can edit.">⇩ Download Matching Rows</button>
<button class="btn btn-crdw" onclick="DictApp.sendToCrdw('dx')" title="Push SS files directly to the project's GitHub repo">▶ Send to CRDW</button>
</div>
<div class="search-help">
<button class="search-help-toggle" onclick="this.parentElement.classList.toggle('open')">
How to search <span class="toggle-arrow">▼</span>
</button>
<div class="search-help-content">
<ul>
<li><strong>Add a keyword:</strong> Type a word and press <kbd>Enter</kbd> or <kbd>,</kbd> — it becomes a filter chip.</li>
<li><strong>Multiple keywords:</strong> Add as many chips as you need. Rows matching <em>any</em> keyword are shown (OR logic).</li>
<li><strong>Wildcard:</strong> Use <code>*</code> for partial matching — e.g. <code>ovar*</code> matches "ovary", "ovarian", etc.</li>
<li><strong>Paste a list:</strong> Paste comma-separated terms (e.g. <code>breast, ovar*, C50</code>) and each becomes its own chip.</li>
<li><strong>Remove a chip:</strong> Click the × on any chip, or press <kbd>Backspace</kbd> when the input is empty.</li>
<li><strong>AI Expand:</strong> Click the <em>★ AI Expand</em> button and describe what you need in plain language (e.g. “all diagnoses related to hypertension”). The AI will generate a comprehensive list of search keywords — including related terms you might not think of — and add them as chips automatically. Requires an API key (see Settings).</li>
<li><strong>Desired column:</strong> All matching rows default to <em>checked</em>. Uncheck any you don't want. The downloaded CSV includes all matching rows with a <code>desired</code> column (TRUE/FALSE).</li>
<li><strong>Category column:</strong> Click any row's Category cell to type a free-text label (e.g. "obesity-related", "age-related"). Categories are saved in the CSV so you can group rows by purpose.</li>
</ul>
</div>
</div>
<div class="status-bar" id="status-dx">
<div class="status-stats">
<span class="stat">Total in dictionary: <span class="stat-value" id="total-dx">0</span></span>
<span class="stat">Matching filter: <span class="stat-value" id="visible-dx">0</span></span>
<span class="stat">Checked (desired): <span class="desired-count" id="desired-dx">0</span></span>
</div>
<div class="bulk-actions">
<button class="btn btn-secondary" onclick="DictApp.selectAllVisible('dx')">Check All</button>
<button class="btn btn-secondary" onclick="DictApp.deselectAll('dx')">Uncheck All</button>
</div>
</div>
<table id="table-dx" class="display" style="width:100%">
<thead>
<tr>
<th>Desired</th>
<th>Concept ID</th>
<th>Vocabulary</th>
<th>ICD Code</th>
<th>Description</th>
<th>Category</th>
<th>Keyword Matched</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<!-- ---- Medications Tab ---- -->
<div class="tab-content" id="tab-medication">
<div class="search-action-bar">
<div class="keyword-search-wrapper" id="kw-wrapper-medication">
<span class="search-icon">🔍</span>
<div class="keyword-chips" id="kw-chips-medication"></div>
<input type="text" id="search-medication"
placeholder="Type keyword + Enter (e.g. metformin, insulin*)"
class="keyword-input">
</div>
<button class="btn btn-secondary btn-clear-kw" onclick="DictApp.clearKeywords('medication')" title="Clear all keywords" style="display:none" id="btn-clear-kw-medication">✕ Clear</button>
</div>
<div class="ai-panel visible" id="ai-panel-medication">
<textarea id="ai-input-medication" placeholder="Describe what medications you need, e.g. 'all GLP-1 receptor agonists including brand names'"></textarea>
<div class="ai-actions">
<button class="btn btn-ai" onclick="DictApp.runAiExpand('medication')">★ Generate Keywords with AI</button>
<span class="ai-status" id="ai-status-medication"></span>
<span class="ai-hint">Tip: Include drug classes, brand names, or therapeutic categories.</span>
</div>
</div>
<div class="tab-actions">
<button class="btn btn-success" onclick="DictApp.downloadCsv('medication')" title="Downloads all matching rows. Each row has a desired column (TRUE/FALSE) you can edit.">⇩ Download Matching Rows</button>
<button class="btn btn-crdw" onclick="DictApp.sendToCrdw('medication')" title="Push SS files directly to the project's GitHub repo">▶ Send to CRDW</button>
</div>
<div class="search-help">
<button class="search-help-toggle" onclick="this.parentElement.classList.toggle('open')">
How to search <span class="toggle-arrow">▼</span>
</button>
<div class="search-help-content">
<ul>
<li><strong>Add a keyword:</strong> Type a word and press <kbd>Enter</kbd> or <kbd>,</kbd> — it becomes a filter chip.</li>
<li><strong>Multiple keywords:</strong> Add as many chips as you need. Rows matching <em>any</em> keyword are shown (OR logic).</li>
<li><strong>Wildcard:</strong> Use <code>*</code> for partial matching — e.g. <code>insulin*</code> matches "insulin lispro", "insulin glargine", etc.</li>
<li><strong>Paste a list:</strong> Paste comma-separated terms and each becomes its own chip.</li>
<li><strong>Remove a chip:</strong> Click the × on any chip, or press <kbd>Backspace</kbd> when the input is empty.</li>
<li><strong>AI Expand:</strong> Click the <em>★ AI Expand</em> button and describe what you need in plain language (e.g. “all GLP-1 receptor agonists including brand names”). The AI will generate a comprehensive keyword list — every generic name, brand name, and variant — and add them as chips automatically. Requires an API key (see Settings).</li>
<li><strong>Desired column:</strong> All matching rows default to <em>checked</em>. Uncheck any you don't want. The downloaded CSV includes all matching rows with a <code>desired</code> column (TRUE/FALSE).</li>
<li><strong>Category column:</strong> Click any row's Category cell to type a free-text label (e.g. "obesity-related", "age-related"). Categories are saved in the CSV so you can group rows by purpose.</li>
</ul>
</div>
</div>
<div class="med-filters" id="med-filters">
<div>
<label for="filter-pharm-class">Route</label>
<select id="filter-pharm-class">
<option value="">All Routes</option>
</select>
</div>
<div style="display:none">
<label for="filter-pharm-subclass">Pharmaceutical Subclass</label>
<select id="filter-pharm-subclass">
<option value="">N/A</option>
</select>
</div>
<div>
<label for="filter-source-system">Source System</label>
<select id="filter-source-system">
<option value="">All Systems</option>
</select>
</div>
</div>
<div class="status-bar" id="status-medication">
<div class="status-stats">
<span class="stat">Total in dictionary: <span class="stat-value" id="total-medication">0</span></span>
<span class="stat">Matching filter: <span class="stat-value" id="visible-medication">0</span></span>
<span class="stat">Checked (desired): <span class="desired-count" id="desired-medication">0</span></span>
</div>
<div class="bulk-actions">
<button class="btn btn-secondary" onclick="DictApp.selectAllVisible('medication')">Check All</button>
<button class="btn btn-secondary" onclick="DictApp.deselectAll('medication')">Uncheck All</button>
</div>
</div>
<table id="table-medication" class="display" style="width:100%">
<thead>
<tr>
<th>Desired</th>
<th>Source</th>
<th>Key/Mnemonic</th>
<th>Name</th>
<th>Generic Name</th>
<th>Pharm Class</th>
<th>Pharm Subclass</th>
<th>Category</th>
<th>Keyword Matched</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<!-- ---- Labs Tab ---- -->
<div class="tab-content" id="tab-lab">
<div class="search-action-bar">
<div class="keyword-search-wrapper" id="kw-wrapper-lab">
<span class="search-icon">🔍</span>
<div class="keyword-chips" id="kw-chips-lab"></div>
<input type="text" id="search-lab"
placeholder="Type keyword + Enter (e.g. hemoglobin, A1c, glucose*)"
class="keyword-input">
</div>
<button class="btn btn-secondary btn-clear-kw" onclick="DictApp.clearKeywords('lab')" title="Clear all keywords" style="display:none" id="btn-clear-kw-lab">✕ Clear</button>
</div>
<div class="ai-panel visible" id="ai-panel-lab">
<textarea id="ai-input-lab" placeholder="Describe what lab values you need, e.g. 'complete metabolic panel' or 'renal function labs'"></textarea>
<div class="ai-actions">
<button class="btn btn-ai" onclick="DictApp.runAiExpand('lab')">★ Generate Keywords with AI</button>
<span class="ai-status" id="ai-status-lab"></span>
<span class="ai-hint">Tip: Use panel names (CBC, CMP) and the AI will expand to all analytes.</span>
</div>
</div>
<div class="tab-actions">
<button class="btn btn-success" onclick="DictApp.downloadCsv('lab')" title="Downloads all matching rows. Each row has a desired column (TRUE/FALSE) you can edit.">⇩ Download Matching Rows</button>
<button class="btn btn-crdw" onclick="DictApp.sendToCrdw('lab')" title="Push SS files directly to the project's GitHub repo">▶ Send to CRDW</button>
</div>
<div class="search-help">
<button class="search-help-toggle" onclick="this.parentElement.classList.toggle('open')">
How to search <span class="toggle-arrow">▼</span>
</button>
<div class="search-help-content">
<ul>
<li><strong>Add a keyword:</strong> Type a word and press <kbd>Enter</kbd> or <kbd>,</kbd> — it becomes a filter chip.</li>
<li><strong>Multiple keywords:</strong> Add as many chips as you need. Rows matching <em>any</em> keyword are shown (OR logic).</li>
<li><strong>Wildcard:</strong> Use <code>*</code> for partial matching — e.g. <code>glucose*</code> matches "glucose", "glucose fasting", etc.</li>
<li><strong>Paste a list:</strong> Paste comma-separated terms and each becomes its own chip.</li>
<li><strong>Remove a chip:</strong> Click the × on any chip, or press <kbd>Backspace</kbd> when the input is empty.</li>
<li><strong>AI Expand:</strong> Click the <em>★ AI Expand</em> button and describe what you need in plain language (e.g. “complete metabolic panel” or “all renal function labs”). The AI will expand panel names into every individual analyte (e.g. CBC → hemoglobin, hematocrit, WBC, RBC, platelets, etc.) and add them as chips automatically. Requires an API key (see Settings).</li>
<li><strong>Desired column:</strong> All matching rows default to <em>checked</em>. Uncheck any you don't want. The downloaded CSV includes all matching rows with a <code>desired</code> column (TRUE/FALSE).</li>
<li><strong>Category column:</strong> Click any row's Category cell to type a free-text label (e.g. "obesity-related", "age-related"). Categories are saved in the CSV so you can group rows by purpose.</li>
</ul>
</div>
</div>
<div class="status-bar" id="status-lab">
<div class="status-stats">
<span class="stat">Total in dictionary: <span class="stat-value" id="total-lab">0</span></span>
<span class="stat">Matching filter: <span class="stat-value" id="visible-lab">0</span></span>
<span class="stat">Checked (desired): <span class="desired-count" id="desired-lab">0</span></span>
</div>
<div class="bulk-actions">
<button class="btn btn-secondary" onclick="DictApp.selectAllVisible('lab')">Check All</button>
<button class="btn btn-secondary" onclick="DictApp.deselectAll('lab')">Uncheck All</button>
</div>
</div>
<table id="table-lab" class="display" style="width:100%">
<thead>
<tr>
<th>Desired</th>
<th>Source</th>
<th>Key/Print#</th>
<th>Name</th>
<th>Common Name</th>
<th>LOINC</th>
<th>Units</th>
<th>Category</th>
<th>Keyword Matched</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<!-- ---- Locations Tab ---- -->
<div class="tab-content" id="tab-location">
<div class="search-action-bar">
<div class="keyword-search-wrapper" id="kw-wrapper-location">
<span class="search-icon">🔍</span>
<div class="keyword-chips" id="kw-chips-location"></div>
<input type="text" id="search-location"
placeholder="Type keyword + Enter (e.g. cardio*, oncology, OU Health)"
class="keyword-input">
</div>
<button class="btn btn-secondary btn-clear-kw" onclick="DictApp.clearKeywords('location')" title="Clear all keywords" style="display:none" id="btn-clear-kw-location">✕ Clear</button>
</div>
<div class="ai-panel visible" id="ai-panel-location">
<textarea id="ai-input-location" placeholder="Describe what locations you need, e.g. 'all cardiology clinics and cardiac units'"></textarea>
<div class="ai-actions">
<button class="btn btn-ai" onclick="DictApp.runAiExpand('location')">★ Generate Keywords with AI</button>
<span class="ai-status" id="ai-status-location"></span>
<span class="ai-hint">Tip: Describe the specialty, department type, or location names you need.</span>
</div>
</div>
<div class="tab-actions">
<button class="btn btn-success" onclick="DictApp.downloadCsv('location')" title="Downloads all matching rows. Each row has a desired column (TRUE/FALSE) you can edit.">⇩ Download Matching Rows</button>
<button class="btn btn-crdw" onclick="DictApp.sendToCrdw('location')" title="Push SS files directly to the project's GitHub repo">▶ Send to CRDW</button>
</div>
<div class="search-help">
<button class="search-help-toggle" onclick="this.parentElement.classList.toggle('open')">
How to search <span class="toggle-arrow">▼</span>
</button>
<div class="search-help-content">
<ul>
<li><strong>Add a keyword:</strong> Type a word and press <kbd>Enter</kbd> or <kbd>,</kbd> — it becomes a filter chip.</li>
<li><strong>Multiple keywords:</strong> Add as many chips as you need. Rows matching <em>any</em> keyword are shown (OR logic).</li>
<li><strong>Wildcard:</strong> Use <code>*</code> for partial matching — e.g. <code>cardio*</code> matches "cardiology", "cardiovascular", etc.</li>
<li><strong>Paste a list:</strong> Paste comma-separated terms and each becomes its own chip.</li>
<li><strong>Remove a chip:</strong> Click the × on any chip, or press <kbd>Backspace</kbd> when the input is empty.</li>
<li><strong>AI Expand:</strong> Click the <em>★ AI Expand</em> button and describe what you need in plain language (e.g. “all cardiology clinics and cardiac surgery units”). The AI will generate a comprehensive list of department and specialty keywords and add them as chips automatically. Requires an API key (see Settings).</li>
<li><strong>Desired column:</strong> All matching rows default to <em>checked</em>. Uncheck any you don't want. The downloaded CSV includes all matching rows with a <code>desired</code> column (TRUE/FALSE).</li>
<li><strong>Category column:</strong> Click any row's Category cell to type a free-text label (e.g. "obesity-related", "age-related"). Categories are saved in the CSV so you can group rows by purpose.</li>
</ul>
</div>
</div>
<div class="status-bar" id="status-location">
<div class="status-stats">
<span class="stat">Total in dictionary: <span class="stat-value" id="total-location">0</span></span>
<span class="stat">Matching filter: <span class="stat-value" id="visible-location">0</span></span>
<span class="stat">Checked (desired): <span class="desired-count" id="desired-location">0</span></span>
</div>
<div class="bulk-actions">
<button class="btn btn-secondary" onclick="DictApp.selectAllVisible('location')">Check All</button>
<button class="btn btn-secondary" onclick="DictApp.deselectAll('location')">Uncheck All</button>
</div>
</div>
<table id="table-location" class="display" style="width:100%">
<thead>
<tr>
<th>Desired</th>
<th>Source</th>
<th>Key/Mnemonic</th>
<th>Name</th>
<th>Specialty/Type</th>
<th>Location/Facility</th>
<th>Category</th>
<th>Keyword Matched</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<!-- ---- Procedures Tab ---- -->
<div class="tab-content" id="tab-procedure">
<div class="search-action-bar">
<div class="keyword-search-wrapper" id="kw-wrapper-procedure">
<span class="search-icon">🔍</span>
<div class="keyword-chips" id="kw-chips-procedure"></div>
<input type="text" id="search-procedure"
placeholder="Type keyword + Enter (e.g. cataract, vitrectomy*)"
class="keyword-input">
</div>
<button class="btn btn-secondary btn-clear-kw" onclick="DictApp.clearKeywords('procedure')" title="Clear all keywords" style="display:none" id="btn-clear-kw-procedure">✕ Clear</button>
</div>
<div class="ai-panel visible" id="ai-panel-procedure">
<textarea id="ai-input-procedure" placeholder="Describe what procedures you need, e.g. 'cataract surgery and retinal procedures'"></textarea>
<div class="ai-actions">
<button class="btn btn-ai" onclick="DictApp.runAiExpand('procedure')">★ Generate Keywords with AI</button>
<span class="ai-status" id="ai-status-procedure"></span>
<span class="ai-hint">Tip: Include procedure types, CPT descriptions, or surgical specialties.</span>
</div>
</div>
<div class="tab-actions">
<button class="btn btn-success" onclick="DictApp.downloadCsv('procedure')" title="Downloads all matching rows. Each row has a desired column (TRUE/FALSE) you can edit.">⇩ Download Matching Rows</button>
<button class="btn btn-crdw" onclick="DictApp.sendToCrdw('procedure')" title="Push SS files directly to the project's GitHub repo">▶ Send to CRDW</button>
</div>
<div class="search-help">
<button class="search-help-toggle" onclick="this.parentElement.classList.toggle('open')">
How to search <span class="toggle-arrow">▼</span>
</button>
<div class="search-help-content">
<ul>
<li><strong>Add a keyword:</strong> Type a word and press <kbd>Enter</kbd> or <kbd>,</kbd> — it becomes a filter chip.</li>
<li><strong>Multiple keywords:</strong> Add as many chips as you need. Rows matching <em>any</em> keyword are shown (OR logic).</li>
<li><strong>Wildcard:</strong> Use <code>*</code> for partial matching — e.g. <code>vitrect*</code> matches "vitrectomy", "vitrectomies", etc.</li>
<li><strong>Paste a list:</strong> Paste comma-separated terms and each becomes its own chip.</li>
<li><strong>Remove a chip:</strong> Click the × on any chip, or press <kbd>Backspace</kbd> when the input is empty.</li>
<li><strong>Source:</strong> Date range determines which system is shown. Before 2023-06-03 → GECB (CPT billing); on or after → Epic.</li>
<li><strong>AI Expand:</strong> Click the <em>★ AI Expand</em> button and describe what you need in plain language (e.g. “all cataract and retinal surgery procedures”). Requires an API key (see Settings).</li>
</ul>
</div>
</div>
<div class="status-bar" id="status-procedure">
<div class="status-stats">
<span class="stat">Total in dictionary: <span class="stat-value" id="total-procedure">0</span></span>
<span class="stat">Matching filter: <span class="stat-value" id="visible-procedure">0</span></span>
<span class="stat">Checked (desired): <span class="desired-count" id="desired-procedure">0</span></span>
</div>
<div class="bulk-actions">
<button class="btn btn-secondary" onclick="DictApp.selectAllVisible('procedure')">Check All</button>
<button class="btn btn-secondary" onclick="DictApp.deselectAll('procedure')">Uncheck All</button>
</div>
</div>
<table id="table-procedure" class="display" style="width:100%">
<thead>
<tr>
<th>Desired</th>
<th>Source</th>
<th>Procedure Name</th>
<th>Short Name</th>
<th>CPT Code</th>
<th>Category</th>
<th>Vocabulary</th>
<th>Keyword Matched</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<!-- ---- Loading Overlay ---- -->
<div class="loading-overlay" id="loading-overlay">
<div class="loading-spinner"></div>
</div>
<!-- ---- Toast ---- -->
<div class="toast" id="toast"></div>
<!-- ---- Scripts ---- -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.4.1/papaparse.min.js"></script>
<script src="js/system-logic.js"></script>
<script src="js/search.js"></script>
<script src="js/csv-download.js"></script>
<script src="js/github-push.js"></script>
<script src="js/ai-expand.js"></script>
<script src="js/data-embedded.js"></script>
<script src="js/app.js"></script>
</body>
</html>