Commit graph

44 commits

Author SHA1 Message Date
Daniel Onyejesi
a6b6d0dffb Revert: undo model selector color-scheme overrides (local Adwaita theme issue, not a code bug) 2026-03-22 19:23:47 -04:00
Daniel Onyejesi
2cd0eaa511 Fix: force color-scheme on model selects to prevent OS dark mode bleed-through 2026-03-22 19:18:51 -04:00
Daniel Onyejesi
38d07ff37f Feat: v2.7 — sidebar UX, well visit subtabs, larger boxes, sick visit reorder
- Remove duplicate milestones sidebar button; well visit button now works correctly
- Move Sick Visit sidebar entry to just below Well Visit (before Vaccine/Catch-Up)
- Sick Visit remains its own standalone tab (not a subtab)
- Well Visit subtabs: By Visit Age | Milestones | SSHADESS (12+) | Visit Note
- Dramatically larger transcript boxes (min-height 240px, max-height 600px)
- Dramatically larger note output boxes (min-height 480px) — beautiful scrollable
- Collapsible desktop sidebar with localStorage persistence
- Update README with full feature list
- Bump docker-compose to v2.7
2026-03-22 19:14:41 -04:00
Daniel Onyejesi
78730a669f Bump image to v2.6 2026-03-22 19:00:29 -04:00
Daniel Onyejesi
aecf72453f Fix: milestones copy-to-note auto-navigates; add 6-11y milestone data
- Copy to Note button now switches to Well Visit → Visit Note subtab
  automatically so user sees the result immediately
- Add complete AAP/Nelson developmental milestones for ages 6, 7, 8, 9,
  10, and 11 years (Gross Motor, Fine Motor, Language, Social/Emotional,
  Cognitive domains each)
- Add corresponding age options to ms-age-group select
2026-03-22 19:00:02 -04:00
Daniel Onyejesi
2e4d0f1f6e Bump image to v2.5 2026-03-22 18:52:35 -04:00
Daniel Onyejesi
90c7bc35af Feat: milestones under well visit, standalone schedule tabs, remove admin models
- Move Milestones from standalone tab to well visit subtab (wv-panel-milestones)
  with 'Copy to Note' button that fills Developmental Assessment card in Visit Note
- Sidebar Milestones button now navigates to Well Visit → Milestones subtab
- Move Full Vaccine Schedule → standalone sidebar tab (vaxschedule-tab)
- Move Catch-Up Schedule → standalone sidebar tab (catchup-tab)
- Add Developmental Assessment textarea (wv-milestones-text) to Visit Note panel
- Remove AI Models management from admin panel (was failing to load)
- switchSubtab scoped to wellvisit-tab so standalone schedule panels unaffected
- Expose window.wvSwitchSubtab for cross-module subtab switching
2026-03-22 18:52:11 -04:00
Daniel Onyejesi
bfa832713d Bump docker-compose image to v2.4 2026-03-22 18:34:07 -04:00
Daniel Onyejesi
2da4401d80 Fix: admin models/2FA loading, save doubles, sidebar collapse, SSHADESS copy
- Fix 2FA status stuck at "Loading...": export load2FAStatus globally so
  app.js tabChanged handler can call it when navigating via sidebar
- Fix admin models silent failure: add error message + retry button on catch
- Fix save encounter doubles: persist _savedEncId_* to sessionStorage so
  page refresh reuses existing record instead of inserting a duplicate;
  add _savingInProgress guard to prevent race-condition double-saves
- Desktop sidebar collapsible: add collapse/expand buttons (not collapsed
  by default), state saved to localStorage; hidden on mobile
- Copy to Visit Note now also copies SSHADESS assessment to wv-shadess-text
- Store selected visit age in window._wellVisitAge + sessionStorage so
  other tabs can read the patient's age
- Bigger screening/vaccine boxes: min-height on wv-vax-list, wv-screen-list,
  wv-visit-detail; slightly more padding on vaccine items
- Wire New Patient (clearTab) buttons to document click handler
2026-03-22 18:33:28 -04:00
Daniel Onyejesi
3449b0efca Fix: save/load encounters — hidden popovers, label IDs, note IDs
- CSS: .enc-load-popover.hidden now overrides display:flex (specificity bug
  caused popovers to always be visible)
- resumeEncounter: add domPfxMap to correctly resolve label element IDs
  (enc_type 'wellvisit' → 'wv-label', 'hospital' → 'hosp-label', etc.)
- resumeEncounter: use noteIdMap to find the right output element per tab
- resumeEncounter: use enc.enc_type (not tabName) as _savedEncId_ key for
  consistency with saveFromTab
