pediatric-ai-scribe-v3/public/app/assets/Dictation-D10JY0ar.js
Daniel aab8376fa1 chore(verify): drop vanilla-era test + linter; rebuild React bundle
The verify pipeline carried two scripts whose targets no longer
exist after the vanilla deletion at commit 25a9c4c:

  test/calc-math.test.js  — required public/js/calc-math.js (gone);
    every assertion is now covered by shared/clinical/
    calculators.test.ts (vitest).
  scripts/lint-references.js — scans public/js/*.js for DOM id
    references and checks each target exists in public/components/
    *.html. Those trees are gone; TypeScript + knip + vite build
    cover the equivalent dead-reference class for the React tree.

package.json:
  • `verify` drops `test:node` and `lint:refs`; now runs
    typecheck + vitest + knip + client vite build.
  • `test:node` script removed (test/ directory empty).

public/app/assets/ — fresh vite build so the bundle hashes match
the current source (new chunks for ByVisitAge, Cms, DxPicker,
EditableResult, LabsList, Milestones, OutputActions, Recorder,
Shadess, SlideEditor, VisitNote — all features landed in the
preceding commits).

Verified locally on node 20: tsc + 9 test files / 177 tests pass,
knip finds nothing, vite builds 35 chunks, client bundle is 343 kB
initial / 106 kB gzipped (Cms is the biggest lazy chunk at 402 kB
due to Tiptap/ProseMirror).
2026-04-24 05:46:59 +02:00

1 line
No EOL
4.2 KiB
JavaScript

import{i as e,n as t,t as n}from"./jsx-runtime-ByY1xr43.js";import{c as r,i,t as a}from"./index-C9wKWOAN.js";import{n as o,t as s}from"./EditableResult-DaHQp1Pv.js";import{t as c}from"./Recorder-DdXTjnSC.js";var l=e(t(),1),u=n(),d=`dictation`;function f(){let[e,t]=(0,l.useState)(``),[n,f]=(0,l.useState)(``),[p,m]=(0,l.useState)(``),[h,g]=(0,l.useState)(`outpatient`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(``),[x,S]=(0,l.useState)(null),[C,w]=(0,l.useState)(null),[T,E]=(0,l.useState)(null),D=r({mutationFn:e=>i.post(`/api/generate-hpi-dictation`,e),onSuccess:e=>S(e.hpi),onError:()=>S(null)});function O(e){e.preventDefault(),w(null);let t={transcript:(y||_).trim(),patientAge:n,patientGender:p,setting:h},r=a.safeParse(t);if(!r.success){w(r.error.issues.map(e=>e.message).join(`, `));return}S(null),D.mutate(r.data)}function k(){v(``),b(``),S(null),w(null)}let A=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,j=y||_;return(0,u.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6 space-y-4`,children:[(0,u.jsxs)(`header`,{children:[(0,u.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Voice Dictation → HPI`}),(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Dictate your narrative → AI restructures into polished HPI.`})]}),(0,u.jsx)(o,{type:d,label:e,setLabel:t,transcript:_,generatedNote:x||``,partialData:{age:n,gender:p,setting:h},onLoad:e=>{v(e.transcript||``),b(``),S(e.generated_note||null);try{let t=e.partial_data?JSON.parse(e.partial_data):null;t?.age&&f(t.age),t?.gender&&m(t.gender),t?.setting&&g(t.setting)}catch{}t(e.label||``)},onClear:()=>{k(),f(``),m(``),g(`outpatient`)}}),(0,u.jsxs)(`form`,{onSubmit:O,className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Age`}),(0,u.jsx)(`input`,{className:A,placeholder:`e.g. 8 months`,value:n,onChange:e=>f(e.target.value)})]}),(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Gender`}),(0,u.jsxs)(`select`,{className:A,value:p,onChange:e=>m(e.target.value),children:[(0,u.jsx)(`option`,{value:``,children:`Select`}),(0,u.jsx)(`option`,{children:`Male`}),(0,u.jsx)(`option`,{children:`Female`})]})]}),(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Setting`}),(0,u.jsxs)(`select`,{className:A,value:h,onChange:e=>g(e.target.value),children:[(0,u.jsx)(`option`,{value:`outpatient`,children:`Outpatient`}),(0,u.jsx)(`option`,{value:`inpatient`,children:`Inpatient / Floors`})]})]})]}),(0,u.jsx)(c,{module:`dictation`,onTranscript:(e,t)=>{v(n=>t.appended&&n?n+` `+e:e),b(``),E(null)},onInterim:e=>b(e?_?_+` `+e:e:``),onError:e=>E(e)}),T&&(0,u.jsx)(`div`,{className:`text-sm text-destructive`,children:T}),(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Transcript / dictation`}),(0,u.jsx)(`button`,{type:`button`,onClick:k,className:`text-xs text-muted-foreground underline`,children:`Clear`})]}),(0,u.jsx)(`textarea`,{className:A+` min-h-[200px] font-mono text-sm`,placeholder:`Click Start recording, or type / paste your dictation here.`,value:j,onChange:e=>{v(e.target.value),b(``)}})]}),C&&(0,u.jsx)(`div`,{className:`text-sm text-destructive`,children:C}),D.error&&(0,u.jsx)(`div`,{className:`text-sm text-destructive`,children:D.error.message}),(0,u.jsx)(`div`,{className:`flex gap-2`,children:(0,u.jsx)(`button`,{type:`submit`,disabled:D.isPending||!j.trim(),className:`rounded-md bg-primary text-primary-foreground px-4 py-2 text-sm font-medium disabled:opacity-50`,children:D.isPending?`Generating…`:`Generate HPI`})})]}),x!==null&&(0,u.jsx)(s,{text:x,onChange:S,section:`hpi`,title:`Generated HPI`,exportLabel:`hpi-dictation`,exportType:`hpi`,sourceContext:j})]})}export{f as default};