Commit graph

52 commits

Author SHA1 Message Date
Daniel
6d13765fc4 improve learning hub generation flow 2026-05-08 09:32:58 +02:00
Daniel
d8e9ba149e allow bedside respiratory without weight 2026-05-08 09:10:33 +02:00
Daniel
d71482037f destroy learning hub row editors 2026-05-08 09:05:13 +02:00
Daniel
2fec33dc4d convert learning hub to module 2026-05-08 09:01:34 +02:00
Daniel
df87d93306 remove legacy well visit schedule data 2026-05-08 08:59:23 +02:00
Daniel
e731780c7b move pe guide data to json 2026-05-08 08:56:21 +02:00
Daniel
300b40b181 set clinical prompt pool target 2026-05-08 08:52:29 +02:00
Daniel
27c3e07d98 fix learning hub model selector 2026-05-08 08:48:02 +02:00
Daniel
9167532a14 use indexed assistant prompt examples 2026-05-08 08:44:34 +02:00
Daniel
db2ecca45d remove top bar model selector 2026-05-08 08:28:54 +02:00
Daniel
6da5565f89 harden audio backup settings rendering 2026-05-08 08:23:38 +02:00
Daniel
04e736eb2e convert speech helpers to modules 2026-05-08 08:09:38 +02:00
Daniel
ea52890908 gate browser speech recognition setting 2026-05-08 08:05:23 +02:00
Daniel
9ca5365daf convert auth helpers to modules 2026-05-08 07:56:41 +02:00
Daniel
bc0b43151d convert settings helpers to modules 2026-05-08 07:54:08 +02:00
Daniel
b6ebca0e6f convert admin docs and drug loader to modules 2026-05-08 07:50:26 +02:00
Daniel
1756043125 test note refine correction policy 2026-05-08 07:46:39 +02:00
Daniel
03ee07f92f clarify template-only AI memory context 2026-05-08 07:38:27 +02:00
Daniel
20fc6798a9 remove browser whisper transcription 2026-05-08 07:33:12 +02:00
Daniel
59fa229b59 convert settings loaders to modules 2026-05-08 07:17:29 +02:00
Daniel
38667608b1 convert encounter note entrypoints to modules 2026-05-08 07:15:11 +02:00
Daniel
02f348ddb3 convert clinical note entrypoints to modules 2026-05-08 07:13:08 +02:00
Daniel
ffffe17b30 tighten chart review source coverage 2026-05-08 07:10:00 +02:00
Daniel
d48a19a891 honor admin default model selections 2026-05-08 06:49:50 +02:00
Daniel
c458c4b4ff convert chart review entrypoint to module 2026-05-08 06:49:46 +02:00
Daniel
e05720083a test clinical note entrypoints 2026-05-08 06:33:34 +02:00
Daniel
90938f8ec1 fix diagram delete confirmation 2026-05-08 06:28:12 +02:00
Daniel
289b0197e7 remove redundant app wrappers 2026-05-08 06:21:55 +02:00
Daniel
0102c9cbc6 convert admin entrypoint to module 2026-05-08 06:19:51 +02:00
Daniel
48ee92fc5d extract STT provider handling 2026-05-08 06:05:39 +02:00
Daniel
d4a3c8fd60 simplify TTS provider handling 2026-05-08 06:00:33 +02:00
Daniel
ca9be8bd85 remove redundant module wrappers 2026-05-08 05:30:32 +02:00
Daniel
34f198edc0 extract well visit schedule data 2026-05-08 05:11:29 +02:00
Daniel
784d1a2e21 consolidate calculator growth helpers 2026-05-08 04:36:39 +02:00
Daniel
9b5f01a19b extract calculator GCS helper 2026-05-08 04:33:46 +02:00
Daniel
ae0ca83ccb extract calculator dosing helpers 2026-05-08 04:32:09 +02:00
Daniel
41a05a6b5e extract calculator BP data 2026-05-08 04:24:18 +02:00
Daniel
b75be521ab extract calculator growth data 2026-05-08 04:05:51 +02:00
Daniel
951d102ac0 add BMI calculator combination tests 2026-05-08 03:57:30 +02:00
Daniel
bbd03bfeed avoid hardcoded BMI LMS anchors 2026-05-08 03:56:28 +02:00
Daniel
d79e578863 extract calculator BMI data 2026-05-08 03:52:08 +02:00
Daniel
903cd7eca8 extract AAP bilirubin threshold data 2026-05-08 03:42:51 +02:00
Daniel
d8b8f9bdcb extract bilirubin risk zone data 2026-05-08 03:28:52 +02:00
Daniel
6a081bb53b extract calculator reference data 2026-05-08 03:18:37 +02:00
Daniel
3c4ca84b5f extract calculator vitals data 2026-05-08 03:06:14 +02:00
Daniel
a8f364f177 stabilize assistant and add diagrams 2026-05-08 00:23:00 +02:00
Daniel
c8436d5e4c refactor clinical assistant prompt handling 2026-05-07 22:52:46 +02:00
Daniel
21fb631fb5 feat: improve clinical assistant export and citations 2026-05-07 17:15:26 +02:00
Daniel
f134d0e80c feat: improve clinical assistant visual sources 2026-05-07 02:45:17 +02:00
Daniel
9961688bfa feat(notes): trash + restore + DOMPurify sanitizer + 9 contract tests
Soft-delete for notes — Daniel asked for "deleted notes go to trash"
so a slip of the finger doesn't lose work.

Schema: migrations/1777090000000_notes-trash.js adds a deleted_at
timestamptz column to personal_notes (NULL = active) plus an index
on (user_id, deleted_at).

Server (src/routes/notes.js):
  GET    /api/notes              now filters deleted_at IS NULL
  GET    /api/notes/trash        new — list trashed items, newest-
                                  deleted first
  DELETE /api/notes/:id          now soft-deletes (sets deleted_at)
  DELETE /api/notes/:id?hard=1   hard-delete, only allowed on items
                                  already in trash (UI bug can't
                                  erase an active note)
  POST   /api/notes/:id/restore  pull a note out of trash
  POST   /api/notes/trash/empty  hard-delete every trashed note for
                                  the user

Frontend (public/components/notes.html + public/js/notes.js +
public/css/styles.css):
  • Sidebar gets two tabs — "Notes" / "Trash (n)" with live count
  • Trash tab shows deleted-at timestamps, Restore + delete-forever
    per row, Empty-trash button at the bottom
  • Active list and trash count refresh in parallel after every
    save / delete / restore
  • Delete button in the editor now says "Move to trash" and uses
    the showConfirm helper (no native dialogs)

Sanitizer swap (public/js/notes.js):
  Replaced the homegrown allowlist walker with DOMPurify (already
  loaded from cdnjs in index.html, used by learningHub.js too).
  Custom HTML sanitizers historically have bypasses; DOMPurify is
  the right primitive.

Tests (test/notes-sanitize.test.js — node:test + jsdom + dompurify
       as new dev deps):
  9 contract tests covering script-tag stripping, inline event
  handlers, img onerror, iframe/object, style attributes, every
  preserved tag in the allowlist, javascript: URI rejection,
  null/undefined input, and nested-script-inside-paragraph. Total
  test count: 37 → 46 passing.

SW cache bumped to pedscribe-v12-notes5.
2026-04-25 01:02:49 +02:00