2026-03-22 17:39:04 -04:00
Daniel Onyejesi
9544d43b16 Chore: bump production docker image to v2.3 2026-03-22 17:18:06 -04:00
Daniel Onyejesi
56b8961a55 Feat: left sidebar nav, tab persistence, admin models fix, hospital/chart save
- Replace horizontal tab-nav with collapsible left sidebar (sticky desktop, slide-in mobile with hamburger toggle)
- Fix tab persistence: use localStorage instead of URL hash; restore last tab after login in enterApp()
- Fix admin CMS models loading: move autoDeleteDays read inside .then() callback (was ReferenceError), switch admin loading from click-only to tabChanged event
- Add Save/Load bars to Hospital Course and Chart Review tabs with popover support
- Add wv (well visit) save handler in encounters.js
- Register load handlers for hospital and chart tabs
- Expand popover prefix list to include hosp and chart
2026-03-22 17:17:45 -04:00
Daniel Onyejesi
075353886e Chore: bump production image tag to v2.2 2026-03-22 16:57:08 -04:00
Daniel Onyejesi
8317708bb6 Fix: load popover positioning, delete button, ICD-10 live search
- Wrap save-bar + popover in .save-bar-wrap (position:relative) so the
  absolute-positioned popover anchors correctly below the Load button
  (previously popovers were outside the save-bar, so had no positioned
  ancestor and appeared at the wrong place on screen)
- Remove confirm() dialog from deleteEncounter — encounter disappears
  immediately from the popover list after deletion
- ICD-10 diagnoses: replace static-only lookup with live NLM Clinical
  Tables API search (clinicaltables.nlm.nih.gov) with 280ms debounce;
  results appear in a dropdown below the search input; Enter/click selects
