pediatric-ai-scribe-v3/public/app/assets/VisitNote-B6TwVraG.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

5 lines
No EOL
10 KiB
JavaScript

import{i as e,n as t,t as n}from"./jsx-runtime-ByY1xr43.js";import{c as r,i}from"./index-C9wKWOAN.js";import{n as ee,t as te}from"./EditableResult-DaHQp1Pv.js";import{t as ne}from"./Recorder-DdXTjnSC.js";import{a,c as o,i as re,n as s,o as c,r as l,s as u,t as ie}from"./DxPicker-CCeyfxop.js";var d=e(t(),1),f=n(),ae=`wellvisit`,p=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm`;function m(){let[e,t]=(0,d.useState)(``),[n,m]=(0,d.useState)(``),[h,g]=(0,d.useState)(``),[_,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)(``),[C,w]=(0,d.useState)(``),[T,E]=(0,d.useState)(``),[D,O]=(0,d.useState)(``),[k,A]=(0,d.useState)(null),[j,M]=(0,d.useState)(``),[N,P]=(0,d.useState)(``),[F,I]=(0,d.useState)(``),[L,R]=(0,d.useState)(``),[z,B]=(0,d.useState)(``),[V,H]=(0,d.useState)({}),[U,W]=(0,d.useState)({}),[G,K]=(0,d.useState)([]),[q,J]=(0,d.useState)(``),[Y,X]=(0,d.useState)(`full`),[Z,Q]=(0,d.useState)(null);(0,d.useEffect)(()=>{try{let e=sessionStorage.getItem(`wv-shadess-assessment`);e&&M(e);let t=sessionStorage.getItem(`wv-milestones-narrative`);t&&P(t);let n=sessionStorage.getItem(`wv-byvisit-statuses`);n&&B(n);let r=sessionStorage.getItem(`ped_visit_age`);r&&v(e=>e||r)}catch{}},[]);let $=r({mutationFn:e=>i.post(`/api/well-visit/note`,e),onSuccess:e=>Q(e.note)});function oe(e){e.preventDefault(),Q(null);let t=a(l,V,`ROS`),r=a(s,U,`PHYSICAL EXAM`),i=re(G,q);$.mutate({patientAge:n,patientGender:h,visitAge:_,vitals:y,measurements:x,parentConcerns:C,transcript:(D||T).trim(),shadessAssessment:j||void 0,screenings:[F,z].filter(Boolean).join(`
`),vaccines:L,ros:t||void 0,physicalExam:r||void 0,diagnoses:i||void 0,physicianMemories:N?`[DEVELOPMENTAL ASSESSMENT]
`+N:void 0,noteStyle:Y})}let se=D||T;return(0,f.jsxs)(`div`,{className:`space-y-4`,children:[(0,f.jsx)(ee,{type:ae,label:e,setLabel:t,transcript:T,generatedNote:Z||``,partialData:{age:n,gender:h,visitAge:_,vitals:y,measurements:x,parentConcerns:C,shadess:j,milestones:N,byvisit:z,screenings:F,vaccines:L,rosData:V,peData:U,diagnoses:G,dxFreetext:q,noteStyle:Y},onLoad:e=>{E(e.transcript||``),O(``),Q(e.generated_note||null);try{let t=e.partial_data?JSON.parse(e.partial_data):null;t?.age&&m(t.age),t?.gender&&g(t.gender),t?.visitAge&&v(t.visitAge),t?.vitals&&b(t.vitals),t?.measurements&&S(t.measurements),t?.parentConcerns&&w(t.parentConcerns),t?.shadess&&M(t.shadess),t?.milestones&&P(t.milestones),t?.byvisit&&B(t.byvisit),t?.screenings&&I(t.screenings),t?.vaccines&&R(t.vaccines),t?.rosData&&H(t.rosData),t?.peData&&W(t.peData),t?.diagnoses&&K(t.diagnoses),t?.dxFreetext&&J(t.dxFreetext),t?.noteStyle&&X(t.noteStyle)}catch{}t(e.label||``)},onClear:()=>{E(``),O(``),Q(null),m(``),g(``),v(``),b(``),S(``),w(``),M(``),P(``),B(``),I(``),R(``),H({}),W({}),K([]),J(``),X(`full`)}}),(0,f.jsxs)(`form`,{onSubmit:oe,className:`space-y-4`,children:[(0,f.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Age`}),(0,f.jsx)(`input`,{className:p,value:n,onChange:e=>m(e.target.value)})]}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Gender`}),(0,f.jsxs)(`select`,{className:p,value:h,onChange:e=>g(e.target.value),children:[(0,f.jsx)(`option`,{value:``,children:`Select`}),(0,f.jsx)(`option`,{children:`Male`}),(0,f.jsx)(`option`,{children:`Female`})]})]}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Visit age`}),(0,f.jsx)(`input`,{className:p,placeholder:`e.g. 6 months`,value:_,onChange:e=>v(e.target.value)})]})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Vital signs`}),(0,f.jsx)(`textarea`,{className:p+` min-h-[60px] font-mono text-xs`,value:y,onChange:e=>b(e.target.value)})]}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Measurements / growth`}),(0,f.jsx)(`textarea`,{className:p+` min-h-[60px] font-mono text-xs`,value:x,onChange:e=>S(e.target.value)})]})]}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Parent / patient concerns`}),(0,f.jsx)(`textarea`,{className:p+` min-h-[60px] text-sm`,value:C,onChange:e=>w(e.target.value)})]}),(0,f.jsx)(ne,{module:`wellvisit`,onTranscript:(e,t)=>{E(n=>t.appended&&n?n+` `+e:e),O(``),A(null)},onInterim:e=>O(e?T?T+` `+e:e:``),onError:e=>A(e)}),k&&(0,f.jsx)(`div`,{className:`text-sm text-destructive`,children:k}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Transcript / dictation`}),(0,f.jsx)(`textarea`,{className:p+` min-h-[160px] font-mono text-sm`,value:se,onChange:e=>{E(e.target.value),O(``)},placeholder:`Click Start recording, or type / paste.`})]}),(j||N||z)&&(0,f.jsxs)(`div`,{className:`rounded-lg border border-amber-200 bg-amber-50 dark:bg-amber-950/30 p-3 space-y-2`,children:[(0,f.jsx)(`div`,{className:`text-xs font-semibold text-amber-800 dark:text-amber-200`,children:`Carry-overs from other tabs (used in note generation)`}),N&&(0,f.jsxs)(`details`,{className:`text-xs`,children:[(0,f.jsxs)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:[`Developmental assessment (`,N.length,` chars)`]}),(0,f.jsx)(`textarea`,{className:p+` mt-1 min-h-[80px] font-mono text-xs`,value:N,onChange:e=>P(e.target.value)})]}),j&&(0,f.jsxs)(`details`,{className:`text-xs`,children:[(0,f.jsxs)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:[`SSHADESS assessment (`,j.length,` chars)`]}),(0,f.jsx)(`textarea`,{className:p+` mt-1 min-h-[80px] font-mono text-xs`,value:j,onChange:e=>M(e.target.value)})]}),z&&(0,f.jsxs)(`details`,{className:`text-xs`,children:[(0,f.jsxs)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:[`By-visit-age statuses (`,z.split(`
`).length,` lines)`]}),(0,f.jsx)(`textarea`,{className:p+` mt-1 min-h-[80px] font-mono text-xs`,value:z,onChange:e=>B(e.target.value)})]})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Screenings completed`}),(0,f.jsx)(`textarea`,{className:p+` min-h-[60px] text-xs`,value:F,onChange:e=>I(e.target.value)})]}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Immunizations today`}),(0,f.jsx)(`textarea`,{className:p+` min-h-[60px] text-xs`,value:L,onChange:e=>R(e.target.value)})]})]}),(0,f.jsxs)(`div`,{className:`rounded-lg border border-border bg-card`,children:[(0,f.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between bg-muted/40 border-b border-border`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,children:`Review of Systems`}),(0,f.jsxs)(`div`,{className:`flex gap-1`,children:[(0,f.jsx)(`button`,{type:`button`,onClick:()=>H(u(l,V)),className:`text-xs rounded border border-border px-2 py-1 hover:bg-muted`,children:`✓ All WNL`}),(0,f.jsx)(`button`,{type:`button`,onClick:()=>H(o(V,l)),className:`text-xs rounded border border-border px-2 py-1 hover:bg-muted`,children:`Clear`})]})]}),(0,f.jsx)(c,{systems:l,data:V,onChange:H,btnLabels:{wnl:`WNL`,abnormal:`Abnormal`,notrev:`Not reviewed`},testIdPrefix:`wv-ros`})]}),(0,f.jsxs)(`div`,{className:`rounded-lg border border-border bg-card`,children:[(0,f.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between bg-muted/40 border-b border-border`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,children:`Physical Examination`}),(0,f.jsxs)(`div`,{className:`flex gap-1`,children:[(0,f.jsx)(`button`,{type:`button`,onClick:()=>W(u(s,U)),className:`text-xs rounded border border-border px-2 py-1 hover:bg-muted`,children:`✓ All Normal`}),(0,f.jsx)(`button`,{type:`button`,onClick:()=>W(o(U,s)),className:`text-xs rounded border border-border px-2 py-1 hover:bg-muted`,children:`Clear`})]})]}),(0,f.jsx)(c,{systems:s,data:U,onChange:W,btnLabels:{wnl:`Normal`,abnormal:`Abnormal`,notrev:`Not examined`},testIdPrefix:`wv-pe`})]}),(0,f.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 space-y-2`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,children:`Diagnoses (ICD-10)`}),(0,f.jsx)(ie,{value:G,onChange:K,testIdPrefix:`wv-dx`}),(0,f.jsxs)(`label`,{className:`block`,children:[(0,f.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Additional free-text diagnosis / note (optional)`}),(0,f.jsx)(`input`,{type:`text`,value:q,onChange:e=>J(e.target.value),className:p+` text-sm`,placeholder:`e.g. Rule out iron-deficiency anaemia pending labs`})]})]}),(0,f.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Note style`}),(0,f.jsxs)(`select`,{className:p,value:Y,onChange:e=>X(e.target.value),children:[(0,f.jsx)(`option`,{value:`full`,children:`Full encounter note`}),(0,f.jsx)(`option`,{value:`short`,children:`Brief SOAP`})]})]}),$.error&&(0,f.jsx)(`div`,{className:`text-sm text-destructive`,children:$.error.message}),(0,f.jsx)(`button`,{type:`submit`,disabled:$.isPending||!n.trim()&&!_.trim(),className:`rounded-md bg-primary text-primary-foreground px-4 py-2 text-sm font-medium disabled:opacity-50`,children:$.isPending?`Generating…`:`Generate Well Visit Note`})]}),Z!==null&&(0,f.jsx)(te,{text:Z,onChange:Q,section:`wellvisit`,title:`Well Visit Note`,exportLabel:`well-visit-note`,exportType:`well-visit`,sourceContext:se})]})}export{m as default};