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

3 lines
No EOL
7.3 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 a,t as o}from"./EditableResult-DaHQp1Pv.js";import{n as s,t as c}from"./LabsList-CVygta6B.js";var l=e(t(),1),u=n(),d=`chart`;function f(){return{date:``,visitType:`outpatient`,content:``,labs:``}}var p=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,m=`rounded-md border border-input bg-background px-2 py-1 text-sm`,h=`inline-flex items-center gap-1 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium hover:bg-muted disabled:opacity-50`;function g(){let[e,t]=(0,l.useState)(``),[n,g]=(0,l.useState)(`outpatient`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(``),[x,S]=(0,l.useState)(``),[C,w]=(0,l.useState)([f()]),[T,E]=(0,l.useState)([s()]),[D,O]=(0,l.useState)(``),[k,A]=(0,l.useState)(null),j=r({mutationFn:e=>i.post(`/api/generate-chart-review`,e),onSuccess:e=>A(e.review)});function M(e,t){w(n=>n.map((n,r)=>r===e?{...n,...t}:n))}function N(e){e.preventDefault(),A(null);let t=C.filter(e=>e.content.trim()),r=e=>({date:e.date,content:e.content,labs:e.labs});j.mutate({type:n,patientAge:_,patientGender:y,pmh:x,visits:t.filter(e=>e.visitType===`outpatient`).map(r),subspecialty:t.filter(e=>e.visitType===`subspecialty`).map(e=>({date:e.date,content:e.content,labs:e.labs,specialistName:e.specialistName,specialty:e.specialty})),edVisits:t.filter(e=>e.visitType===`ed`).map(r),labs:T.filter(e=>e.values.trim()),additionalInstructions:D||void 0})}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:`Chart Review`}),(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Past visits + labs → summary for pre-charting. Mix of outpatient, subspecialty, and ED visits supported.`})]}),(0,u.jsx)(a,{type:d,label:e,setLabel:t,transcript:JSON.stringify({visits:C,extraLabs:T}),generatedNote:k||``,partialData:{reviewType:n,age:_,gender:y,pmh:x,additionalInstructions:D},onLoad:e=>{try{let t=e.transcript?JSON.parse(e.transcript):null;Array.isArray(t?.visits)&&t.visits.length&&w(t.visits),Array.isArray(t?.extraLabs)&&t.extraLabs.length&&E(t.extraLabs)}catch{try{let t=e.transcript?JSON.parse(e.transcript):null;Array.isArray(t)&&w(t)}catch{}}A(e.generated_note||null);try{let t=e.partial_data?JSON.parse(e.partial_data):null;t?.reviewType&&g(t.reviewType),t?.age&&v(t.age),t?.gender&&b(t.gender),t?.pmh&&S(t.pmh),t?.additionalInstructions&&O(t.additionalInstructions)}catch{}t(e.label||``)},onClear:()=>{w([f()]),E([s()]),A(null),g(`outpatient`),v(``),b(``),S(``),O(``)}}),(0,u.jsxs)(`form`,{onSubmit:N,className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`grid grid-cols-4 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:`Review type`}),(0,u.jsxs)(`select`,{className:p,value:n,onChange:e=>g(e.target.value),children:[(0,u.jsx)(`option`,{value:`outpatient`,children:`Outpatient`}),(0,u.jsx)(`option`,{value:`subspecialty`,children:`Subspecialty`}),(0,u.jsx)(`option`,{value:`ed`,children:`ED`})]})]}),(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:p,value:_,onChange:e=>v(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:p,value:y,onChange:e=>b(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:`PMH`}),(0,u.jsx)(`input`,{className:p,value:x,onChange:e=>S(e.target.value)})]})]}),(0,u.jsxs)(`div`,{className:`space-y-3`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`text-sm font-semibold`,children:`Visits / Notes`}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>w(e=>[...e,f()]),className:h,children:`+ Add visit / note`})]}),C.map((e,t)=>(0,u.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-2 bg-card`,"data-testid":`cr-visit-`+t,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,u.jsxs)(`strong`,{className:`text-sm`,children:[`Visit / Note #`,t+1]}),(0,u.jsx)(`input`,{type:`date`,className:m+` w-40`,value:e.date,onChange:e=>M(t,{date:e.target.value})}),(0,u.jsxs)(`select`,{className:m,value:e.visitType,onChange:e=>M(t,{visitType:e.target.value}),"data-testid":`cr-visit-type-`+t,children:[(0,u.jsx)(`option`,{value:`outpatient`,children:`Outpatient Visit`}),(0,u.jsx)(`option`,{value:`subspecialty`,children:`Subspecialty Note`}),(0,u.jsx)(`option`,{value:`ed`,children:`ED Visit`})]}),e.visitType===`subspecialty`&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`input`,{type:`text`,className:m+` flex-1 min-w-[140px]`,placeholder:`Specialist name`,value:e.specialistName||``,onChange:e=>M(t,{specialistName:e.target.value})}),(0,u.jsx)(`input`,{type:`text`,className:m+` flex-1 min-w-[140px]`,placeholder:`Specialty (e.g. Endocrinology)`,value:e.specialty||``,onChange:e=>M(t,{specialty:e.target.value})})]}),C.length>1&&(0,u.jsx)(`button`,{type:`button`,onClick:()=>w(e=>e.filter((e,n)=>n!==t)),className:`ml-auto text-xs text-destructive`,title:`Remove`,children:`🗑`})]}),(0,u.jsx)(`textarea`,{className:p+` min-h-[120px] font-mono text-sm`,placeholder:`Paste note here…`,value:e.content,onChange:e=>M(t,{content:e.target.value})}),(0,u.jsx)(`textarea`,{className:p+` min-h-[60px] font-mono text-xs`,placeholder:`Labs from this visit (optional)`,value:e.labs,onChange:e=>M(t,{labs:e.target.value})})]},t))]}),(0,u.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 space-y-2`,children:[(0,u.jsx)(`strong`,{className:`text-sm`,children:`🧪 Additional Labs`}),(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Labs not tied to a specific visit.`}),(0,u.jsx)(c,{value:T,onChange:E,placeholder:`e.g. TSH 4.1, Free T4 1.2`,testIdPrefix:`cr-extra-labs`})]}),(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:`Instructions (optional)`}),(0,u.jsx)(`textarea`,{className:p+` min-h-[60px] text-sm`,placeholder:`e.g. 'Focus on thyroid management', 'Highlight medication changes'`,value:D,onChange:e=>O(e.target.value)})]}),j.error&&(0,u.jsx)(`div`,{className:`text-sm text-destructive`,children:j.error.message}),(0,u.jsx)(`button`,{type:`submit`,disabled:j.isPending||!C.some(e=>e.content.trim()),className:`rounded-md bg-primary text-primary-foreground px-4 py-2 text-sm font-medium disabled:opacity-50`,children:j.isPending?`Generating…`:`✨ Generate Chart Review`})]}),k!==null&&(0,u.jsx)(o,{text:k,onChange:A,section:null,title:`Chart Review`,exportLabel:`chart-review`,exportType:`chart-review`,sourceContext:C.map(e=>e.content).filter(Boolean).join(`
`)})]})}export{g as default};