1import{f as J,u as Le,g as Re,j as e,J as f}from"./index-B-J-3qFm.js";import{r as l}from"./vendor-BtIrUdbE.js";import{c as Be,i as Ae,B as w,C as h,a as y,b as v,e as p,d as Me}from"./createLucideIcon-z-OAPkWV.js";import{I as de}from"./input-C_RjbIVi.js";import{L as a}from"./label-AQFe7dc1.js";import{B as M}from"./calendar-BC-MlLFH.js";import{D as Y,a as Z,b as E,c as ee,d as me,e as se}from"./dialog-23tcOO9u.js";import{S as k,a as q,b as U,c as V,d as n}from"./select-BCIkdbLW.js";import{T as te}from"./textarea-CG7FovH6.js";import{T as ke,a as qe,b as re,c as O,d as Ue,e as P}from"./table-Dsyo34k4.js";import{N as Ve}from"./Navbar-Dkzwy2CR.js";import{P as Qe}from"./PatientSelectionModal-DNYon4lf.js";import{L as $e}from"./LabTestReportPrint-BBeNFf9I.js";import{u as He}from"./useService-CA2p9Eyr.js";import{u as Ke}from"./useDebounce-D_W6K2Vc.js";import{P as _e}from"./plus-BACoSc5V.js";import{S as ze}from"./search-Cc7G8iUZ.js";import{U as ue}from"./index-CFEJ7oTm.js";import{E as Je}from"./eye-BZUEGDIc.js";import{F as We}from"./index-Ckod4W8V.js";import{P as Xe}from"./printer-DSS88kl8.js";import{C as Ge}from"./clock-C0zD4Spk.js";import{C as Ye}from"./circle-x-CwAHYpRl.js";import{C as Ze}from"./circle-check-big-N4kmfBPd.js";import"./index-QDL7s8xa.js";import"./index-Cnf523Jr.js";import"./index-BnGOq_BC.js";import"./useSettings-CWNbU2iH.js";import"./users-B7pGX1_z.js";import"./usePatient-BWYONxZN.js";import"./credit-card-CaCBchPv.js";import"./separator-BK1hgYjD.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const xe=Be("Beaker",[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]]),Ee=async j=>{var o;try{return(await J.post("lab-test/order/",{...j})).data}catch(d){const r=(o=d==null?void 0:d.response)==null?void 0:o.data;return{status:"error",message:(r==null?void 0:r.message)||(r==null?void 0:r.error)||"An unexpected error occurred. Please try again."}}},es=async(j,o,d,r,i,m,x,T)=>{var N;try{const b={page:j,limit:o,search:d};return r&&(b.status=r),i?b.dateRange=i:(m&&(b.startDate=m),x&&(b.endDate=x)),(await J.get("lab-test/order",{params:b})).data}catch(b){const S=(N=b==null?void 0:b.response)==null?void 0:N.data;return{status:"error",message:(S==null?void 0:S.message)||(S==null?void 0:S.error)||"An unexpected error occurred. Please try again."}}},ss=async(j,o)=>{var d;try{return(await J.patch(`lab-test/order/update-status/${j}`,{labTestId:j,status:o})).data}catch(r){const i=(d=r==null?void 0:r.response)==null?void 0:d.data;return{status:"error",message:(i==null?void 0:i.message)||(i==null?void 0:i.error)||"Failed to update labTest. Please try again."}}},ts=async(j,o,d,r)=>{var i;try{return(await J.post("lab-test/order/submit-test-result",{testId:j,results:o,notes:d,completedDate:r})).data}catch(m){const x=(i=m==null?void 0:m.response)==null?void 0:i.data;return{status:"error",message:(x==null?void 0:x.message)||(x==null?void 0:x.error)||"Failed to update labTest. Please try again."}}},rs=(j,o,d,r,i,m,x,T)=>Ae({queryKey:["patient-lab-tests",j,o,d,r,i,m,x,T],queryFn:async()=>{const N=await es(j,o,d,r,i,m,x,T);if(N.status==="success")return N;throw new Error("Failed to fetch payment verification data")},retry:1,refetchOnWindowFocus:!1}),_s=()=>{const{user:j}=Le(),[o,d]=l.useState(""),[r,i]=l.useState("all"),[m,x]=l.useState("all"),[T,N]=l.useState(!1),[b,S]=l.useState(!1),[ae,B]=l.useState(!1),[he,Q]=l.useState(!1),[pe,le]=l.useState(!1),[t,I]=l.useState(null),[g,A]=l.useState(null),[u,F]=l.useState({patientId:"",testId:"",priority:"routine",orderedBy:j.fullName,notes:""}),[C,$]=l.useState({testId:"",results:"",notes:"",completedDate:new Date().toISOString()}),{data:je=[],error:H,isLoading:ge}=He(1,500),ne=je.filter(s=>s.unit._id==="68552c5b291cf5d5aa1146eb"),[ie,K]=l.useState(!1),[fe,as]=l.useState(1),[Ne,ls]=l.useState(""),[ye,ns]=l.useState(""),[ve,is]=l.useState(""),[be,cs]=l.useState(null),[Se,os]=l.useState(null),Ce=Ke(Ne,1500),we=30,W=Re(),{data:L,isLoading:ds,isError:ms,error:us}=rs(fe,we,Ce,ye,ve,be,Se,"all"),R=(L==null?void 0:L.data)||[];L==null||L.metadata;const X=R.filter(s=>{const D=s.patientName.toLowerCase().includes(o.toLowerCase())||s.testName.toLowerCase().includes(o.toLowerCase())||s.testCode.toLowerCase().includes(o.toLowerCase()),c=r==="all"||s.status===r,Fe=m==="all"||s.priority===m;return D&&c&&Fe}),Te=async()=>
6{if(!g||!u.testId||!u.orderedBy){f.error("Please fill in all required fields");return}const s=ne.find(c=>c._id===u.testId);if(!s)return;const D={id:Date.now().toString(),patientId:g.patientId,patientName:g.firstName+" "+g.lastName,patientPhone:g.phone,testId:u.testId,testName:s.name,testCode:s.code,category:s.category,sampleType:s.sampleType,price:s.price,status:"pending",priority:u.priority,orderedBy:u.orderedBy,orderedDate:new Date().toISOString(),notes:u.notes,referenceRange:s.normalRange,turnaroundTime:s.turnaroundTime};try{K(!0);const c=await Ee(D);if(c.status!=="success"){f.error(c.message);return}f.success(c.message)}catch(c){console.log("err",c),f.error(`Failed to submit form, All field required ${c}`)}finally{setTimeout(()=>{N(!1),K(!1),A(null),_(),W.invalidateQueries({queryKey:["patient-lab-tests"]})},1e3)}},Pe=async(s,D)=>{if(!t){f.error("Please select a test and try again");return}if(D==="completed"&&!t.results){f.error("Oops, Please enter a test result first before marking test as completed");return}try{K(!0);const c=await ss(s,D);if(c.status!=="success"){f.error(c.message);return}f.success(c.message)}catch(c){console.log("err",c),f.error(`Failed to submit form, All field required ${c}`)}finally{setTimeout(()=>{N(!1),A(null),_(),W.invalidateQueries({queryKey:["patient-lab-tests"]})},1e3)}},De=async()=>{if(!t||!C.results){f.error("Please enter test results");return}try{K(!0);const s=await ts(C.testId,C.results,C.notes,C.completedDate);if(s.status!=="success"){f.error(s.message);return}f.success(s.message)}catch(s){console.log("err",s),f.error(`Failed to submit form, All field required ${s}`)}finally{setTimeout(()=>{Q(!1),I(null),ce(),W.invalidateQueries({queryKey:["patient-lab-tests"]})},1e3)}},Oe=s=>{I(s),$({testId:s.id,results:s.results||"",notes:s.notes||"",completedDate:s.completedDate||new Date().toISOString()}),Q(!0)},_=()=>{F({patientId:"",testId:"",priority:"routine",orderedBy:"",notes:""})},ce=()=>{$({testId:"",results:"",notes:"",completedDate:new Date().toISOString()})},G=s=>{switch(s){case"pending":return"bg-yellow-500/10 text-yellow-600 border-yellow-500/20";case"sample-collected":return"bg-blue-500/10 text-blue-600 border-blue-500/20";case"in-progress":return"bg-purple-500/10 text-purple-600 border-purple-500/20";case"completed":return"bg-green-500/10 text-green-600 border-green-500/20";case"cancelled":return"bg-red-500/10 text-red-600 border-red-500/20";default:return"bg-gray-500/10 text-gray-600 border-gray-500/20"}},oe=s=>{switch(s){case"stat":return"bg-red-500/10 text-red-600 border-red-500/20";case"urgent":return"bg-orange-500/10 text-orange-600 border-orange-500/20";case"routine":return"bg-green-500/10 text-green-600 border-green-500/20";default:return"bg-gray-500/10 text-gray-600 border-gray-500/20"}},Ie=s=>{switch(s){case"completed":return e.jsx(Ze,{className:"h-4 w-4"});case"cancelled":return e.jsx(Ye,{className:"h-4 w-4"});case"in-progress":return e.jsx(xe,{className:"h-4 w-4"});default:return e.jsx(Ge,{className:"h-4 w-4"})}},z={total:R.length,pending:R.filter(s=>s.status==="pending").length,inProgress:R.filter(s=>s.status==="in-progress"||s.status==="sample-collected").length,completed:R.filter(s=>s.status==="completed").length};return ge?e.jsx("p",{className:"text-center text-xl text-gray-900",children:"Loading..."}):H?e.jsxs("p",{className:"text-center text-red-500",children:["Error in services: ",H==null?void 0:H.message]}):e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Ve,{}),e.jsxs("main",{className:"container mx-auto p-6 space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(xe,{className:"h-8 w-8 text-primary"}),"Patient Lab Tests"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage lab test orders and results for patients"})]}),e.jsxs(w,{onClick:()=>S(!0),className:"gap-2",children:[e.jsx(_e,{className:"h-4 w-4"}),"Order New Test"]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs(h,{children:[e.jsx(y,{className:"pb-2",children:e.jsx(v,{className:"text-sm font-medium text-muted-foreground",children:"Total Orders"})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold text-foreground",children:z.total})})]}),e.jsxs(h,{children:[e.jsx(y,{className:"pb-2",children:e.jsx(v,{className:"text-sm font-medium text-muted-foreground",children:"Pending"})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold text-yellow-600",children:z.pending})})]}),e.jsxs(h,{children:[e.jsx(y,{className:"pb-2",children:e.jsx(v,{className:"text-sm font-medium text-muted-foreground",children:"In Progress"})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold text-purple-600",children:z.inProgress})})]}),e.jsxs(h,{children:[e.jsx(y,{className:"pb-2",children:e.jsx(v,{className:"text-sm font-medium text-muted-foreground",children:"Completed"})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold text-green-600",children:z.completed})})]})]}),e.jsxs(h,{children:[e.jsx(y,{children:e.jsx(v,{children:"Search & Filter"})}),e.jsx(p,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ze,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(de,{placeholder:"Search by patient, test name, or code...",value:o,onChange:s=>d(s.target.value),className:"pl-10"})]}),e.jsxs(k,{value:r,onValueChange:i,children:[e.jsx(q,{children:e.jsx(U,{placeholder:"Filter by status"})}),e.jsxs(V,{children:[e.jsx(n,{value:"all",children:"All Statuses"}),e.jsx(n,{value:"pending",children:"Pending"}),e.jsx(n,{value:"sample-collected",children:"Sample Collected"}),e.jsx(n,{value:"in-progress",children:"In Progress"}),e.jsx(n,{value:"completed",children:"Completed"}),e.jsx(n,{value:"cancelled",children:"Cancelled"})]})]}),e.jsxs(k,{value:m,onValueChange:x,children:[e.jsx(q,{children:e.jsx(U,{placeholder:"Filter by priority"})}),e.jsxs(V,{children:[e.jsx(n,{value:"all",children:"All Priorities"}),e.jsx(n,{value:"routine",children:"Routine"}),e.jsx(n,{value:"urgent",children:"Urgent"}),e.jsx(n,{value:"stat",children:"STAT"})]})]})]})})]}),e.jsxs(h,{children:[e.jsxs(y,{children:[e.jsx(v,{children:"Lab Test Orders"}),e.jsxs(Me,{children:["Showing ",X.length," of ",R.length," orders"]})]}),e.jsx(p,{children:e.jsx("div",{className:"rounded-md border overflow-x-auto",children:e.jsxs(ke,{children:[e.jsx(qe,{children:e.jsxs(re,{children:[e.jsx(O,{children:"Patient"}),e.jsx(O,{children:"Test"}),e.jsx(O,{children:"Priority"}),e.jsx(O,{children:"Status"}),e.jsx(O,{children:"Ordered By"}),e.jsx(O,{children:"Ordered Date"}),e.jsx(O,{className:"text-right",children:"Actions"})]})}),e.jsx(Ue,{children:X.length===0?e.jsx(re,{children:e.jsx(P,{colSpan:7,className:"text-center text-muted-foreground py-8",children:"No lab test orders found"})}):X.map(s=>e.jsxs(re,{children:[e.jsx(P,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ue,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.patientName}),s.patientPhone&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s.patientPhone})]})]})}),e.jsx(P,{children:e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.testName}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.testCode})]})}),e.jsx(P,{children:e.jsx(M,{variant:"outline",className:oe(s.priority),children:s.priority.toUpperCase()})}),e.jsx(P,{children:e.jsx(M,{variant:"outline",className:G(s.status),children:e.jsxs("span",{className:"flex items-center gap-1",children:[Ie(s.status),s.status.replace("-"," ")]})})}),e.jsx(P,{className:"text-sm",children:s.orderedBy}),e.jsx(P,{className:"text-sm text-muted-foreground",children:new Date(s.orderedDate).toLocaleDateString()}),e.jsx(P,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(w,{variant:"ghost",size:"sm",onClick:()=>{I(s),B(!0)},children:e.jsx(Je,{className:"h-4 w-4"})}
6),s.status!=="completed"&&s.status!=="cancelled"&&e.jsx(w,{variant:"ghost",size:"sm",onClick:()=>Oe(s),children:e.jsx(We,{className:"h-4 w-4"})}),s.status==="completed"&&e.jsx(w,{variant:"ghost",size:"sm",onClick:()=>{I(s),le(!0)},className:"text-primary",children:e.jsx(Xe,{className:"h-4 w-4"})})]})})]},s.id))})]})})})]})]}),e.jsx(Qe,{isOpen:b,onClose:()=>S(!1),onSelectPatient:s=>{A(s),F({...u,patientId:s.id}),S(!1),N(!0)}}),e.jsx(Y,{open:T,onOpenChange:s=>{s||(N(!1),A(null),_())},children:e.jsxs(Z,{className:"max-w-2xl",children:[e.jsxs(E,{children:[e.jsx(ee,{children:"Order Lab Test"}),e.jsxs(me,{children:["Order a new lab test for ",g==null?void 0:g.name]})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[g&&e.jsx(h,{className:"bg-muted/50",children:e.jsx(p,{className:"pt-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ue,{className:"h-8 w-8 text-primary"}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-semibold",children:[g.firstName,g.lastName]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:g.phone}),e.jsx("p",{className:"text-sm text-muted-foreground",children:g.patientId})]})]})})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"test",children:"Select Test *"}),e.jsxs(k,{value:u.testId,onValueChange:s=>F({...u,testId:s}),children:[e.jsx(q,{children:e.jsx(U,{placeholder:"Choose a lab test"})}),e.jsx(V,{children:ne.map(s=>e.jsxs(n,{value:s._id,children:[s.name," (",s.code,") - â¦",s.price.toLocaleString()]},s._id))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"priority",children:"Priority *"}),e.jsxs(k,{value:u.priority,onValueChange:s=>F({...u,priority:s}),children:[e.jsx(q,{children:e.jsx(U,{})}),e.jsxs(V,{children:[e.jsx(n,{value:"routine",children:"Routine"}),e.jsx(n,{value:"urgent",children:"Urgent"}),e.jsx(n,{value:"stat",children:"STAT (Immediate)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"orderedBy",children:"Ordered By *"}),e.jsx(de,{id:"orderedBy",value:u.orderedBy,onChange:s=>F({...u,orderedBy:s.target.value}),placeholder:"Doctor/Staff name"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"notes",children:"Notes"}),e.jsx(te,{id:"notes",value:u.notes,onChange:s=>F({...u,notes:s.target.value}),placeholder:"Any special instructions or notes",rows:3})]})]}),e.jsxs(se,{children:[e.jsx(w,{variant:"outline",onClick:()=>{N(!1),A(null),_()},children:"Cancel"}),e.jsx(w,{onClick:Te,children:"Order Test"})]})]})}),e.jsx(Y,{open:ae,onOpenChange:B,children:e.jsxs(Z,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[e.jsx(E,{children:e.jsx(ee,{children:"Lab Test Details"})}),t&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs(h,{children:[e.jsx(y,{children:e.jsx(v,{className:"text-lg",children:"Patient Information"})}),e.jsxs(p,{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Patient Name"}),e.jsx("p",{className:"font-medium",children:t.patientName})]}),e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Phone"}),e.jsx("p",{className:"font-medium",children:t.patientPhone||"N/A"})]})]})]}),e.jsxs(h,{children:[e.jsx(y,{children:e.jsx(v,{className:"text-lg",children:"Test Information"})}),e.jsxs(p,{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Test Name"}),e.jsx("p",{className:"font-medium",children:t.testName})]}),e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Test Code"}),e.jsx("p",{className:"font-medium font-mono",children:t.testCode})]}),e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Category"}),e.jsx(M,{variant:"outline",className:`mt-1 ${G(t.category)}`,children:t.category})]}),e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Sample Type"}),e.jsx("p",{className:"font-medium",children:t.sampleType})]}),e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Priority"}),e.jsx(M,{variant:"outline",className:`mt-1 ${oe(t.priority)}`,children:t.priority.toUpperCase()})]}),e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Status"}),e.jsx(M,{variant:"outline",className:`mt-1 ${G(t.status)}`,children:t.status.replace("-"," ")})]})]}
6),t.status!=="completed"&&t.status!=="cancelled"&&e.jsxs("div",{className:"pt-2 space-y-2",children:[e.jsx(a,{className:"text-muted-foreground",children:"Status Updates"}),e.jsxs(k,{value:t.status,onValueChange:s=>{Pe(t.id,s),B(!1)},children:[e.jsx(q,{children:e.jsx(U,{})}),e.jsxs(V,{children:[e.jsx(n,{value:"pending",children:"Pending"}),e.jsx(n,{value:"sample-collected",children:"Sample Collected"}),e.jsx(n,{value:"in-progress",children:"In Progress"}),e.jsx(n,{value:"completed",children:"Completed"}),e.jsx(n,{value:"cancelled",children:"Cancelled"})]})]})]})]})]}),e.jsxs(h,{children:[e.jsx(y,{children:e.jsx(v,{className:"text-lg",children:"Order Details"})}),e.jsxs(p,{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Ordered By"}),e.jsx("p",{className:"font-medium",children:t.orderedBy})]}),e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Ordered Date"}),e.jsx("p",{className:"font-medium",children:new Date(t.orderedDate).toLocaleString()})]}),t.sampleCollectedDate&&e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Sample Collected"}),e.jsx("p",{className:"font-medium",children:new Date(t.sampleCollectedDate).toLocaleString()})]}),t.completedDate&&e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Completed Date"}),e.jsx("p",{className:"font-medium",children:new Date(t.completedDate).toLocaleString()})]})]})]}),t.referenceRange&&e.jsxs(h,{children:[e.jsx(y,{children:e.jsx(v,{className:"text-lg",children:"Reference Range"})}),e.jsx(p,{children:e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:t.referenceRange})})]}),t.results&&e.jsxs(h,{children:[e.jsx(y,{children:e.jsx(v,{className:"text-lg",children:"Test Results"})}),e.jsx(p,{children:e.jsx("p",{className:"whitespace-pre-line font-mono text-sm",children:t.results})})]}),t.notes&&e.jsxs(h,{children:[e.jsx(y,{children:e.jsx(v,{className:"text-lg",children:"Notes"})}),e.jsx(p,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:t.notes})})]})]}),e.jsx(se,{children:e.jsx(w,{onClick:()=>B(!1),children:"Close"})})]})}),e.jsx($e,{test:t,isOpen:pe,onClose:()=>{le(!1),I(null)}}),e.jsx(Y,{open:he,onOpenChange:Q,children:e.jsxs(Z,{className:"sm:max-w-[600px] sm:max-h-[500px] overflow-y-auto",children:[e.jsxs(E,{children:[e.jsx(ee,{children:"Submit Test Results"}),e.jsxs(me,{children:["Enter the results for ",t==null?void 0:t.testName]})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[t&&e.jsx(h,{className:"bg-muted/50",children:e.jsx(p,{className:"pt-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Patient"}),e.jsx("p",{className:"font-semibold",children:t.patientName})]}),e.jsxs("div",{children:[e.jsx(a,{className:"text-muted-foreground",children:"Test"}),e.jsxs("p",{className:"font-semibold",children:[t.testName," (",t.testCode,")"]})]})]})})}),(t==null?void 0:t.referenceRange)&&e.jsxs("div",{className:"p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg",children:[e.jsx(a,{className:"text-sm font-medium text-blue-600",children:"Reference Range"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 whitespace-pre-line",children:t.referenceRange})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"results",children:"Test Results *"}),e.jsx(te,{id:"results",value:C.results,onChange:s=>$({...C,results:s.target.value}),placeholder:"Enter test results...",rows:6,className:"font-mono"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"resultNotes",children:"Additional Notes"}),e.jsx(te,{id:"resultNotes",value:C.notes,onChange:s=>$({...C,notes:s.target.value}),placeholder:"Any additional observations or notes",rows:3})]})]}),e.jsxs(se,{children:[e.jsx(w,{variant:"outline",onClick:()=>{Q(!1),I(null),ce()},children:"Cancel"}),e.jsx(w,{disabled:ie,onClick:De,children:ie?"Submitting...":"Submit Results"})]})]})})]})};export{_s as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.