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).
4 lines
No EOL
9.2 KiB
JavaScript
4 lines
No EOL
9.2 KiB
JavaScript
import{i as e,n as t,t as n}from"./jsx-runtime-ByY1xr43.js";var r=n();function i(e,t){let n={...t};for(let t of e)n[t.key]={status:`wnl`,note:n[t.key]?.note};return n}function a(e,t){let n={...e};for(let e of t)n[e.key]={};return n}var o={wnl:`WNL`,abnormal:`Abnormal`,notrev:`Not reviewed`};function s(e,t){return e?t===`wnl`?`bg-green-100 text-green-800 border-green-300`:t===`abnormal`?`bg-red-100 text-red-800 border-red-300`:`bg-muted text-muted-foreground border-border`:`bg-background border-border hover:bg-muted`}function c({systems:e,data:t,onChange:n,btnLabels:i,testIdPrefix:a=`ros`}){let c=i||o;function l(e,r){let i=(t[e]?.status||``)===r?``:r;n({...t,[e]:{status:i,note:t[e]?.note||``}})}function u(e,r){n({...t,[e]:{status:t[e]?.status||``,note:r}})}return(0,r.jsx)(`div`,{className:`divide-y divide-border`,"data-testid":a+`-table`,children:e.map(e=>{let n=t[e.key]||{},i=n.status||``;return(0,r.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-2 py-1.5`,"data-testid":a+`-row-`+e.key,children:[(0,r.jsxs)(`div`,{className:`flex-1 min-w-[180px]`,title:e.detail,children:[(0,r.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,r.jsxs)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:[`(`,e.detail,`)`]})]}),(0,r.jsx)(`div`,{className:`flex gap-1 shrink-0`,children:[`wnl`,`abnormal`,`notrev`].map(t=>(0,r.jsx)(`button`,{type:`button`,onClick:()=>l(e.key,t),className:`text-[10px] uppercase tracking-wider px-2 py-1 rounded border `+s(i===t,t),"data-testid":a+`-btn-`+e.key+`-`+t,children:c[t]},t))}),i===`abnormal`&&(0,r.jsx)(`input`,{type:`text`,value:n.note||``,onChange:t=>u(e.key,t.target.value),placeholder:`Describe finding…`,className:`flex-1 min-w-[200px] rounded-md border border-input bg-background px-2 py-1 text-xs`,"data-testid":a+`-note-`+e.key})]},e.key)})})}var l=e(t(),1),u=[{key:`constitutional`,label:`Constitutional`,detail:`fever, fatigue, weight loss/gain, appetite`},{key:`eyes`,label:`Eyes`,detail:`vision changes, discharge, redness`},{key:`ent`,label:`ENT`,detail:`ear pain, congestion, sore throat, mouth sores`},{key:`cardiovascular`,label:`Cardiovascular`,detail:`chest pain, palpitations, murmur`},{key:`respiratory`,label:`Respiratory`,detail:`cough, wheeze, dyspnea`},{key:`gastrointestinal`,label:`Gastrointestinal`,detail:`nausea, vomiting, diarrhea, constipation, abdominal pain`},{key:`genitourinary`,label:`Genitourinary`,detail:`dysuria, frequency, discharge, menstrual`},{key:`musculoskeletal`,label:`Musculoskeletal`,detail:`joint pain, swelling, gait issues, back pain`},{key:`skin`,label:`Skin`,detail:`rash, lesions, itch, hair/nail changes`},{key:`neurological`,label:`Neurological`,detail:`headache, dizziness, seizures, numbness`},{key:`psychiatric`,label:`Psychiatric`,detail:`mood, anxiety, sleep, behavior changes`},{key:`endocrine`,label:`Endocrine`,detail:`polyuria/polydipsia, heat/cold intolerance, growth concerns`},{key:`hematologic`,label:`Hematologic/Lymphatic`,detail:`bruising, bleeding, lymph nodes`},{key:`allergic`,label:`Allergic/Immunologic`,detail:`allergic reactions, frequent infections`},{key:`developmental`,label:`Developmental/Behavioral`,detail:`milestones, school, social`}],d=[{key:`general`,label:`General Appearance`,detail:`WDWN, alert, NAD, etc.`},{key:`peEyes`,label:`Eyes`,detail:`PERRL, conjunctiva, EOM`},{key:`ears`,label:`Ears`,detail:`TMs, canals, hearing`},{key:`nose`,label:`Nose`,detail:`mucosa, septum, turbinates`},{key:`mouthThroat`,label:`Mouth/Throat`,detail:`lips, gums, teeth, tonsils, pharynx`},{key:`neck`,label:`Neck`,detail:`lymph nodes, thyroid, masses`},{key:`chestLungs`,label:`Chest/Lungs`,detail:`air entry, wheezing, retractions`},{key:`peCv`,label:`Cardiovascular`,detail:`S1/S2, murmur, pulses, cap refill`},{key:`abdomen`,label:`Abdomen`,detail:`soft, tenderness, organomegaly, BS`},{key:`guTanner`,label:`Genitourinary/Tanner`,detail:`Tanner stage, genitalia, hernias`},{key:`msk`,label:`Musculoskeletal`,detail:`strength, ROM, gait, spine`},{key:`extremities`,label:`Extremities`,detail:`tone, reflexes, clubbing, edema`},{key:`peSkin`,label:`Skin`,detail:`rashes, lesions, cafe au lait, bruises`},{key:`peNeuro`,label:`Neurological`,detail:`CN intact, DTRs, coordination`},{key:`lymphatic`,label:`Lymphatic`,detail:`cervical, axillary, inguinal nodes`},{key:`breast`,label:`Breast`,detail:`if indicated by age/Tanner`},{key:`pePsych`,label:`Psychiatric`,detail:`affect, mood, behavior during exam`}],f=[{code:`Z00.129`,name:`Routine child health exam, no abnormal findings`},{code:`Z00.121`,name:`Routine child health exam, with abnormal findings`},{code:`J06.9`,name:`Upper Respiratory Infection, NOS`},{code:`J02.9`,name:`Acute pharyngitis, NOS`},{code:`J03.90`,name:`Acute tonsillitis, NOS`},{code:`H66.90`,name:`Otitis media, NOS`},{code:`J20.9`,name:`Acute bronchitis`},{code:`J45.20`,name:`Mild intermittent asthma, uncomplicated`},{code:`J45.30`,name:`Mild persistent asthma`},{code:`A09`,name:`Gastroenteritis/colitis`},{code:`L20.9`,name:`Atopic dermatitis, NOS`},{code:`L30.9`,name:`Dermatitis NOS`},{code:`R50.9`,name:`Fever NOS`},{code:`R10.9`,name:`Abdominal pain NOS`},{code:`R05.9`,name:`Cough`},{code:`B34.9`,name:`Viral infection NOS`},{code:`Z23`,name:`Immunization encounter`},{code:`Z41.9`,name:`Procedure for non-remedial reason`},{code:`K21.0`,name:`GERD with esophagitis`},{code:`K21.9`,name:`GERD without esophagitis`},{code:`F90.0`,name:`ADHD, predominantly inattentive`},{code:`F90.2`,name:`ADHD, combined type`},{code:`F41.1`,name:`Generalized anxiety disorder`},{code:`F32.9`,name:`Major depressive episode NOS`},{code:`E11.9`,name:`Type 2 diabetes`},{code:`E03.9`,name:`Hypothyroidism NOS`},{code:`M54.5`,name:`Low back pain`},{code:`G43.909`,name:`Migraine NOS`}];function p(e,t,n){let r=[n+`:`],i=!1;for(let n of e){let e=t[n.key]||{};e.status&&(i=!0,e.status===`wnl`?r.push(` `+n.label+`: NORMAL [domain: `+n.detail+`]`):e.status===`abnormal`?r.push(` `+n.label+`: ABNORMAL`+(e.note?` — `+e.note:``)+` [domain: `+n.detail+`]`):r.push(` `+n.label+`: Not reviewed`))}return i?r.join(`
|
||
`):``}function m(e,t){let n=[];for(let t of e)n.push((t.code?t.code+` `:``)+t.name);let r=(t||``).trim();return r&&n.push(r),n.length?`Diagnoses:
|
||
`+n.map(e=>` - `+e).join(`
|
||
`):``}var h=`rounded-md border border-input bg-background px-2 py-1 text-sm`;async function g(e,t){let n=`https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search?sf=code,name&terms=`+encodeURIComponent(e)+`&maxList=12`;return((await(await fetch(n,{signal:t})).json())[3]||[]).map(([e,t])=>({code:e,name:t}))}function _({value:e,onChange:t,testIdPrefix:n=`dx`}){let[i,a]=(0,l.useState)(``),[o,s]=(0,l.useState)([]),[c,u]=(0,l.useState)(!1),d=(0,l.useRef)(null),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!i.trim()||i.trim().length<2){s([]),u(!1);return}return p.current&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{d.current&&d.current.abort();let e=new AbortController;d.current=e,g(i.trim(),e.signal).then(e=>{s(e),u(e.length>0)}).catch(()=>{})},280),()=>{p.current&&window.clearTimeout(p.current)}},[i]);function m(n){e.some(e=>e.code===n.code&&e.name===n.name)||t([...e,n])}function _(n){t(e.filter((e,t)=>t!==n))}return(0,r.jsxs)(`div`,{className:`space-y-2`,"data-testid":n+`-picker`,children:[(0,r.jsxs)(`div`,{className:`relative`,children:[(0,r.jsx)(`input`,{type:`text`,placeholder:`Search ICD-10 (e.g. "otitis", "J06")…`,autoComplete:`off`,value:i,onChange:e=>a(e.target.value),onFocus:()=>o.length&&u(!0),onBlur:()=>setTimeout(()=>u(!1),150),onKeyDown:e=>{e.key===`Escape`&&u(!1),e.key===`Enter`&&o[0]&&(e.preventDefault(),m(o[0]),a(``),u(!1))},className:h+` w-full`,"data-testid":n+`-search`}),c&&o.length>0&&(0,r.jsx)(`div`,{className:`absolute z-30 left-0 right-0 mt-1 max-h-60 overflow-auto rounded-md border border-border bg-card shadow-lg`,children:o.map(e=>(0,r.jsxs)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),m(e),a(``),u(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-muted border-b border-border last:border-0`,"data-testid":n+`-result-`+e.code,children:[(0,r.jsx)(`span`,{className:`inline-block w-20 text-xs font-mono text-muted-foreground`,children:e.code}),(0,r.jsx)(`span`,{children:e.name})]},e.code))})]}),e.length>0&&(0,r.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,"data-testid":n+`-tags`,children:e.map((e,t)=>(0,r.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-primary/10 border border-primary/30 text-primary px-2 py-0.5 text-xs`,children:[e.code&&(0,r.jsx)(`strong`,{className:`font-semibold`,children:e.code}),(0,r.jsx)(`span`,{children:e.name}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>_(t),className:`text-xs text-muted-foreground hover:text-destructive`,title:`Remove`,children:`×`})]},t))}),(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`div`,{className:`text-[11px] text-muted-foreground mb-1`,children:`Common pediatric diagnoses:`}),(0,r.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:f.map(e=>(0,r.jsxs)(`button`,{type:`button`,onClick:()=>m(e),className:`text-[11px] rounded border border-border bg-background px-2 py-0.5 hover:bg-muted`,title:e.name,"data-testid":n+`-chip-`+e.code,children:[(0,r.jsx)(`span`,{className:`font-mono text-muted-foreground mr-1`,children:e.code}),e.name]},e.code))})]})]})}export{p as a,a as c,m as i,d as n,c as o,u as r,i as s,_ as t}; |