pediatric-ai-scribe-v3/public/components
Daniel d859c8c5a9 feat(extensions): personal Pagers & Extensions directory with soft-delete
New top-level tab positioned after Physical Exam Guide. Per-user
directory of hospital phone extensions and pagers — grouped by location
then type, searchable, soft-deleted.

Data:
- New table user_phone_extensions (id, user_id, location, name, number,
  type CHECK (extension|pager), notes, trashed_at, timestamps).
  Partial indexes on active vs trashed rows for fast filtering.
- Not PHI — hospital internal phone directory. Plaintext.

API (all user-scoped, all params validated):
- GET    /api/extensions?trash=1&q=text  — list active or trash, optional search
- POST   /api/extensions                  — create
- PUT    /api/extensions/:id              — update (requires all three core fields)
- DELETE /api/extensions/:id              — soft-delete (sets trashed_at)
- POST   /api/extensions/:id/restore      — un-trash
- DELETE /api/extensions/:id/purge        — hard-delete (only if trashed)

All :id params parsed + validated (positive integer) before query.
All queries parameterized, every WHERE includes user_id scoping.

UI (public/js/extensions.js + components/extensions.html):
- Search bar with 200ms debounce, server-side LIKE on location/name/number/notes
- Add button expands inline form — location (with datalist of existing
  locations for autocomplete), name/dept, number, type, optional notes
- Each entry renders as a card: big monospace number, dept, type badge,
  edit + delete inline
- Grouped by location → type (Extensions / Pagers subheaders)
- Trash view: toggle shows trashed items with Restore + Purge actions
- Trash count badge on the Trash button updates after every delete/restore
- Delete requires confirm() dialog, then soft-delete (easy to undo)
- Purge from trash requires a second confirm() ("cannot be undone")
- Esc closes the form; form resets between Add and Edit
2026-04-22 18:54:26 +02:00
..
admin.html Replace all browser dialogs with modern modal, add OIDC admin UI 2026-04-09 02:43:23 +02:00
calculators.html fix(bilirubin-ui): clarify neurotoxicity-risk-factor label + expandable AAP 2022 list 2026-04-22 13:11:34 +02:00
catchup.html Fix quiz SQL bug, security hardening, componentize HTML, speed improvements 2026-03-23 20:01:54 -04:00
chart.html v10: Local Whisper transcription, bigger text areas, flexible AI memory 2026-03-28 22:00:30 +00:00
cms.html v6.1: Turnstile bot protection, LiteLLM provider, PPTX tables, audio backup fixes, docs 2026-04-04 22:56:24 +02:00
dictation.html v10: Local Whisper transcription, bigger text areas, flexible AI memory 2026-03-28 22:00:30 +00:00
encounter.html Fix TTS axios/Vertex, generic toast, add stop button to encounter 2026-03-29 22:09:56 -04:00
extensions.html feat(extensions): personal Pagers & Extensions directory with soft-delete 2026-04-22 18:54:26 +02:00
faq.html Add automatic ICD-10 and CPT billing code suggestions 2026-04-11 01:50:17 +02:00
hospital.html v10: Local Whisper transcription, bigger text areas, flexible AI memory 2026-03-28 22:00:30 +00:00
learning.html Render presentations as slides in Learning Hub viewer 2026-03-24 03:04:14 -04:00
pe-guide.html feat(pe-guide): Physical Exam Guide tab — OSCE reference + narrative report 2026-04-22 16:52:13 +02:00
settings.html Hide Active Sessions for SSO-only users 2026-04-14 05:07:07 +02:00
sickvisit.html v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
soap.html Add pause/stop buttons to SOAP note recording 2026-04-11 05:19:12 +02:00
vaxschedule.html Fix quiz SQL bug, security hardening, componentize HTML, speed improvements 2026-03-23 20:01:54 -04:00
wellvisit.html v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00