- Add clinicaltables.nlm.nih.gov to CSP connect-src
- Drop unused position:relative from .save-bar (now on .save-bar-wrap)
2026-03-22 16:56:28 -04:00
Daniel Onyejesi
d4759fcf58 Chore: bump production image tag to v2.1 2026-03-22 16:44:27 -04:00
Daniel Onyejesi
5dd08f8da3 Feat: admin CMS, save/resume encounters, user templates, SSHADESS, well visit notes, sick visit, ROS/PE checklists, ICD-10 diagnoses
- Admin CMS: announcements, feature flags, email templates, AI prompts, SMTP, model management, reset-to-defaults
- Save/resume encounter progress with 7-day auto-expiry and patient labels
- Inline searchable load popover (replaces settings-modal redirect)
- User memory/template system (physical exam, ROS, encounter format, etc.)
- SSHADESS psychosocial screening form (8 domains, listen-in recording)
- Well visit note generation with vitals, vaccines, screenings, SSHADESS
- Interactive screenings/vaccines status buttons (Done/Refused/Already Given/N/A)
- ROS 15-system checklist + PE 17-system checklist in well visit note tab
- ICD-10 diagnoses tag picker (28 common pediatric codes + free text)
- Simple sick visit tab: chief complaint, inferred ROS (4) + PE (7), diagnoses, generate note
- Settings converted from modal to full-page tab
- Fix: /api/models moved before authenticated routes (was returning 401 → empty model selector)
- Fix: getUserMemoryContext always fetches from API regardless of cache state
- Pause/resume recording on all recording tabs
- Site-level SMTP config stored in DB; ElevenLabs TTS with browser fallback
2026-03-22 16:43:39 -04:00
Daniel Onyejesi
cd73bec5f8 Feat: add stethoscope+pencil favicon in SVG, ICO, and PNG sizes 2026-03-22 14:09:18 -04:00
Daniel Onyejesi
93338567e8 Feat: restore ElevenLabs Adam voice for read aloud with browser TTS fallback; add client-side error logging 2026-03-22 12:27:17 -04:00
Daniel Onyejesi
e74c0ccb0c Fix: clear password fields after autofill delay and add autocomplete=off on login form 2026-03-22 12:18:29 -04:00
Daniel Onyejesi
39a1affcbc Fix: clear password fields, remove has-session class, and reset hash on logout 2026-03-22 12:13:41 -04:00
Daniel Onyejesi
a2481a0ea7 Fix: service worker only intercepts same-origin requests, preventing CDN fetch errors 2026-03-22 00:41:24 -04:00
Daniel Onyejesi
12189a0101 Fix: eliminate auth screen flash by hiding it synchronously in <head> before render 2026-03-22 00:36:20 -04:00
Daniel Onyejesi
393cb3f1e0 Fix: hide auth screen immediately on load if token exists, preventing login flash 2026-03-22 00:31:49 -04:00
Daniel Onyejesi
0c2d3398e0 Feat: persist active tab in URL hash across page refreshes 2026-03-22 00:26:13 -04:00
Daniel Onyejesi
9b1766837d Bump image tag to v1.2 in docker-compose.yml 2026-03-22 00:16:51 -04:00
Daniel Onyejesi
9c476b520a Fix: init Well Visit tab on DOMContentLoaded instead of lazy tabChanged event 2026-03-22 00:10:46 -04:00
Daniel Onyejesi
383fa2b149 Fix: remove build context from docker-compose so production always pulls from Docker Hub 2026-03-22 00:02:52 -04:00
Daniel Onyejesi
f64e84fa1e Fix: use versioned Docker tag v1.1 instead of latest
Prevents Docker from skipping pulls when tag name hasn't changed.
2026-03-21 23:59:10 -04:00
Daniel Onyejesi
362eaadeb0 Fix: set no-cache headers for HTML, short cache for JS/CSS
Prevents Caddy/browser from caching index.html across deployments.
2026-03-21 23:54:48 -04:00
Daniel Onyejesi
f154adf032 Fix: add missing Dengue and Mpox labels to VACCINE_FULL_NAMES 2026-03-21 23:44:12 -04:00
Daniel Onyejesi
a51dd8e788 Feat: add Well Visit / Preventive Care tab with AAP 2025 data
- Add Well Visit tab with three sub-views: By Visit Age, Full Vaccine Schedule, Catch-Up Schedule
- By Visit Age: shows ICD-10/CPT billing codes, vaccines due with dose info, measurements, sensory/developmental/behavioral/procedure screenings, oral health, notes
- Full Schedule: scrollable table of all vaccines vs all visit ages
- Catch-Up Schedule: per-vaccine minimum ages, intervals, and catch-up notes per CDC 2025
- Add pediatricScheduleData.js (1719-line AAP 2025 Bright Futures dataset)
- Add wellVisit.js for tab logic (lazy-initialized on first tab activation)
- Fire tabChanged CustomEvent on tab switch for lazy initialization
- Add Well Visit CSS styles to styles.css
2026-03-21 23:19:24 -04:00
Daniel Onyejesi
95cae5e5f2 Fix: milestone list — achieved states naturally, not-achieved uses Cannot/Does not
Achieved: 'Stands on one foot' (not 'Can stand on one foot')
Not achieved: 'Cannot stand on one foot' / 'Does not yet use 2-word sentences'
2026-03-21 22:48:26 -04:00
Daniel Onyejesi
a9fbf7a003 Fix: milestone list uses natural language sentences instead of X/checkmark
Replace checkmark/X symbol format with plain numbered sentences:
achieved → 'Can walk independently'
not achieved → 'Cannot walk' / 'Does not yet use 2-word sentences'
2026-03-21 22:45:55 -04:00
Daniel Onyejesi
e3d4ab5949 Improve email templates and update README
- Replace bare-bones email HTML with branded templates: gradient header,
  action button, plain-text URL fallback, security footer notice
- Welcome/verify email: friendly greeting with user's name
- Password reset email: clear instructions, 1-hour expiry notice,
  explicit 'if you didn't request this, ignore it' message
