1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e39a47c7-98fa-4bf8-8410-03b06c58942d",e._sentryDebugIdIdentifier="sentry-dbid-e39a47c7-98fa-4bf8-8410-03b06c58942d")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9070],{7871:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/patient/visits/[id]",function(){return r(73027)}])},47680:function(e,n,r){"use strict";var o=r(85893),i=r(113),t=r(45198),l=r(72715),a=r(99324),s=r(24441),c=r(19645),d=r(58461),u=r(25211),m=r(71413),p=r(71124),x=r(10257),g=r(4975),h=r(40533),f=r(84653),v=r(67294);let b=e=>({backgroundColor:e.palette.layout.muted,border:"1px solid ".concat(e.palette.layout.border),borderRadius:"".concat(e.shape.borderRadiusTokens[p.cM.LARGE],"px"),padding:"".concat(e.spacing(4)," ").concat(e.spacing(5)," ").concat(e.spacing(5)),display:"flex",flexDirection:"column",gap:e.spacing(4)}),y=e=>({display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:e.spacing(4)}),j=e=>({display:"flex",flexDirection:"column",gap:e.spacing(1)});n.Z=e=>{let{loading:n,resourceAI:r}=e,R=(0,h.Z)(),[E,S]=(0,v.useState)(!0);if(n)return(0,o.jsx)(u.Z,{variant:"rounded",height:240,borderRadius:p.cM.LARGE});if(!E)return null;r.insights.find(e=>"SUMMARY"===e.type);let O=r.insights.filter(e=>"SUGGESTION"===e.type);return(0,o.jsxs)(f.Z,{sx:b,"data-testid":"ai-suggestions-card",children:[(0,o.jsxs)(f.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,o.jsxs)(f.Z,{sx:{display:"flex",alignItems:"center",gap:R.spacing(2)},children:[(0,o.jsx)(l.A,{icon:x.eZrc,size:a.E.REG,colorScheme:p.eL.PRIMARY,colorProperty:p.g8.HOVER}),(0,o.jsx)(c.W$,{fontWeight:"bold",colorScheme:p.eL.LAYOUT,colorProperty:p.g8.FOREGROUND,children:"AI suggestions"}),(0,o.jsx)(i.Z,{children:"Beta"})]}),(0,o.jsx)(t.ZP,{icon:(0,o.jsx)(l.A,{icon:g.rUE1,colorScheme:p.eL.LAYOUT,colorProperty:p.g8.FOREGROUND,size:a.E.REG}),onClick:()=>S(!1),"aria-label":"Close"})]}),r.fields.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.ZP,{}),(0,o.jsx)(f.Z,{sx:y,children:r.fields.map(e=>{var n;return(0,o.jsxs)(f.Z,{sx:j,children:[(0,o.jsx)(c.__,{fontWeight:"semibold",colorScheme:p.eL.LAYOUT,colorProperty:p.g8.MUTED_FOREGROUND,children:e.label.toUpperCase()}),(0,o.jsx)(c.uT,{size:"sm",fontWeight:"bold",colorScheme:p.eL.LAYOUT,colorProperty:p.g8.FOREGROUND,children:e.value}),e.originalValue&&e.originalValue!==e.value&&(0,o.jsx)(f.Z,{sx:{fontFamily:"Menlo, monospace",fontSize:"14px",lineHeight:"150%",color:null===(n=R.palette[p.eL.LAYOUT])||void 0===n?void 0:n[p.g8.MUTED_FOREGROUND]},children:e.originalValue})]},e.key)})})]}),O.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.ZP,{}),O.map(e=>(0,o.jsxs)(f.Z,{sx:{display:"flex",flexDirection:"column",gap:R.spacing(2)},children:[(0,o.jsx)(c.__,{fontWeight:"semibold",colorScheme:p.eL.LAYOUT,colorProperty:p.g8.MUTED_FOREGROUND,children:"SUGGESTION"}),(0,o.jsx)(c.uT,{size:"sm",fontWeight:"bold",colorScheme:p.eL.LAYOUT,colorProperty:p.g8.FOREGROUND,children:e.value}),e.description&&(0,o.jsx)(c.uT,{size:"sm",colorScheme:p.eL.LAYOUT,colorProperty:p.g8.MUTED_FOREGROUND,children:e.description})]},e.value))]}),(0,o.jsx)(f.Z,{sx:{mx:"-".concat(R.spacing(5)),mb:"-".concat(R.spacing(5))},children:(0,o.jsx)(d.Z,{subjectId:r.id,subjectType:m.vj8.RESOURCE_AI,feedbackOptions:r.feedbackOptions,commentLabel:"Describe what's not right.",commentPlaceholder:"Ex. inaccurate, confusing, missing, hallucination"})})]})}},9326:function(e,n,r){"use strict";r.d(n,{B:function(){return a}});var o=r(6162),i=r.n(o),t=r(53632),l=r.n(t);let a=e=>{let n;if(!e)return null;try{n=JSON.parse(e)}catch(e){return null}if(!Array.isArray(n))return null;let r=n.map(e=>{var n;return null===(n=e.low)||void 0===n?void 0:n.value}).filter(Boolean),o=n.map(e=>{var n;return null===(n=e.high)||void 0===n?void 0:n.value}).filter(Boolean),t=l()(r),a=i()(o);if(t&&a)return"".concat(t," - ").concat(a)}},27337:function(e,n,r){"use strict";var o=r(85893),i=r(32761);n.Z=e=>{let{children:n}=e;return(0,o.jsx)(i.x,{as:"span",display:"flex",alignItems:"center",justifyContent:"center",w:"fit-content",minW:"6",maxH:"6",px:"2",py:"1",borderRadius:"sm",color:"#e23e1e",fontSize:"12px",fontWeight:"semibold",lineHeight:"14px",css:{background:"linear-gradient(282deg, #FBCBBB -87.56%, #FFF3ED 127.21%)"},children:n})}},93843:function(e,n,r){"use strict";r.d(n,{US:function(){return t}});var o=r(85893),i=r(32761),t=e=>{let{label:n}=e;return(0,o.jsxs)(i.x,{role:"progressbar","aria-label":n,"aria-busy":!0,position:"relative",w:"100%",h:"2",borderRadius:"roun
1ded",overflow:"hidden",bg:"secondaryBrand.main/30",children:[(0,o.jsx)("style",{children:"@keyframes indeterminateProgressSweep {\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(500%); }\n}"}),(0,o.jsx)(i.x,{position:"absolute",top:"0",bottom:"0",left:"0",w:"20%",borderRadius:"rounded",bg:"secondaryBrand.main",css:{animation:"indeterminateProgressSweep 1.1s ease-in-out infinite"}})]})}},20270:function(e,n,r){"use strict";r.d(n,{$O:function(){return o},AI:function(){return t},Fu:function(){return i},q1:function(){return l}});let o="linear-gradient(90deg, #fb4d27, #500014)",i={width:"100%",boxSizing:"border-box",bg:"rgba(255, 243, 237, 0.4)",border:"1px solid",borderColor:"layout.accent.main",borderRadius:"lg",pt:"4",pl:{base:"3",lg:"5"},pr:{base:"3",lg:"6"}},t={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"2",flexShrink:0,width:"auto",alignSelf:{base:"flex-start",lg:"auto"},marginLeft:{base:"6",lg:"0"},appearance:"none",border:"none",bg:"transparent",borderRadius:"rounded",px:"4",py:"2",boxShadow:"0px 8px 16px -4px rgba(22, 34, 51, 0.08)",cursor:"pointer",_hover:{bg:"layout.accent.main"},_focusVisible:{outline:"2px solid {colors.layout.ring}",outlineOffset:"2px"},_disabled:{cursor:"not-allowed",opacity:.5,boxShadow:"none",_hover:{bg:"transparent"}}},l={border:"2px solid transparent",background:"".concat(o," border-box"),WebkitMask:"linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0)",WebkitMaskComposite:"xor",maskComposite:"exclude"}},6113:function(e,n,r){"use strict";r.d(n,{Z:function(){return j}});var o=r(85893),i=r(27337),t=r(39917),l=r(74569),a=r(16379),s=r(32761),c=r(85896),d=r(23872),u=r(13526),m=r(49246),p=r(10257),x=r(4975),g=r(67294),h=r(20270);let f=e=>{let{as:n="p",id:r,fontSize:i,fontWeight:t="normal",lineHeight:l,letterSpacing:a,children:c}=e;return(0,o.jsx)(s.x,{as:n,id:r,margin:0,color:"layout.accent.foreground",fontSize:i,fontWeight:t,lineHeight:l,letterSpacing:a,children:c})},v=e=>{let{size:n}=e;return(0,o.jsx)(s.x,{as:"span","aria-hidden":!0,display:"inline-flex",color:"layout.ring",flexShrink:0,children:(0,o.jsx)(l.A,{icon:p.eZrc,size:n,useCurrentColor:!0})})},b=e=>{let{label:n,onClick:r,testId:i,disabled:t}=e;return(0,o.jsxs)(c.m.button,{type:"button",onClick:r,disabled:t,"data-testid":i,css:h.AI,children:[(0,o.jsx)(s.x,{"aria-hidden":!0,position:"absolute",inset:"0",borderRadius:"rounded",pointerEvents:"none",css:h.q1}),(0,o.jsx)(v,{size:a.E.REG}),(0,o.jsx)(s.x,{as:"span",color:"layout.accent.foreground",fontSize:"md",fontWeight:"semibold",lineHeight:"1.1",children:n})]})},y={base:"6",lg:"7"};var j=e=>{var n;let{title:r,description:l,action:c,learnMore:p,showBetaBadge:j=!1,testId:R}=e,E=null!==(n=(0,d.S)({base:a.E.REG,lg:a.E.L}))&&void 0!==n?n:a.E.REG,S=(0,g.useId)();return(0,o.jsx)(s.x,{as:"aside","aria-labelledby":S,...h.Fu,pb:{base:"4",lg:p?"3":"4"},"data-testid":R,children:(0,o.jsxs)(u.k,{gap:"4",align:{base:"stretch",lg:"center"},justify:"space-between",direction:{base:"column",lg:"row"},children:[(0,o.jsxs)(m.K,{gap:"1",flex:"1",minW:"0",width:{base:"100%",lg:"auto"},children:[(0,o.jsxs)(u.k,{gap:"2",align:"flex-start",children:[(0,o.jsx)(v,{size:E}),(0,o.jsx)(f,{as:"h2",id:S,fontSize:{base:"lg",lg:"2xl"},fontWeight:"semibold",lineHeight:{base:"1.1",lg:"1.4"},letterSpacing:{base:"0.2px",lg:"0"},children:r}),j&&(0,o.jsx)(s.x,{alignSelf:"center",children:(0,o.jsx)(i.Z,{children:"Beta"})})]}),(0,o.jsx)(s.x,{pl:y,children:(0,o.jsx)(f,{fontSize:"sm",lineHeight:"1.6",children:l})}),p&&(0,o.jsx)(s.x,{pl:y,mt:"-1",children:(0,o.jsx)(t.hh,{variant:t.kl.SECONDARY,href:p.href,icon:{icon:x.lJjZ,position:"end"},children:p.label})})]}),(0,o.jsx)(b,{...c})]})})}},33531:function(e,n,r){"use strict";var o=r(85893),i=r(22218),t=r(51055),l=r(45827),a=r(71124),s=r(8689),c=r(84653),d=r(41664),u=r.n(d);n.Z=e=>{let{label:n,icon:r,iconPosition:d="end",href:m,onClick:p,responsiveFontSize:x}=e,g=(0,s.F)();return(0,o.jsxs)(c.Z,{component:m?u():"div",href:m,onClick:p?e=>{e.stopPropagation(),p()}:void 0,role:p?"button":void 0,tabIndex:p?0:void 0,onKeyDown:p?e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),p())}:void 0,sx:{display:"flex",gap:g.spacing(3),alignItems:"center",cursor:m||p?"pointer":"default",...m&&{textDecoration:"none"}},children:[r&&"start"===d&&(0,o.jsx)(i.JO,{iconName:r,color:i.EY.Clickable,size:i.Jh.MD}),x?(0,o.jsx)(l.Z,{colorScheme:a.eL.SECONDARY_BRAND,colorProperty:a.g8.MAIN,fontWeight:"semibold",fontSize:{xs:"14px",md:"16px"},lineHeight:"150%",children:n}):(0,o.jsx)(t.Z,{colorScheme:a.eL.SECONDARY_BRAND,colorProperty:a.g8.MAIN,fontWeight:"semibold",children:n}),r&&"end"===d&&(0,o.jsx)(i.JO,{iconName:r,color:i.EY.Clickable,size:i.Jh.MD})]})}},39518:function(e,n,r){"use strict";var o=r(38120),i=r(6812),t=r(11163),l=r(67294);n.Z=(e,n)=>{var r,a;let s=(0,t.useRouter)(),c=s.isReady?s.query.id:void 0,d=!s.isReady||!c||!!(null==n?void 0:n.skip),{data:u,loading:m,error:p,refetch:x}=(0,i.aM)(e,{variables:c?null!==(a=null==n?void 0:null===(r=n.buildVariables)||void 0===r?void 0:r.call(n,c))&&void 0!==a?a:{novelliaResourceId:c}:void 0,skip:d}),g=m||!!(null==n?void 0:n.skip),{captureMessage:h}=(0,o.L)();return(0,l.useEffect)(()=>{if(s.isReady){if(!c){s.replace("/404");return}if(!g){if(p){s.replace("/404");return}u||(h("Record not found for id: ".concat(c),"warning"),s.replace("/404"))}}},[s.isReady,g,u,p,c]),{record:u,loading:g,error:p,refetch:x,id:c}}},17055:function(e,n,r){"use strict";r.d(n,{P:function(){return s}});var o=r(11946),i=r(82729);function t(){let e=(0,i._)(["\n query ResourceAI($novelliaResourceId: String!, $patientPortalResourceType: String!) {\n resourceAI(novelliaResourceId: $novelliaResourceId, patientPortalResourceType: $patientPortalResourceType) {\n id\n fields {\n key\n label\n value\n originalValue\n }\n insights {\n type\n value\n action\n description\n }\n feedbackOptions {\n label\n enableComment\n }\n }\n }\n"]);return t=function(){return e},e}let l=(0,r(68806).Ps)(t());var a=r(6812);function s(e,n){var r;let{currentUserFlags:i}=(0,o.Z)(),t=!!(null==i?void 0:i.resourceAISuggestionsEnabled),{data:s,loading:c}=(0,a.aM)(l,{variables:{novelliaResourceId:null!=e?e:"",patientPortalResourceType:null!=n?n:""},skip:!e||!n||!t});return{resourceAI:null!==(r=null==s?void 0:s.resourceAI)&&void 0!==r?r:null,loading:t&&c,enabled:t}}},73027:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return ez}});var o=r(85893);let i=e=>(null==e?void 0:e.userGeneratedDisplayName)||(null==e?void 0:e.name)||"Encounter";var t=r(96753),l=r(113),a=r(42667),s=r(27337),c=r(39917),d=r(74569),u=r(16379),m=r(93843),p=r(68713),x=r(6113),g=r(71124),h=r(41770),f=r(79934),v=r(13526),b=r(49246),y=r(85896),j=r(4975),R=e=>{let{open:n,onOpenChange:r,onConfirm:i,loading:t,recordName:l,recordDate:a}=e;return(0,o.jsx)(h.GR,{open:n,onOpenChange:e=>r(e.open),role:"alertdialog",motionPreset:"none",children:(0,o.jsxs)(f.h,{children:[(0,o.jsx)(h.ZR,{_open:{animationName:"none"},_closed:{animationName:"none"}}),(0,o.jsx)(h.Qd,{children:(0,o.jsxs)(h.cZ,{"data-testid":"discard-summary-dialog",minW:{base:"0",sm:"520px"},maxW:{base:"calc(100% - {spacing.6})",sm:"lg"},p:"0",bg:"layout.card",borderRadius:"sm",border:"1px solid",borderColor:"layout.border",boxShadow:"0px 16px 24px 0px rgba(22, 34, 51, 0.08), 0px 4px 8px -4px rgba(22, 34, 51, 0.08)",children:[(0,o.jsx)(h.fK,{pt:"3",pb:"1",pl:"5",pr:"2",children:(0,o.jsxs)(v.k,{justify:"space-between",align:"flex-start",gap:"4",width:"100%",children:[(0,o.jsxs)(b.K,{gap:"0",children:[(0,o.jsx)(p.Dx,{fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:"Discard Summary"}),(0,o.jsx)(p.uT,{size:"sm",fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:[l,a].filter(Boolean).join(" ")})]}),(0,o.jsx)(c.ZP,{icon:(0,o.jsx)(d.A,{icon:j.rUE1,size:u.E.SM,colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,useCurrentColor:!0}),variant:c.gZ.DEFAULT,size:c.rm.SM,"aria-label":"Close",onClick:()=>r(!1)})]})}),(0,o.jsx)(h.a7,{pt:"3",pb:"4",px:"5",children:(0,o.jsx)(p.uT,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:"This will remove this summary from this record. You can regenerate another summary at any time from the more menu."})}),(0,o.jsxs)(h.cN,{pt:"1",pb:"4",px:"5",gap:"3",children:[(0,o.jsx)(c.zx,{variant:c.Wu.OUTLINED,size:c.qE.MD,onClick:()=>r(!1),disabled:t,children:"Cancel"}),(0,o.jsx)(y.m.button,{type:"button",onClick:i,disabled:t,"data-testid":"confirm-discard-summary",appearance:"none",border:"none",bg:"errorDestructive.main",color:"primaryBrand.foreground",borderRadius:"sm",minH:"48px",px:"4",py:"3",fontSize:"md",fontWeight:"semibold",lineHeight:"1.1",cursor:"pointer",_hover:{bg:"errorDestructive.hover"},_disabled:{opacity:.5,cursor:"not-allowed"}
1,_focusVisible:{outline:"2px solid",outlineColor:"layout.ring",outlineOffset:"2px"},children:"Discard"})]})]})})]})})};let E={LOADING:"loading",CTA:"cta",GENERATING:"generating",ERROR:"error",COMPLETED:"completed",NEEDS_REVIEW:"needsReview",HIDDEN:"hidden"};var S=r(71413),O=r(29295),D=r(32761),I=r(10257),T=r(67294),L=r(20270);let U={width:"100%",boxSizing:"border-box",borderRadius:"lg",boxShadow:"0px 8px 16px 0px rgba(17, 17, 26, 0.02), 0px 4px 12px 0px rgba(17, 17, 26, 0.02)",pt:"4",px:"5",pb:"5"},A={...U,css:{border:"2px solid transparent",backgroundImage:"linear-gradient(#fff, #fff), ".concat(L.$O),backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box"}},N={...U,border:"2px solid",borderColor:"layout.accent.foreground"},Z="/patient/account/settings?tab=".concat(a.P.NOVELLIA_AI),k={[S.VFr.NOTE]:"Provider note",[S.VFr.LABS]:"Lab results",[S.VFr.ORDER]:"Order",[S.VFr.VITALS]:"Vitals"},P=e=>{let{as:n="p",fontSize:r,fontWeight:i="normal",lineHeight:t,children:l}=e;return(0,o.jsx)(D.x,{as:n,margin:0,color:"layout.accent.foreground",fontFamily:"body",fontSize:r,fontWeight:i,lineHeight:t,children:l})},G=e=>{let{size:n}=e;return(0,o.jsx)(D.x,{as:"span",display:"inline-flex",color:"layout.ring",children:(0,o.jsx)(d.A,{icon:I.eZrc,size:n,useCurrentColor:!0})})},C=e=>{let{children:n}=e;return(0,o.jsx)(p.uT,{fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:n})},w=e=>{let{type:n}=e;return(0,o.jsx)(D.x,{as:"span",display:"inline-block",ml:"1",px:"1",bg:"neutral.main",color:"layout.muted-foreground",fontSize:"10px",fontStyle:"italic",lineHeight:"1.6",borderRadius:"sm",children:k[n]})},z=e=>{let{title:n,action:r}=e;return(0,o.jsxs)(v.k,{justify:"space-between",align:"center",gap:"2",children:[(0,o.jsxs)(v.k,{align:"center",gap:"2",children:[(0,o.jsx)(G,{size:u.E.REG}),(0,o.jsx)(P,{as:"h2",fontSize:{base:"xl",lg:"2xl"},fontWeight:"semibold",lineHeight:"1.4",children:n}),(0,o.jsx)(s.Z,{children:"Beta"})]}),r]})};var F=e=>{let{status:n,summary:r,recordName:i,recordDate:t,onGenerate:l,onDiscard:a,discarding:s,feedbackSlot:h}=e,[f,y]=(0,T.useState)(!1),S=async()=>{await a()&&y(!1)};if(n===E.HIDDEN||n===E.LOADING)return null;if(n===E.CTA)return(0,o.jsx)(x.Z,{title:"Summarize this doctor visit",description:"Get key takeaways and next steps in seconds.",showBetaBadge:!0,learnMore:{href:Z,label:"Learn more about how we use AI"},action:{label:"Summarize visit",onClick:l,testId:"summarize-visit"}});if(n===E.GENERATING)return(0,o.jsxs)(D.x,{...A,role:"status","data-testid":"record-summary-generating",children:[(0,o.jsx)(z,{title:"Summarizing this visit..."}),(0,o.jsx)(D.x,{mt:"3",children:(0,o.jsx)(m.US,{label:"Summarizing this visit"})}),(0,o.jsx)(D.x,{mt:"2",children:(0,o.jsx)(P,{fontSize:"sm",lineHeight:"1.2",children:"This may take a few moments. We'll notify you when it's ready for you to review."})})]});if(n===E.ERROR)return(0,o.jsxs)(D.x,{...A,"data-testid":"record-summary-error",children:[(0,o.jsx)(z,{title:"Summarizing this visit..."}),(0,o.jsxs)(v.k,{mt:"3",role:"alert",bg:"error.standard.background",borderRadius:"md",p:"3",align:"center",justify:"space-between",gap:"3",children:[(0,o.jsxs)(v.k,{align:"center",gap:"2",color:"error.standard.foreground",children:[(0,o.jsx)(d.A,{icon:j._jyQ,size:u.E.SM,useCurrentColor:!0}),(0,o.jsx)(D.x,{as:"span",fontSize:"sm",fontWeight:"semibold",lineHeight:"1.2",children:"We couldn't generate a summary for this visit."})]}),(0,o.jsx)(c.zx,{variant:c.Wu.OUTLINED,size:c.qE.SM,onClick:l,testId:"retry-summary",children:"Try again"})]})]});let I=n===E.NEEDS_REVIEW,L=async()=>{await a()};return(0,o.jsxs)(D.x,{...I?N:A,"data-testid":"record-summary-card",children:[(0,o.jsxs)(b.K,{gap:"2",children:[(0,o.jsx)(z,{title:I?"Summarizing this visit...":"
1Visit summary",action:I?(0,o.jsx)(c.ZP,{icon:(0,o.jsx)(d.A,{icon:j.rUE1,size:u.E.REG,useCurrentColor:!0}),variant:c.gZ.DEFAULT,size:c.rm.SM,"aria-label":"Close",onClick:L,disabled:s,"data-testid":"needs-review-close-header"}):(0,o.jsx)(c.ZP,{icon:(0,o.jsx)(d.A,{icon:j.tMiH,size:u.E.REG,colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,useCurrentColor:!0}),variant:c.gZ.DEFAULT,size:c.rm.SM,"aria-label":"Discard summary",onClick:()=>y(!0)})}),(0,o.jsxs)(b.K,{gap:"5",children:[I?(0,o.jsxs)(v.k,{bg:"neutral.main",borderRadius:"lg",px:"4",py:"2",gap:"2",align:{base:"stretch",lg:"center"},direction:{base:"column",lg:"row"},children:[(0,o.jsxs)(b.K,{gap:"2",flex:"1",children:[(0,o.jsx)(p.uT,{size:"md",fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:"Summary unavailable"}),(0,o.jsx)(p.uT,{size:"md",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:"We don't have enough information from this visit to summarize it accurately. Check with your care team if you think this is missing information."})]}),(0,o.jsx)(D.x,{alignSelf:{base:"flex-start",lg:"auto"},children:(0,o.jsx)(c.zx,{variant:c.Wu.OUTLINED,size:c.qE.SM,onClick:L,loading:s,testId:"needs-review-close-callout",children:"Close"})})]}):(0,o.jsxs)(b.K,{gap:"4",children:[(null==r?void 0:r.keyTakeaways.length)?(0,o.jsxs)(b.K,{gap:"2",children:[(0,o.jsx)(C,{children:"Key takeaways"}),(0,o.jsx)(D.x,{as:"ul",listStyleType:"disc",ps:"5",display:"flex",flexDirection:"column",gap:"1",children:r.keyTakeaways.map((e,n)=>(0,o.jsxs)(p.xv,{component:"li",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,fontSize:"md",lineHeight:"1.6",children:[e.text," ",(0,o.jsx)(w,{type:e.sourceType})]},n))})]}):null,(null==r?void 0:r.encounterSummary)?(0,o.jsxs)(b.K,{gap:"2",children:[(0,o.jsx)(C,{children:"Overview"}),(0,o.jsx)(p.uT,{size:"md",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:r.encounterSummary.findings}),r.encounterSummary.nextSteps?(0,o.jsx)(p.uT,{size:"md",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:r.encounterSummary.nextSteps}):null]}):null]}),r&&!I&&(0,o.jsx)(p.uT,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:"Generated from your records on ".concat((0,O.$X)(null==r?void 0:r.generatedAt)," \xb7 Not medical advice")}),!I&&h]})]}),(0,o.jsx)(R,{open:f,onOpenChange:y,onConfirm:S,loading:s,recordName:i,recordDate:t})]})},M=r(22347),_=r(82457);let W=(0,_.P)("\n query EncounterAISummary($novelliaResourceId: String!) {\n encounterAISummary(novelliaResourceId: $novelliaResourceId) {\n id\n novelliaResourceId\n status\n keyTakeaways {\n text\n sourceType\n }\n encounterSummary {\n findings\n nextSteps\n }\n model\n generationId\n generatedAt\n deletedAt\n }\n }\n"),Y=(0,_.P)("\n mutation GenerateEncounterAISummary($novelliaResourceId: String!) {\n generateEncounterAISummary(novelliaResourceId: $novelliaResourceId) {\n id\n novelliaResourceId\n status\n keyTakeaways {\n text\n sourceType\n }\n encounterSummary {\n findings\n nextSteps\n }\n model\n generationId\n generatedAt\n deletedAt\n }\n }\n"),B=(0,_.P)("\n mutation DiscardEncounterAISummary($novelliaResourceId: String!) {\n discardEncounterAISummary(novelliaResourceId: $novelliaResourceId) {\n id\n novelliaResourceId\n status\n keyTakeaways {\n text\n sourceType\n }\n encounterSummary {\n findings\n nextSteps\n }\n model\n generationId\n generatedAt\n deletedAt\n }\n }\n");var V=r(66350),H=r(6812),$=r(50319),q=r(58461),X=r(97902),K=r(11946),J=r(39518),Q=r(17055),ee=r(58476),en=r(47680),er=r(14743),eo=r(52394),ei=r(9326),et=r(24441),el=r(51055),ea=r(83873),es=r(25211),ec=r(84653),ed=r(22424),eu=r(25935);let em=e=>ed.Z.sanitize(e,{FORBID_ATTR:["style","class","id","font"],FORBID_TAGS:["script","style","iframe","object","embed","form","input"]}),ep={replace(e){if(!("name"in e)||!("children"in e))return;let n=(0,eu.du)(e.children,ep);switch(e.name){case"html":case"body":return(0,o.jsx)(o.Fragment,{children:n});case"head":case"title":case"meta":return null;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return(0,o.jsx)(ec.Z,{sx:{mt:2,mb:1},children:(0,o.jsx)(el.Z,{fontWeight:"semibold",size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:n})});case"p":return(0,o.jsx)(ec.Z,{sx:{mb:2},children:(0,o.jsx)(el.Z,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:n})});case"li":case"span":return(0,o.jsx)(el.Z,{component:"span",size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:n});default:return}}};var ex=e=>{var n,r,i,t;let{encounterNovelliaResourceId:l}=e,{data:a,loading:s}=(0,H.aM)(X.kD,{variables:{novelliaResourceId:l},skip:!l}),c=null!==(i=null==a?void 0:null===(n=a.encounter)||void 0===n?void 0:n.providerNoteDocuments)&&void 0!==i?i:[],d=null!==(t=null==a?void 0:null===(r=a.encounter)||void 0===r?void 0:r.providerNoteObservations)&&void 0!==t?t:[];return s?(0,o.jsx)(ec.Z,{sx:e=>({display:"flex",flexDirection:"column",gap:e.spacing(4)}),children:(0,o.jsx)(es.Z,{variant:"rounded",height:65,borderRadius:g.cM.MEDIUM})}):c.length>0?(0,o.jsx)(ea.Z,{title:"Provider Notes",counter:c.length,children:(0,o.jsx)(ec.Z,{sx:e=>({display:"flex",flexDirection:"column",gap:e.spacing(5)}),children:c.map((e,n)=>(0,o.jsxs)(T.Fragment,{children:[n>0&&(0,o.jsx)(et.ZP,{}),(0,o.jsxs)(ec.Z,{sx:e=>({display:"flex",flexDirection:"column",gap:e.spacing(3)}),children:[e.title&&(0,o.jsx)(el.Z,{fontWeight:"semibold",size:"md",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:e.title}),(0,o.jsx)(ec.Z,{children:(0,eu.ZP)(em(e.htmlContent),ep)})]})]},n))})}):d.length>0?(0,o.jsx)(ea.Z,{title:"Provider Notes",counter:d.length,children:(0,o.jsx)(ec.Z,{sx:e=>({display:"flex",flexDirection:"column",gap:e.spacing(4)}),children:d.map(e=>{var n;return(0,o.jsx)(el.Z,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:null===(n=e.noteText)||void 0===n?void 0:n.split(/\\n|\n/).map((e,n,r)=>(0,o.jsxs)("span",{children:[e,n<r.length-1&&(0,o.jsx)("br",{})]},n))},e.novelliaResourceId)})})}):null},eg=r(19645),eh=r(88685),ef=r(13333),ev=r(33531),eb=r(23315),ey=r(41664),ej=r.n(ey),eR=r(11163);let eE=e=>{var n;return{display:"flex",gap:{md:e.spacing(4),xs:e.spacing(2)},paddingBottom:e.spacing(3),borderBottom:"1px solid ".concat(null===(n=e.palette.layout)||void 0===n?void 0:n.border)}},eS=e=>{var n;return{display:"flex",alignItems:"center",gap:{md:e.spacing(4),xs:e.spacing(2)},padding:"".concat(e.spacing(3)," 0"),borderBottom:"1px solid ".concat(null===(n=e.palette.layout)||void 0===n?void 0:n.border),textDecoration:"none","&:first-of-type":{paddingTop:0},"&:last-child":{borderBottom:"none",paddingBottom:0}}},eO=e=>{var n;return{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:e.spacing(3),padding:"".concat(e.spacing(3)," 0"),borderBottom:"1px solid ".concat(null===(n=e.palette.layout)||void 0===n?void 0:n.border),"&:first-of-type":{paddingTop:0},"&:last-child":{borderBottom:"none",paddingBottom:0}}},eD=e=>({display:"flex",flexWrap:"wrap",columnGap:e.spacing(5),rowGap:e.spacing(2)}),eI=e=>({display:"flex",flexDirection:"column",alignItems:"flex-end",justifyContent:"space-between",gap:e.spacing(2),flexShrink:0,alignSelf:"stretch"}),eT=e=>({display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(5)}),eL=e=>{var n;return{paddingTop:e.spacing(6),paddingBottom:e.spacing(6),borderBottom:"1px solid ".concat(null===(n=e.palette.layout)||void 0===n?void 0:n.border),"&:first-of-type":{paddingTop:0},"&:last-of-type":{borderBottom:"none",paddingBottom:0}}},eU=e=>({flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:e.spacing(3)}),eA=e=>({display:"flex",flexDirection:"column",gap:e.spacing(4)}),eN=e=>e.serviceRequestNovelliaResourceId?"/patient/imaging/service-request/".concat(e.serviceRequestNovelliaResourceId):"/patient/imaging/".concat(e.observationNovelliaResourceId),eZ=e=>{let{label:n,value:r,noWrap:i}=e;return(0,o.jsxs)(ec.Z,{sx:e=>({display:"flex",flexDirection:"column",gap:i?e.spacing(2):e.spacing(1),...i&&{flexShrink:0,whiteSpace:"nowrap"}}),children:[(0,o.jsx)(eh.Z,{fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:n}),(0,o.jsx)(el.Z,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:r})]})},ek=e=>{let{title:n,items:r}=e;return r.length?(0,o.jsx)(ea.Z,{title:n,counter:r.length,children:(0,o.jsx)(ec.Z,{children:r.map(e=>{var n,r;let i=!!(e.status||e.href);return(0,o.jsxs)(ec.Z,{component:e.href?ej():"div",href:e.href,sx:n=>({...eO(n),...e.href&&{textDecoration:"none",cursor:"pointer"}}),children:[(0,o.jsxs)(ec.Z,{sx:eU,children:[(0,o.jsx)(eg.W$,{fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:e.title}),!!(null===(n=e.metadata)||void 0===n?void 0:n.length)&&(0,o.jsx)(ec.Z,{sx:eD,children:e.metadata.map(e=>(0,o.jsx)(eZ,{label:e.label,value:e.value,noWrap:e.noWrap},e.label))})]}),i&&(0,o.jsxs)(ec.Z,{sx:eI,children:[e.status&&(0,o.jsx)(eb.Z,{status:e.status}),e.href&&(0,o.jsx)(ec.Z,{sx:{marginTop:"auto"}
1,children:(0,o.jsx)(ev.Z,{label:null!==(r=e.navLabel)&&void 0!==r?r:"View",icon:"ArrowRight02",responsiveFontSize:!0})})]})]},e.key)})})}):null},eP=()=>(0,o.jsxs)(ec.Z,{sx:eA,children:[(0,o.jsx)(es.Z,{variant:"rounded",height:65,borderRadius:g.cM.MEDIUM}),(0,o.jsx)(es.Z,{variant:"rounded",height:65,borderRadius:g.cM.MEDIUM}),(0,o.jsx)(es.Z,{variant:"rounded",height:65,borderRadius:g.cM.MEDIUM})]}),eG=e=>{let{subresources:n,router:r}=e,{conditions:i,observations:t,procedures:l,diagnosticReports:a,imagingResults:s,allergyIntolerances:c,medications:d,immunizations:u}=n;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ek,{title:"Diagnoses",items:(null!=i?i:[]).map(e=>{var n,r;return{key:e.novelliaResourceId,title:e.name,href:"/patient/conditions/".concat(e.novelliaResourceId),navLabel:"Go to condition",status:null!==(r=null!==(n=e.clinicalStatus)&&void 0!==n?n:e.recordStatus)&&void 0!==r?r:void 0,metadata:e.onsetDate?[{label:"Onset date",value:(0,O.$X)(e.onsetDate)}]:void 0}})}),(0,o.jsx)(ek,{title:"Medications",items:(null!=d?d:[]).map(e=>({key:e.novelliaResourceId,title:e.name,href:"/patient/medications/".concat(e.novelliaResourceId),navLabel:"Go to medication",metadata:[...e.dosage?[{label:"Dosage",value:e.dosage}]:[],...e.startDate?[{label:"Start date",value:(0,O.$X)(e.startDate)}]:[]]}))}),!!(null==t?void 0:t.length)&&(0,o.jsx)(ea.Z,{title:"Vitals",counter:t.length,children:(0,o.jsx)(ec.Z,{children:t.map(e=>{var n,r;let i=null!==(n=e.name)&&void 0!==n?n:"Unknown vital",t=null!==(r=e.valueDisplay)&&void 0!==r?r:e.value;return(0,o.jsxs)(ec.Z,{sx:eO,children:[(0,o.jsx)(el.Z,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:i}),(0,o.jsx)(el.Z,{size:"sm",fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:t})]},e.novelliaResourceId)})})}),(0,o.jsx)(ek,{title:"Procedures",items:(null!=l?l:[]).map(e=>{var n;return{key:e.novelliaResourceId,title:e.name,metadata:[...(null===(n=e.reasons)||void 0===n?void 0:n.length)?[{label:"Reason for Procedure",value:e.reasons.join(", ")}]:[],...e.performedDateTime?[{label:"Date",value:(0,O.$X)(e.performedDateTime)}]:[]]}})}),!!(null==a?void 0:a.length)&&(0,o.jsx)(ea.Z,{title:"Labs",counter:a.length,children:(0,o.jsx)(ec.Z,{children:a.map(e=>{var n,i;let t=null!==(i=null!==(n=e.userGeneratedDisplayName)&&void 0!==n?n:e.name)&&void 0!==i?i:"Untitled report",l=e.observations.slice(0,4);return(0,o.jsxs)(ec.Z,{sx:eL,children:[(0,o.jsxs)(ec.Z,{sx:eT,children:[(0,o.jsx)(eg.W$,{fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:t}),(0,o.jsx)(ev.Z,{label:"Go to full report",icon:"ArrowRight02",responsiveFontSize:!0,onClick:()=>r.push("/patient/labs/diagnostic-reports/".concat(e.novelliaResourceId))})]}),l.length>0&&(0,o.jsxs)(ec.Z,{children:[(0,o.jsxs)(ec.Z,{sx:eE,children:[(0,o.jsx)(ec.Z,{flex:3,children:(0,o.jsx)(ef.Z,{colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:"Lab test"})}),(0,o.jsx)(ec.Z,{flex:3,display:{xs:"none",md:"block"},children:(0,o.jsx)(ef.Z,{colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:"Reference range"})}),(0,o.jsx)(ec.Z,{flex:3,display:"flex",justifyContent:"flex-end",children:(0,o.jsx)(ef.Z,{colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:"Measurement"})})]}),l.map(e=>{var n,r;let i=e.referenceRange?(0,ei.B)(e.referenceRange):null;return(0,o.jsxs)(ec.Z,{sx:eS,children:[(0,o.jsx)(ec.Z,{flex:3,children:(0,o.jsx)(el.Z,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:e.name})}),(0,o.jsx)(ec.Z,{flex:3,display:{xs:"none",md:"block"},children:(0,o.jsx)(el.Z,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:null!=i?i:"â"})}),(0,o.jsxs)(ec.Z,{flex:3,display:"flex",flexDirection:"column",alignItems:"flex-end",children:[(0,o.jsx)(el.Z,{size:"sm",fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:null!==(r=null!==(n=e.valueDisplay)&&void 0!==n?n:e.value)&&void 0!==r?r:"â"}),i&&(0,o.jsx)(ec.Z,{display:{xs:"block",md:"none"},children:(0,o.jsx)(el.Z,{size:"sm",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.MUTED_FOREGROUND,children:i})})]})]},e.novelliaResourceId)})]})]},e.novelliaResourceId)})})}),(0,o.jsx)(ek,{title:"Imaging",items:(null!=s?s:[]).map((e,n)=>{var r,o,i,t,l;return{key:null!==(o=null!==(r=e.serviceRequestNovelliaResourceId)&&void 0!==r?r:e.observationNovelliaResourceId)&&void 0!==o?o:String(n),title:null!==(t=null!==(i=e.userGeneratedDisplayName)&&void 0!==i?i:e.name)&&void 0!==t?t:"Untitled imaging",href:e.serviceRequestNovelliaResourceId||e.observationNovelliaResourceId?eN(e):void 0,navLabel:"Go to imaging",status:null!==(l=e.recordStatus)&&void 0!==l?l:void 0,metadata:[...e.effectiveDate?[{label:"Date",value:(0,O.$X)(e.effectiveDate)}]:[],...e.practitionerName?[{label:"Practitioner",value:e.practitionerName}]:[]]}})}),(0,o.jsx)(ek,{title:"Allergies",items:(null!=c?c:[]).map(e=>{var n,r,o;return{key:e.novelliaResourceId,title:e.name,href:"/patient/allergies/".concat(e.novelliaResourceId),navLabel:"Go to allergy",status:null!==(o=null!==(r=e.clinicalStatus)&&void 0!==r?r:e.recordStatus)&&void 0!==o?o:void 0,metadata:[...e.onsetPeriodStart?[{label:"Onset date",value:(0,O.$X)(e.onsetPeriodStart)}]:[],...e.criticality?[{label:"Severity",value:e.criticality}]:[],...(null===(n=e.reaction)||void 0===n?void 0:n.length)?[{label:"Reaction",value:e.reaction.join(", ")}]:[]]}})}),(0,o.jsx)(ek,{title:"Immunizations",items:(null!=u?u:[]).map(e=>{var n;return{key:e.novelliaResourceId,title:e.name,href:"/patient/immunizations/".concat(e.novelliaResourceId),navLabel:"Go to immunization",status:null!==(n=e.recordStatus)&&void 0!==n?n:void 0,metadata:e.occurrenceDateTime?[{label:"Immunization Date",value:(0,O.$X)(e.occurrenceDateTime)}]:void 0}})})]})};var eC=e=>{let{encounter:n,subresources:r,subresourcesLoading:i}=e,t=(0,eR.useRouter)(),{reasons:l}=n;return(0,o.jsxs)(o.Fragment,{children:[!!(null==l?void 0:l.length)&&(0,o.jsx)(ea.Z,{title:"Reason for visit",counter:l.length,children:(0,o.jsx)(eg.W$,{fontWeight:"semibold",colorScheme:g.eL.LAYOUT,colorProperty:g.g8.FOREGROUND,children:l.join(", ")})}),(0,o.jsx)(ex,{encounterNovelliaResourceId:n.novelliaResourceId}),i&&!r?(0,o.jsx)(eP,{}):r&&(0,o.jsx)(eG,{subresources:r,router:t})]})},ew=()=>{var e,n,r;let{currentUserFlags:a,loading:s}=(0,K.Z)(),{record:c,loading:d,refetch:u,id:m}=(0,J.Z)(X.Df,{buildVariables:e=>({novelliaResourceId:e,mergeRecordsEnabled:!!(null==a?void 0:a.mergeRecordsEnabled)}),skip:s}),p=null==c?void 0:c.encounter,x=p?i(p):"",{resourceAI:h,loading:f,enabled:v}=(0,Q.P)(null==p?void 0:p.novelliaResourceId,S.lyM.ENCOUNTER),{enabled:b,status:y,summary:j,generate:R,discard:D,discarding:T}=function(e,n){var r;let{userSettings:o}=(0,M.F)(),{showToast:i}=(0,V.p)(),t=(null==o?void 0:o[S.dIJ.AI_SUMMARIES_ENABLED])===!0,{data:l,loading:a}=(0,H.aM)(W,{variables:{novelliaResourceId:null!=e?e:""},skip:!t||!e}),[s,{loading:c,error:d}]=(0,$.D)(Y,{errorPolicy:"all"}),[u,{loading:m}]=(0,$.D)(B,{errorPolicy:"all"}),p=null!==(r=null==l?void 0:l.encounterAISummary)&&void 0!==r?r:null,x=function(e){let{enabled:n,loading:r,summary:o,generating:i,hasError:t}=e;return n?i?E.GENERATING:t?E.ERROR:r&&!o?E.LOADING:o?o.deletedAt?E.HIDDEN:o.status===S.hpR.NEEDS_REVIEW?E.NEEDS_REVIEW:E.COMPLETED:E.CTA:E.HIDDEN}({enabled:t,loading:a,summary:p,generating:c,hasError:!!d}),h=(n,r)=>{r&&e&&n.writeQuery({query:W,variables:{novelliaResourceId:e},data:{encounterAISummary:r}})};return{enabled:t,status:x,summary:p,generate:async()=>
1{if(!e)return;let{data:r,errors:o}=await s({variables:{novelliaResourceId:e},update:(e,n)=>{let{data:r}=n;return h(e,null==r?void 0:r.generateEncounterAISummary)}}),t=null==r?void 0:r.generateEncounterAISummary;!o&&t&&t.status!==S.hpR.NEEDS_REVIEW&&i({colorScheme:g.eL.SUCCESS,colorVariant:g.bo.REVERSED,header:"Your summary for ".concat(n," is ready to review.")})},discard:async()=>{if(!e)return!1;let{data:n,errors:r}=await u({variables:{novelliaResourceId:e},update:(e,n)=>{let{data:r}=n;return h(e,null==r?void 0:r.discardEncounterAISummary)}});if(r||!(null==n?void 0:n.discardEncounterAISummary)){var o;return i({colorScheme:g.eL.ERROR,header:(null==r?void 0:null===(o=r[0])||void 0===o?void 0:o.message)||"We couldn't discard this summary. Please try again."}),!1}return!0},discarding:m}}(null==p?void 0:p.novelliaResourceId,x),L=b&&!!(null==j?void 0:j.deletedAt),{data:U,loading:A}=(0,H.aM)(X.Rr,{variables:{novelliaResourceId:m},skip:!m});if(d&&!p)return(0,o.jsx)(eo.Z,{currType:"VISIT_DETAILS",fullBleed:!0,children:(0,o.jsx)(er.Z,{isLoading:!0})});if(!p)return null;let N=(null===(e=p.createdBy)||void 0===e?void 0:e.source)===ee.vG.PATIENT_REPORTED,Z=p.periodStart?(0,O.$X)(p.periodStart):"";return(0,o.jsx)(eo.Z,{currType:"VISIT_DETAILS",fullBleed:!0,children:(0,o.jsx)(er.Z,{record:p,novelliaResourceId:p.novelliaResourceId,patientPortalResourceType:S.lyM.ENCOUNTER,refetch:u,recordHeaderProps:{title:x,supportingText:"Doctor visit",threeDotMenuProps:{medicalRecordType:t.ek.ENCOUNTER,canPin:!0,canHide:!N,canEditImported:!N,customMenuItems:L?[{label:"Generate summary",icon:I.eZrc,iconColorScheme:g.eL.LAYOUT,iconColorProperty:g.g8.RING,endContent:(0,o.jsx)(l.Z,{children:"Beta"}),dataCy:"menu-item-generate-summary",onClick:()=>R()}]:void 0}},recordDetailsProps:{recordDetails:{recordInformation:{recordNameFromHealthSystem:null!==(n=p.name)&&void 0!==n?n:void 0}}},mainContent:(0,o.jsxs)(o.Fragment,{children:[b&&(0,o.jsx)(F,{status:y,summary:j,recordName:x,recordDate:Z,onGenerate:R,onDiscard:D,discarding:T,feedbackSlot:y===E.COMPLETED&&j?(0,o.jsx)(q.Z,{subjectId:j.generationId,subjectType:S.vj8.GEN_AI_SUMMARY,title:"How's the summary?",inlineTitle:!0,feedbackOptions:[{label:"Missing key information",enableComment:!0},{label:"Summary isn't accurate",enableComment:!0},{label:"Other",enableComment:!0}],commentLabel:"Tell us more",commentPlaceholder:"What would improve this summary?"}):void 0}),v&&f&&(0,o.jsx)(en.Z,{loading:!0}),v&&!f&&h&&(0,o.jsx)(en.Z,{resourceAI:h}),(0,o.jsx)(eC,{encounter:p,subresources:null!==(r=null==U?void 0:U.encounter)&&void 0!==r?r:null,subresourcesLoading:A})]})})})},ez=()=>(0,o.jsx)(ew,{})}},function(e){e.O(0,[809,7412,6877,4612,3144,4457,7932,4925,983,9143,4743,2888,9774,179],function(){return e(e.s=7871)}),_N_E=e.O()}]);
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.