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).
1 line
No EOL
6.4 KiB
JavaScript
1 line
No EOL
6.4 KiB
JavaScript
import{i as e,n as t,t as n}from"./jsx-runtime-ByY1xr43.js";import{c as r,i,n 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";import{a as l,c as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./DxPicker-CCeyfxop.js";var _=e(t(),1),v=n(),y=`sickvisit`;function b(){let[e,t]=(0,_.useState)(``),[n,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(``),[k,A]=(0,_.useState)({}),[j,M]=(0,_.useState)({}),[N,P]=(0,_.useState)([]),[F,I]=(0,_.useState)(``),[L,R]=(0,_.useState)(null),[z,B]=(0,_.useState)(null),[V,H]=(0,_.useState)(null),U=r({mutationFn:e=>i.post(`/api/sick-visit/note`,e),onSuccess:e=>R(e.note)});function W(e){e.preventDefault(),B(null);let t=l(m,k,`Review of Systems`),r=l(f,j,`Physical Examination`),i=d(N,F),o={patientAge:n,patientGender:x,chiefComplaint:C,transcript:(D||T).trim(),ros:t||void 0,physicalExam:r||void 0,diagnoses:i||void 0},s=a.safeParse(o);if(!s.success){B(s.error.issues.map(e=>e.message).join(`, `));return}R(null),U.mutate(s.data)}let G=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,K=D||T;return(0,v.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6 space-y-4`,children:[(0,v.jsxs)(`header`,{children:[(0,v.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Sick Visit`}),(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Chief complaint + transcript → structured sick-visit note.`})]}),(0,v.jsx)(o,{type:y,label:e,setLabel:t,transcript:T,generatedNote:L||``,partialData:{age:n,gender:x,chiefComplaint:C,rosData:k,peData:j,diagnoses:N,dxFreetext:F},onLoad:e=>{E(e.transcript||``),O(``),R(e.generated_note||null);try{let t=e.partial_data?JSON.parse(e.partial_data):null;t?.age&&b(t.age),t?.gender&&S(t.gender),t?.chiefComplaint&&w(t.chiefComplaint),t?.rosData&&A(t.rosData),t?.peData&&M(t.peData),t?.diagnoses&&P(t.diagnoses),t?.dxFreetext&&I(t.dxFreetext)}catch{}t(e.label||``)},onClear:()=>{E(``),O(``),R(null),B(null),b(``),S(``),w(``),A({}),M({}),P([]),I(``)}}),(0,v.jsxs)(`form`,{onSubmit:W,className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,v.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,v.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Age`}),(0,v.jsx)(`input`,{className:G,placeholder:`e.g. 4 years`,value:n,onChange:e=>b(e.target.value)})]}),(0,v.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,v.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Gender`}),(0,v.jsxs)(`select`,{className:G,value:x,onChange:e=>S(e.target.value),children:[(0,v.jsx)(`option`,{value:``,children:`Select`}),(0,v.jsx)(`option`,{children:`Male`}),(0,v.jsx)(`option`,{children:`Female`})]})]}),(0,v.jsxs)(`label`,{className:`flex flex-col gap-1 col-span-3 md:col-span-1`,children:[(0,v.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Chief complaint`}),(0,v.jsx)(`input`,{className:G,placeholder:`e.g. Fever x 2 days`,value:C,onChange:e=>w(e.target.value)})]})]}),(0,v.jsx)(c,{module:`sickvisit`,onTranscript:(e,t)=>{E(n=>t.appended&&n?n+` `+e:e),O(``),H(null)},onInterim:e=>O(e?T?T+` `+e:e:``),onError:e=>H(e)}),V&&(0,v.jsx)(`div`,{className:`text-sm text-destructive`,children:V}),(0,v.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,v.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Transcript / dictation`}),(0,v.jsx)(`textarea`,{className:G+` min-h-[200px] font-mono text-sm`,placeholder:`Click Start recording, or type / paste encounter narrative.`,value:K,onChange:e=>{E(e.target.value),O(``)}})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border border-border bg-card`,children:[(0,v.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between bg-muted/40 border-b border-border`,children:[(0,v.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,children:`Review of Systems`}),(0,v.jsxs)(`div`,{className:`flex gap-1`,children:[(0,v.jsx)(`button`,{type:`button`,onClick:()=>A(h(m,k)),className:`text-xs rounded border border-border px-2 py-1 hover:bg-muted`,children:`✓ All WNL`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>A(u(k,m)),className:`text-xs rounded border border-border px-2 py-1 hover:bg-muted`,children:`Clear`})]})]}),(0,v.jsx)(p,{systems:m,data:k,onChange:A,btnLabels:{wnl:`WNL`,abnormal:`Abnormal`,notrev:`Not reviewed`},testIdPrefix:`sv-ros`})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border border-border bg-card`,children:[(0,v.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between bg-muted/40 border-b border-border`,children:[(0,v.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,children:`Physical Examination`}),(0,v.jsxs)(`div`,{className:`flex gap-1`,children:[(0,v.jsx)(`button`,{type:`button`,onClick:()=>M(h(f,j)),className:`text-xs rounded border border-border px-2 py-1 hover:bg-muted`,children:`✓ All Normal`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>M(u(j,f)),className:`text-xs rounded border border-border px-2 py-1 hover:bg-muted`,children:`Clear`})]})]}),(0,v.jsx)(p,{systems:f,data:j,onChange:M,btnLabels:{wnl:`Normal`,abnormal:`Abnormal`,notrev:`Not examined`},testIdPrefix:`sv-pe`})]}),(0,v.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 space-y-2`,children:[(0,v.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,children:`Diagnoses (ICD-10)`}),(0,v.jsx)(g,{value:N,onChange:P,testIdPrefix:`sv-dx`}),(0,v.jsxs)(`label`,{className:`block`,children:[(0,v.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Additional free-text diagnosis / note (optional)`}),(0,v.jsx)(`input`,{type:`text`,value:F,onChange:e=>I(e.target.value),className:G+` text-sm`,placeholder:`e.g. Follow up in 48 hours if not improving`})]})]}),z&&(0,v.jsx)(`div`,{className:`text-sm text-destructive`,children:z}),U.error&&(0,v.jsx)(`div`,{className:`text-sm text-destructive`,children:U.error.message}),(0,v.jsx)(`button`,{type:`submit`,disabled:U.isPending||!C.trim(),className:`rounded-md bg-primary text-primary-foreground px-4 py-2 text-sm font-medium disabled:opacity-50`,children:U.isPending?`Generating…`:`Generate Note`})]}),L!==null&&(0,v.jsx)(s,{text:L,onChange:R,section:`sickvisit`,title:`Sick Visit Note`,exportLabel:`sick-visit-note`,exportType:`sick-visit`,sourceContext:K})]})}export{b as default}; |