- README: updated features list, vendor model 4.6 models, plain-text output note
2026-03-21 22:43:19 -04:00
Daniel Onyejesi
3e4ebe579e Fix: add scriptSrcAttr unsafe-inline to allow onclick handlers
Helmet 8 adds script-src-attr: 'none' by default which blocks ALL
inline event attribute handlers (onclick, onchange, etc.) regardless
of script-src unsafe-inline. This silently broke every onclick button:
copy, read aloud, nextcloud upload, generate, record, etc.
2026-03-21 22:12:17 -04:00
Daniel Onyejesi
9f2dee0875 Fix: update all Font Awesome 5 icon names to Font Awesome 6
FA6 renamed many icons — using old FA5 names caused blank buttons/icons:
- fa-cloud-upload-alt    → fa-cloud-arrow-up   (Nextcloud upload button)
- fa-sign-out-alt        → fa-right-from-bracket (logout button)
- fa-magic               → fa-wand-magic-sparkles (all Generate buttons)
- fa-volume-up           → fa-volume-high      (all Read buttons + stopReading)
- fa-compress-alt        → fa-compress         (Shorter + 3-Sentence Summary)
- fa-file-medical-alt    → fa-file-waveform    (SOAP tab header)
- fa-file-alt            → fa-file-lines       (Transcript/Input cards)
- fa-shield-alt          → fa-shield-halved    (HIPAA notice + 2FA section)
- fa-sync-alt            → fa-rotate           (Admin refresh button)
- fa-ambulance           → fa-truck-medical    (ED note section)
- fa-question-circle     → fa-circle-question  (What's Missing button)
2026-03-21 21:58:14 -04:00
Daniel Onyejesi
624e815226 Fix: expand CSP connectSrc for CDN/TTS; add vendor model 4.6 models
- CSP connectSrc was blocking service worker re-fetches to cdnjs.cloudflare.com
  causing Font Awesome icons to go blank (settings, logout, nextcloud buttons)
- Add cdnjs, googleapis, gstatic, google to connectSrc to fix icon rendering
  and Chrome Web Speech API (which connects to Google servers for TTS voices)
- Add vendor model Opus 4.6 and vendor model Sonnet 4.6 to all three provider lists
  (OpenRouter, Bedrock, Azure-compatible); Sonnet 4.6 now default for Bedrock
2026-03-21 21:43:00 -04:00
Daniel Onyejesi
12083a5ed1 Fix: revert speakText to sync speechSynthesis; robust copyText fallback
- speakText: revert async ElevenLabs fetch chain — browser requires
  speechSynthesis.speak() to be called synchronously within user gesture;
  async .catch() context caused silent failure across browsers
- copyText: fix fallback that always showed 'Copied!' even when it failed;
  now shows real error message, uses selectNodeContents for accuracy,
  handles missing clipboard API gracefully
2026-03-21 21:31:48 -04:00
Daniel Onyejesi
3ab109b84a Fix: enforce plain text output in all AI prompts (no markdown)
Add PLAIN TEXT ONLY rule to CORE_RULES so no prompt returns asterisks,
pound signs, or other markdown symbols — output is copy-ready as-is.
2026-03-21 21:06:13 -04:00
Daniel Onyejesi
1f84a58813 Upgrade TTS to ElevenLabs Adam voice with frontend integration
- Switch speakText() to call /api/text-to-speech backend (ElevenLabs) with fallback to native speechSynthesis
- Upgrade ElevenLabs voice from Rachel to Adam (pNInz6obpgDQGcFmaJgB) — warmer, more professional
- Upgrade model from eleven_monolingual_v1 to eleven_turbo_v2_5 for better quality and lower latency
2026-03-21 20:55:50 -04:00
ifedan-ed
275b16ca9b Security: CSP, CORS origin lock, 1mb body limit, auth brute-force rate limits
- Enable Helmet CSP (scripts/styles/fonts/connect restricted to self + CDNs)
- Lock CORS to APP_URL origin in production (open in dev)
- Reduce JSON body limit from 50mb to 1mb
- Add per-route rate limits: login 10/15min, register 5/hr, forgot-pw 5/hr
- Add README with full setup, Docker Hub, provider switching, env reference
- Bump version to 3.0.0
2026-03-21 19:32:40 -04:00
ifedan-ed
a4b111c4d4 Add .dockerignore (exclude .env, .agent-config, node_modules, data) 2026-03-21 19:27:21 -04:00
ifedan-ed
ac8e7bb890 v3.0.0: Auth, admin panel, security fixes, per-tab model selector
- Add authMiddleware to all AI/transcribe routes (were unauthenticated)
- Add full admin panel: user management, registration toggle, stats
- Fix XSS in email verification (escape user.name in HTML)
- Fix missing APP_URL fallback in password reset email
- Add per-tab model selector (respects OpenRouter/Bedrock/Azure lists)
- Fix transcribeAudio to send Authorization header
- Fix labs input: textarea instead of single-line input
- Add structured logging: audit_log, api_log, access_log tables
- Add admin CLI (admin-cli.js) for Docker exec management
- Fix duplicate var duration declaration in ai.js catch block
- Fix RETURNING check case-sensitivity in database.js
2026-03-21 19:25:51 -04:00
ifedan-ed
565bec9ca8 v2.0.0: Pediatric AI Scribe
Features:
- Live encounter recording → HPI (outpatient/inpatient)
- Voice dictation → HPI / SOAP note
- Hospital course generator (prose/day-by-day/organ system/psych)
- Chart review / precharting (outpatient/subspecialty/ED)
- SOAP note generator (full/subjective only)
- Developmental milestones (AAP/Nelson) with narrative + 3-sentence summary
- AI refine & shorten for all outputs
- Ask AI what's missing (clarification)
- Authentication (email/password, email verification, 2FA)
- Nextcloud integration with auto date folders
- PWA support (installable on phone)
- 18+ AI models via OpenRouter
- HIPAA compliance guidance
- Docker support
2026-03-21 16:55:50 -04:00