"use strict";(globalThis.webpackChunk_ampath_esm_laboratory_app=globalThis.webpackChunk_ampath_esm_laboratory_app||[]).push([[4622],{34622:(e,t,r)=>{r.r(t),r.d(t,{default:()=>E});var n=r(16072),o=r.n(n),a=r(73465),l=r(36920),s=r(2076),i=r(90611),u=r(85072),c=r.n(u),p=r(97825),d=r.n(p),A=r(77659),m=r.n(A),b=r(55056),v=r.n(b),f=r(10540),h=r.n(f),y=r(41113),C=r.n(y),g=r(95684),_={};_.styleTagTransform=C(),_.setAttributes=v(),_.insert=m().bind(null,"head"),_.domAPI=d(),_.insertStyleElement=h(),c()(g.A,_);const w=g.A&&g.A.locals?g.A.locals:void 0;function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const E=function(e){var t,r,u=e.order,c=e.closeModal,p=(0,s.useTranslation)().t,d=(t=(0,n.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],l=!0,s=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{l||null==r.return||r.return()}finally{if(s)throw o}}return a}}(t,r)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),A=d[0],m=d[1],b=(0,l.useAbortController)(),v=(0,i.b5)(),f=((0,l.useConfig)().laboratoryOrderTypeUuid,(0,i.lB)(u)),h=f.completeLabResults,y=f.values;return f.mutateResults,o().createElement("div",null,o().createElement(a.rQ0,{closeModal:c,title:p("approveLabResults","Approve Lab Results")}),o().createElement(a.cwr,null,o().createElement("p",null,p("approveResultsConfirmationText","You are about to approve and finalize these lab results. Once approved, the results will be marked as complete and made available to clinicians. Are you sure you want to proceed?")),o().createElement("div",{className:w.resultsContainer},o().createElement(l.ExtensionSlot,{state:{order:u},name:"completed-lab-order-results-slot-1"}))),o().createElement(a.jlY,null,o().createElement(a.$nd,{kind:"danger",onClick:function(){c(),setTimeout(function(){var e=(0,l.showModal)("reject-lab-request-modal",{closeModal:function(){return e()},order:u})},0)}},p("rejectLabResults","Reject lab results")),o().createElement(a.$nd,{type:"submit",onClick:function(){m(!0),h&&h.length>0&&(0,i.hc)(u,"FINAL","COMPLETED",b,y,h).then(function(){v(),m(!1),c(),(0,l.showSnackbar)({isLowContrast:!0,title:p("resultsApproved","Results Approved"),kind:"success",subtitle:p("labResultsApprovedSuccessfully","Lab results have been successfully approved and finalized")})}).catch(function(e){m(!1),(0,l.showNotification)({title:p("errorApprovingResults","Error approving results"),kind:"error",critical:!0,description:null==e?void 0:e.message})})},disabled:A},p("approveResults","Approve Results"))))}},95684:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(16060),o=r.n(n),a=r(27559),l=r.n(a)()(o());l.push([e.id,".-esm-laboratory__approval-lab-results-modal__resultsContainer___OekO1{max-height:500px;overflow-y:auto;overflow-x:hidden;border:1px solid #e0e0e0;border-radius:4px;padding:16px;margin-top:16px}","",{version:3,sources:["webpack://./src/lab-tabs/modals/approval-lab-results-modal.scss"],names:[],mappings:"AAAA,uEACE,gBAAA,CACA,eAAA,CACA,iBAAA,CACA,wBAAA,CACA,iBAAA,CACA,YAAA,CACA,eAAA",sourcesContent:[".resultsContainer {\n  max-height: 500px;\n  overflow-y: auto;\n  overflow-x: hidden;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 16px;\n  margin-top: 16px;\n}\n"],sourceRoot:""}]),l.locals={resultsContainer:"-esm-laboratory__approval-lab-results-modal__resultsContainer___OekO1"};const s=l}}]);