pediatric-ai-scribe-v3/src
Daniel 004e36cd67 refactor(ts): day 3 batch 2 — hpi, soap, refine, tts, transcribe
Same CJS-compatible pattern as batch 1 (import express = require;
const {...} = require for internal utils; export = router). No
behavior change — TS only strips annotations during compile.

AI route touchpoints:
  /api/generate-hpi-encounter, /generate-hpi-dictation  → hpi.ts
  /api/generate-soap                                    → soap.ts
  /api/refine, /shorten, /clarify                       → refine.ts
  /api/text-to-speech                                   → tts.ts
  /api/transcribe, /transcribe/status                   → transcribe.ts

All five handlers retain identical request/response shapes; the
shared/types.ts contract was defined on day 2 from these very files.

One fetch() typing fix: the transcribe route's LiteLLM branch uses
DOM fetch, but the file imports Express's Response type, so the
`.then((r: Response) => ...)` annotation was shadowing the global
Response. Removed the explicit annotation — tsc infers correctly.

Progress: 9 of 54 files migrated. tsc --noEmit green.
2026-04-23 19:36:43 +02:00
..
db feat(extensions): personal Pagers & Extensions directory with soft-delete 2026-04-22 18:54:26 +02:00
middleware Enforce server-side LLM model whitelist + scope idle timeout to writes 2026-04-14 05:15:55 +02:00
routes refactor(ts): day 3 batch 2 — hpi, soap, refine, tts, transcribe 2026-04-23 19:36:43 +02:00
types refactor(ts): day 3 batch 1 — convert 4 small route files 2026-04-23 19:31:20 +02:00
utils feat(pe-guide): step-by-step OSCE checklist, Bates/Nelson/Hutchison sourced 2026-04-22 17:15:27 +02:00