pediatric-ai-scribe-v3/public/app/assets/Soap-DyFxx9HE.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.4 KiB
JavaScript

import{i as e,n as t,t as n}from"./jsx-runtime-ByY1xr43.js";import{c as r,i,r 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=`soap`;function f(){let[e,t]=(0,l.useState)(``),[n,f]=(0,l.useState)(``),[p,m]=(0,l.useState)(``),[h,g]=(0,l.useState)(`full`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(``),[x,S]=(0,l.useState)(``),[C,w]=(0,l.useState)(null),[T,E]=(0,l.useState)(null),[D,O]=(0,l.useState)(null),k=r({mutationFn:e=>i.post(`/api/generate-soap`,e),onSuccess:e=>w(e.soap)});function A(e){e.preventDefault(),E(null);let t={transcript:(y||_).trim(),patientAge:n,patientGender:p,type:h,additionalInstructions:x},r=a.safeParse(t);if(!r.success){E(r.error.issues.map(e=>e.message).join(`, `));return}w(null),k.mutate(r.data)}let j=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,M=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:`SOAP Note`}),(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Encounter transcript → full SOAP or subjective-only narrative.`})]}),(0,u.jsx)(o,{type:d,label:e,setLabel:t,transcript:_,generatedNote:C||``,partialData:{age:n,gender:p,type:h,additionalInstructions:x},onLoad:e=>{v(e.transcript||``),b(``),w(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?.type&&g(t.type),t?.additionalInstructions&&S(t.additionalInstructions)}catch{}t(e.label||``)},onClear:()=>{v(``),b(``),w(null),E(null),f(``),m(``),g(`full`),S(``)}}),(0,u.jsxs)(`form`,{onSubmit:A,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:j,placeholder:`e.g. 3 years`,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:j,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:`Output type`}),(0,u.jsxs)(`select`,{className:j,value:h,onChange:e=>g(e.target.value),children:[(0,u.jsx)(`option`,{value:`full`,children:`Full SOAP`}),(0,u.jsx)(`option`,{value:`subjective`,children:`Subjective only`})]})]})]}),(0,u.jsx)(c,{module:`soap`,onTranscript:(e,t)=>{v(n=>t.appended&&n?n+` `+e:e),b(``),O(null)},onInterim:e=>b(e?_?_+` `+e:e:``),onError:e=>O(e)}),D&&(0,u.jsx)(`div`,{className:`text-sm text-destructive`,children:D}),(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:`Transcript`}),(0,u.jsx)(`textarea`,{className:j+` min-h-[200px] font-mono text-sm`,placeholder:`Click Start recording, or type / paste the encounter transcript.`,value:M,onChange:e=>{v(e.target.value),b(``)}})]}),(0,u.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,u.jsxs)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[`Additional instructions `,(0,u.jsx)(`span`,{className:`text-muted-foreground normal-case font-normal`,children:`(optional)`})]}),(0,u.jsx)(`textarea`,{className:j+` min-h-[60px] text-sm`,placeholder:`e.g., 'Include return precautions', 'Add differential for otitis media'`,value:x,onChange:e=>S(e.target.value)})]}),T&&(0,u.jsx)(`div`,{className:`text-sm text-destructive`,children:T}),k.error&&(0,u.jsx)(`div`,{className:`text-sm text-destructive`,children:k.error.message}),(0,u.jsx)(`button`,{type:`submit`,disabled:k.isPending||!M.trim(),className:`rounded-md bg-primary text-primary-foreground px-4 py-2 text-sm font-medium disabled:opacity-50`,children:k.isPending?`Generating…`:`Generate SOAP`})]}),C!==null&&(0,u.jsx)(s,{text:C,onChange:w,section:`soap`,title:`Generated SOAP`,exportLabel:`soap-note`,exportType:`soap`,sourceContext:M})]})}export{f as default};