PageSourceSearch

https://www.ceddcozum.com/assets/PreopDiabetesCalculator-DqHTzIh3.js

js ceddcozum.com collected 2026-10-02 00:06:58 UTC 8,717 bytes, 11 lines download raw bytes

1import{r as p,u as I,j as e}from"./vendor-D3et-OR1.js";import{af as B,B as T,Z as H,a as y}from"./index-ppzD9w8I.js";import{e as S}from"./bsa-KIx54L3D.js";import{T as r,a1 as D,_ as V,$ as E}from"./index-JUmP4apz.js";import{e as c}from"./displayPrecision-BZU6RO3_.js";import{u as w}from"./useClipboard-BVGAtZHW.js";import"./i18n-Lgj2Bm8L.js";import"./ui-B676v3Vd.js";import"./utils-CbsVbbwn.js";import"./label-B9bIah-Q.js";import"./sexColors-Dgg08wa6.js";import"./auxologyDatasets-r7ycsk6o.js";import"./badge-sH-UQbX5.js";import"./external-link-DEgPDYfy.js";import"./DateAgeConverter-D1oTDdey.js";import"./circle-alert-BIcAIWDK.js";import"./upload-DXQgiT78.js";function U(t){return(4*t+7)/(t+90)}function k(t){return t<110?0:t<140?.025:t<220?.05:t<270?.075:.1}function K(t){return t>250?{fluidType:"0.45% NaCl",dextroseConcentration:"No dextrose"}:{fluidType:"0.45% NaCl + 5% Dextrose",dextroseConcentration:"5% Dextrose"}}function _(t,o){if(t<=0||o<=0)return null;const n=U(t),l=k(o),h=t*l,m=h,{fluidType:b,dextroseConcentration:u}=K(o),g=1700*n,a=g/24;return{weight:t,bsa:n,bloodGlucose:o,insulinRate:l,insulinUnitsPerHour:h,insulinInfusionMLPerHour:m,fluidType:b,dextroseConcentration:u,dailyMaintenanceFluid:g,hourlyMaintenanceFluid:a,maxFluidGirls:2e3,maxFluidBoys:2500}}function W(t,o){const n=[{glucoseRange:"< 110 mg/dL",rateValue:0,isActive:!1},{glucoseRange:"110-140 mg/dL",rateValue:.025,isActive:!1},{glucoseRange:"140-220 mg/dL",rateValue:.05,isActive:!1},{glucoseRange:"220-270 mg/dL",rateValue:.075,isActive:!1},{glucoseRange:"> 270 mg/dL",rateValue:.1,isActive:!1}];return t!==null&&(t<110?n[0].isActive=!0:t<140?n[1].isActive=!0:t<220?n[2].isActive=!0:t<270?n[3].isActive=!0:n[4].isActive=!0),o!==null&&n.forEach(l=>{l.rateValue>0&&(l.calculatedMLPerHour=o*l.rateValue)}),n}function oe(){const{preferences:t}=B(),o=t.bsaMethod,n=o!=="costeff",[l,h]=p.useState(),[m,b]=p.useState(),[u,g]=p.useState(),[a,x]=p.useState(null),{copyToClipboard:N}=w(),{t:s,i18n:d}=I(),M=p.useRef(null),v=r.CLINICAL_RANGES.weight,F=r.CLINICAL_RANGES.height,R=r.getClinicalRange("glucose"),A=p.useMemo(()=>l===void 0||!Number.isFinite(l)||l<=0?null:l,[l]),L=W(u!==void 0&&u>0?u:null,A);p.useEffect(()=>{if(l===void 0||!Number.isFinite(l)||l<=0||u===void 0||!Number.isFinite(u)||u<=0){x(null);return}if(n&&(m===void 0||!Number.isFinite(m)||m<=0)){x(null);return}const i=l,j=S({method:o,weightKg:i,heightCm:n?m:void 0});if(!j){x(null);return}const f=_(i,u);f&&(f.bsa=j.bsa,f.dailyMaintenanceFluid=1700*j.bsa,f.hourlyMaintenanceFluid=f.dailyMaintenanceFluid/24),x(f)},[l,m,u,o,n]);const $=()=>{if(!a)return;const i=`=== ${s("tools.preop-diabetes.results.title")} ===
2${s("tools.preop-diabetes.inputs.weight")}: ${c(a.weight,1,d.language)} kg
3BSA: ${c(a.bsa,2,d.language)} m²
4${s("tools.preop-diabetes.inputs.bloodGlucose")}: ${c(a.bloodGlucose,0,d.language)} mg/dL
5
6${s("tools.preop-diabetes.results.fluidManagement")}:
7- ${s("tools.preop-diabetes.results.fluidType")}: ${a.fluidType}
8- ${s("tools.preop-diabetes.results.maintenanceFluid")} (1700 ml/m²/day): ${c(a.dailyMaintenanceFluid,0,d.language)} ml/day
9- ${s("tools.preop-diabetes.results.hourlyMaintenance")}: ${c(a.hourlyMaintenanceFluid,1,d.language)} ml/hour
10- ${s("tools.preop-diabetes.results.maxFluidFemales")}: ${a.maxFluidGirls} ml/day
11- ${s("tools.preop-diabetes.results.maxFluidMales")}: ${a.maxFluidBoys} ml/day`;N(i)},P=()=>{h(void 0),b(void 0),g(void 0),x(null)};return e.jsxs(r.Layout,{children:[e.jsxs(r.Content,{children:[e.jsx(r.Header,{title:s("tools.preop-diabetes.title"),subtitle:s("tools.preop-diabetes.subtitle"),children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(r.InfoButton,{datasetId:"insulin-cpeptide-reference",toolContext:"preop-diabetes",availableDatasets:["insulin-cpeptide-reference"]})})}),e.jsx(r.Form,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(r.InputField,{label:s("tools.preop-diabetes.inputs.weight"),type:"numeric",parameter:"weight",unit:D(t.weight),min:v.min,max:v.max,step:.1,value:l,onChange:i=>h(typeof i=="number"?i:void 0)}),n&&e.jsx(r.InputField,{label:s("tools.shared.height"),type:"numeric",parameter:"height",unit:V(t.height),min:F.min,max:F.max,step:.1,value:m,onChange:i=>b(typeof i=="number"?i:void 0)}),e.jsx(r.InputField,{label:s("tools.preop-diabetes.inputs.bloodGlucose"),type:"numeric",parameter:"other",unit:"mg/dL",min:R.min,max:R.max,step:1,value:u,onChange:i=>g(typeof i=="number"?i:void 0)}),e.jsx(r.ClearButton,{onClick:P,className:"!mt-2"})]})})]}),e.jsxs(r.Results,{ref:M,children:[e.jsx(r.ResultsHeader,{title:s("tools.shared.results"),subtitle:s("tools.shared.resultsSubtitle"),children:a&&e.jsx(T,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$,children:e.jsx(H,{className:"h-4 w-4"})})}),a?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"p-4 bg-muted/30 rounded-lg",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"BSA"}),e.jsxs("span",{className:"text-lg font-semibold",children:[c(a.bsa,2,d.language)," m²"]})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-1",children:s("tools.preop-diabetes.insulinRates.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("tools.preop-diabetes.insulinRates.preparation")})]}),e.jsx("div",{className:"space-y-2",children:L.map((i,C)=>e.jsxs("div",{className:y("flex items-center justify-between p-3 rounded-lg transition-colors border",i.isActive?"bg-primary/10 border-primary/20":"border-border"),children:[e.jsx("span",{className:y("text-sm",i.isActive?"font-medium text-primary":"text-muted-foreground"),children:i.glucoseRange}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:y("text-sm",i.isActive?"font-semibold text-primary":"text-muted-foreground"),children:i.rateValue===0?s("tools.preop-diabetes.insulinRates.noInfusion"):`${c(i.rateValue,3,d.language)} ${s("tools.preop-diabetes.insulinRates.unit")}`}),i.calculatedMLPerHour!==void 0&&i.calculatedMLPerHour>0&&e.jsxs("div",{className:y("text-xs",i.isActive?"text-primary/80":"text-muted-foreground"),children:["(",c(i.calculatedMLPerHour,2,d.language)," ",s("tools.preop-diabetes.insulinRates.unitParentheses"),")"]})]})]},C))}),e.jsx("p",{className:"text-xs text-muted-foreground text-center pt-2 border-t",children:s("tools.preop-diabetes.insulinRates.note")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"font-semibold",children:s("tools.preop-diabetes.results.fluidManagement")}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between pb-2 border-b",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("tools.preop-diabetes.results.fluidType")}),e.jsx("span",{className:"text-sm font-medium",children:a.fluidType})]}),e.jsxs("div",{className:"flex items-start justify-between pb-2 border-b",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s("tools.preop-diabetes.results.maintenanceFluid")}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["(1700 ml/m²/",s("tools.preop-diabetes.results.mlPerDay").split("/")[1],")"]})]}),e.jsxs("span",{className:"text-sm font-medium",children:[c(a.dailyMaintenanceFluid,0,d.language)," ",s("tools.preop-diabetes.results.mlPerDay")]})]}),e.jsxs("div",{className:"flex items-center justify-between pb-2 border-b",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("tools.preop-diabetes.results.hourlyMaintenance")}),e.jsxs("span",{className:"text-sm font-medium",children:[c(a.hourlyMaintenanceFluid,1,d.language)," ",s("tools.preop-diabetes.results.mlPerHour")]})]}),e.jsxs("div",{className:"mt-4 p-3 bg-muted/30 rounded-lg space-y-2",children:[e.jsxs("div",{className:"text-xs font-medium",children:[s("tools.preop-diabetes.results.maxFluidLimits"),":"]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:["• ",s("tools.preop-diabetes.results.females")]}),e.jsxs("span",{className:"text-xs font-medium",children:[a.maxFluidGirls," ",s("tools.preop-diabetes.results.mlPerDay")]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:["• ",s("tools.preop-diabetes.results.males")]}),e.jsxs("span",{className:"text-xs font-medium",children:[a.maxFluidBoys," ",s("tools.preop-diabetes.results.mlPerDay")]})]})]})]})]})]}):e.jsx(E,{})]})]})}export{oe as PreopDiabetesCalculator};

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.