- Fix: "missing FROM-clause entry for table q" in quiz submission query - Security: replace broken sanitizeHtml with allowlist-based sanitizer (prevents stored XSS) - Security: whitelist table names in uniqueSlug() to prevent SQL injection pattern - Security: replace raw err.message responses with generic errors in learning routes - Security: cap admin logs query LIMIT to 500 - Refactor: break 1685-line index.html into 12 lazy-loaded component files (280 lines shell) - Speed: add preconnect hints for Google Fonts and CDN - Speed: defer all script tags for faster initial paint - Speed: lazy-load tab HTML on activation (only active tab's DOM is parsed) - Update: replace HIPAA notice with institution-guidelines cautionary note
80 lines
4.7 KiB
HTML
80 lines
4.7 KiB
HTML
<div class="module-header">
|
|
<h2><i class="fas fa-comments"></i> Live Encounter → HPI</h2>
|
|
<p>Record doctor-patient conversation → AI generates structured HPI</p>
|
|
</div>
|
|
|
|
<div class="demographics-bar">
|
|
<div class="demo-field">
|
|
<label>Patient Age</label>
|
|
<input type="text" id="enc-age" placeholder="e.g., 4 years">
|
|
</div>
|
|
<div class="demo-field">
|
|
<label>Gender</label>
|
|
<select id="enc-gender"><option value="">Select</option><option>Male</option><option>Female</option></select>
|
|
</div>
|
|
<div class="demo-field">
|
|
<label>Setting</label>
|
|
<select id="enc-setting">
|
|
<option value="outpatient">Outpatient</option>
|
|
<option value="inpatient">Inpatient/Floors</option>
|
|
<option value="ed">Emergency Dept</option>
|
|
</select>
|
|
</div>
|
|
<div class="demo-field demo-field-model">
|
|
<label><i class="fas fa-robot"></i> Model</label>
|
|
<select class="tab-model-select"></select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Save/Load bar -->
|
|
<div class="save-bar-wrap">
|
|
<div class="save-bar" id="enc-save-bar">
|
|
<div style="display:flex;align-items:center;gap:8px;flex:1;">
|
|
<i class="fas fa-tag" style="color:var(--g400);font-size:13px;"></i>
|
|
<input type="text" id="enc-label" class="save-label-input" placeholder="Patient label (e.g. John D, Visit #42)">
|
|
</div>
|
|
<button id="btn-enc-save" class="btn-sm btn-ghost"><i class="fas fa-floppy-disk"></i> Save</button>
|
|
<button id="btn-enc-load" class="btn-sm btn-ghost"><i class="fas fa-folder-open"></i> Load</button>
|
|
<button id="btn-enc-new" class="btn-sm btn-ghost" title="Clear all and start new patient" style="color:var(--red);"><i class="fas fa-rotate-left"></i> New</button>
|
|
</div>
|
|
<div id="enc-load-popover" class="enc-load-popover hidden">
|
|
<div class="enc-load-popover-inner">
|
|
<input type="text" id="enc-load-search" class="enc-load-search" placeholder="Search saved encounters...">
|
|
<button class="enc-pop-close btn-sm btn-ghost"><i class="fas fa-times"></i></button>
|
|
</div>
|
|
<div id="enc-pop-list" class="enc-pop-list"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="record-controls">
|
|
<button id="enc-record-btn" class="record-btn"><i class="fas fa-microphone"></i><span>Start Recording</span></button>
|
|
<button id="enc-pause-btn" class="btn-sm btn-ghost hidden" style="margin-left:8px;"><i class="fas fa-pause"></i> Pause</button>
|
|
<div id="enc-recording-indicator" class="recording-indicator hidden"><div class="pulse-dot"></div><span>Recording... <span id="enc-timer">00:00</span></span></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header"><h3><i class="fas fa-file-lines"></i> Transcript</h3><button id="enc-clear" class="btn-sm btn-ghost"><i class="fas fa-eraser"></i> Clear</button></div>
|
|
<div id="enc-transcript" class="editable-box" contenteditable="true" data-placeholder="Transcript appears here or type/paste directly..."></div>
|
|
</div>
|
|
|
|
<button id="enc-generate-btn" class="btn-generate"><i class="fas fa-wand-magic-sparkles"></i> Generate HPI</button>
|
|
|
|
<div id="enc-output" class="card output-card hidden">
|
|
<div class="card-header output-header">
|
|
<h3><i class="fas fa-file-medical"></i> Generated HPI</h3>
|
|
<div class="output-actions">
|
|
<span id="enc-model-tag" class="model-tag"></span>
|
|
<button class="btn-sm btn-primary" onclick="copyText('enc-hpi-text')"><i class="fas fa-copy"></i> Copy</button>
|
|
<button class="btn-sm btn-ghost" onclick="speakText('enc-hpi-text')"><i class="fas fa-volume-high"></i> Read</button>
|
|
<button class="btn-sm btn-ghost" onclick="exportToNextcloud('enc-hpi-text','hpi-encounter')"><i class="fas fa-cloud-arrow-up"></i></button>
|
|
</div>
|
|
</div>
|
|
<div id="enc-hpi-text" class="output-text" contenteditable="true"></div>
|
|
<div class="refine-bar">
|
|
<input type="text" id="enc-refine-input" class="refine-input" placeholder="Tell AI to modify (e.g., 'make it shorter', 'add that patient has asthma history')">
|
|
<button class="btn-sm btn-primary" id="enc-refine-btn"><i class="fas fa-edit"></i> Refine</button>
|
|
<button class="btn-sm btn-ghost" id="enc-shorten-btn"><i class="fas fa-compress"></i> Shorter</button>
|
|
</div>
|
|
</div>
|