1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4313],{29303:function(e,t,n){var s=n(67294),i=n(8801),r=n(30381),a=n.n(r),l=n(10267),c=n(51252),o=n(82669),d=n(68959),u=n(57145),h=n(85893),m=function(e){var t=e.allowFutureDateSelection,n=(0,s.useState)(["ar"===localStorage.getItem("lang")?"\u064a\u0646\u0627\u064a\u0631":"January","ar"===localStorage.getItem("lang")?"\u0641\u0628\u0631\u0627\u064a\u0631":"February","ar"===localStorage.getItem("lang")?"\u0645\u0627\u0631\u0633":"March","ar"===localStorage.getItem("lang")?"\u0623\u0628\u0631\u064a\u0644":"April","ar"===localStorage.getItem("lang")?"\u0645\u0627\u064a\u0648":"May","ar"===localStorage.getItem("lang")?"\u064a\u0648\u0646\u064a\u0648":"June","ar"===localStorage.getItem("lang")?"\u064a\u0648\u0644\u064a\u0648":"July","ar"===localStorage.getItem("lang")?"\u0623\u063a\u0633\u0637\u0633":"August","ar"===localStorage.getItem("lang")?"\u0633\u0628\u062a\u0645\u0628\u0631":"September","ar"===localStorage.getItem("lang")?"\u0627\u0643\u062a\u0648\u0628\u0631":"October","ar"===localStorage.getItem("lang")?"\u0646\u0648\u0641\u0645\u0628\u0631":"November","ar"===localStorage.getItem("lang")?"\u062f\u064a\u0633\u0645\u0628\u0631":"December"])[0],i=(0,s.useState)(1),r=i[0],m=i[1],p=(0,s.useState)(1),x=p[0],j=p[1],g=(0,s.useState)(1900),f=g[0],b=g[1];(0,s.useEffect)((function(){if(e.value){var t=e.value.split("-");m(parseInt(t[0])),j(parseInt(t[1])),b(parseInt(t[2]))}}),[e.value]);return(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(l.Z,{children:[(0,h.jsx)(c.Z,{md:"4",children:(0,h.jsx)(o.Z,{children:(0,h.jsx)(d.Z,{id:"selectDay",type:"select",label:"Day",value:r,disabled:e.disabled,onChange:function(n){!t&&(0,u.jc)((0,u.k3)("".concat(n.target.value.padStart(2,"0"),"-").concat(x.toString().padStart(2,"0"),"-").concat(f)))?e.onDateChange("01-01-".concat(f)):e.onDateChange("".concat(n.target.value.padStart(2,"0"),"-").concat(x.toString().padStart(2,"0"),"-").concat(f))},children:function(){var t=[],n=31;e.value&&(n=a()("".concat(f,"-").concat(x),"YYYY-MM").daysInMonth()),n<r&&e.onDateChange("01-".concat(x.toString().padStart(2,"0"),"-").concat(f));for(var s=1;s<=n;s++)t.push((0,h.jsx)("option",{value:s,children:e.t(s)},s));return t}()})})}),(0,h.jsx)(c.Z,{md:"4",children:(0,h.jsx)(o.Z,{children:(0,h.jsx)(d.Z,{id:"selectMonth",type:"select",label:"Month",disabled:e.disabled,value:x-1,onChange:function(n){!t&&(0,u.jc)((0,u.k3)("".concat(r.toString().padStart(2,"0"),"-").concat((parseInt(n.target.value)+1).toString().padStart(2,"0"),"-").concat(f)))?e.onDateChange("01-01-".concat(f)):e.onDateChange("".concat(r.toString().padStart(2,"0"),"-").concat((parseInt(n.target.value)+1).toString().padStart(2,"0"),"-").concat(f))},children:n.map((function(t,n){return(0,h.jsx)("option",{value:n,children:e.t(t)},n)}))})})}),(0,h.jsx)(c.Z,{md:"4",children:(0,h.jsx)(o.Z,{children:(0,h.jsx)(d.Z,{id:"selectYear",type:"select",label:"Year",disabled:e.disabled,value:f,onChange:function(n){!t&&(0,u.jc)((0,u.k3)("".concat(r.toString().padStart(2,"0"),"-").concat(x.toString().padStart(2,"0"),"-").concat(n.target.value)))?e.onDateChange("01-01-".concat(n.target.value)):e.onDateChange("".concat(r.toString().padStart(2,"0"),"-").concat(x.toString().padStart(2,"0"),"-").concat(n.target.value))},children:function(){for(var t=[],n=new Date,s=1900;s<=n.getFullYear();s++)t.push((0,h.jsx)("option",{value:s,children:e.t(s)},s));return t}()})})})]})})};m.defaultProps={disabled:!1},t.Z=(0,i.hr)()(m)},2097:function(e,t,n){n(67294);var s=n(97975),i=n(36955),r=n(45697),a=n.n(r),l=n(85893),c=function(e){var t=e.id,n=e.buttonText,r=e.load,a=e.buttonColor,c=e.buttonSize,o=e.htmlType,d=e.spinnerSize,u=e.onClick,h=e.className,m=e.style,p=e.key,x=e.iconClassName,j=e.textClassName,g=e.disabled;return(0,l.jsx)(l.Fragment,{children:r?(0,l.jsx)(s.Z,{id:t,disabled:!0,type:o,size:c,color:a,onClick:u,className:h,style:m,children:(0,l.jsx)("div",{children:(0,l.jsx)("span",{className:j+" mx-2",children:(0,l.jsx)(i.Z,{size:d})})})},p):(0,l.jsxs)(s.Z,{disabled:g,id:t,type:o,color:a,size:c,onClick:u,className:h,style:m,children:[(0,l.jsx)("span",{className:j,children:n}),""!==x?(0,l.jsx)("i",{className:x+" mx-2"}):null]},p)})};c.prototype={spinnerSize:a().oneOf(["xs","sm","lg","xl"]),className:a().string,onClick:a().func,style:a().string,key:a().string,iconClassName:a().string,textClassName:a().string,buttonText:a().string,load:a().bool,buttonColor:a().string,buttonSize:a().string,htmlType:a().string,disabled:a().bool},c.defaultProps={id:"",spinnerSize:"sm",onClick:null,className:"",style:{},key:null,iconClassName:"",disabled:!1,textClassName:"",htmlType:"button",buttonColor:"primary"},t.Z=c},54293:function(e,t,n){var s=n(83789),i=n(67294),r=n(51252),a=n(97975),l=n(10267),c=n(36595),o=n(83823),d=n(32842),u=n(42365),h=n(98227),m=n(15538),p=n(82669),x=n(67954),j=n(68959),g=n(2667),f=n(23812),b=n(16450),y=n(85677),v=n(98595),Z=n(88
101),R=n(54219),E=n(30381),N=n.n(E),S=n(29303),O=n(2097),C=n(28216),A=n(97105),w=n(51573),D=n(91251),T=n(64661),H=n(71408),L=n(81643),P=n.n(L),k=n(20880),I=n(57145),M=n(85893),B=function(e){var t=e.patientCondition,n=e.readOnly,Z=e.patientReadOnly,E=e.isLoadingAddCondition,C=e.errorAddCondition,D=e.successAddCondition,T=e.addPatientConditionError,H=e.addPatientConditionAction,L=e.addPatientConditionUpdateSuccessOrErrorToggleAction,B=e.isLoadingUpdateCondition,U=e.errorUpdateCondition,_=e.successUpdateCondition,z=e.updatePatientConditionError,F=e.updatePatientConditionAction,q=e.updatePatientConditionUpdateSuccessOrErrorToggleAction,W=e.isLoadingDeleteCondition,Y=e.errorDeleteCondition,G=e.successDeleteCondition,J=e.deletePatientConditionError,$=e.deletePatientConditionAction,Q=e.deletePatientConditionUpdateSuccessOrErrorToggleAction,V={textAlign:"center",width:"80px"},X=(0,i.useState)(5),K=X[0],ee=X[1],te=(0,i.useState)(1),ne=te[0],se=te[1],ie=(0,i.useState)(1),re=ie[0],ae=ie[1],le=(0,i.useState)([]),ce=le[0],oe=le[1],de=(0,i.useState)(!1),ue=de[0],he=de[1],me=(0,i.useState)(!1),pe=me[0],xe=me[1],je=(0,i.useState)(""),ge=je[0],fe=je[1],be=(0,i.useState)(""),ye=be[0],ve=be[1],Ze=(0,i.useState)("01-01-1970"),Re=Ze[0],Ee=Ze[1],Ne=(0,i.useState)("01-01-1970"),Se=Ne[0],Oe=Ne[1],Ce=(0,i.useState)("Add New Condition"),Ae=Ce[0],we=Ce[1],De=(0,i.useState)(!1),Te=De[0],He=De[1],Le=(0,i.useState)("add"),Pe=Le[0],ke=Le[1],Ie=(0,i.useState)(null),Me=Ie[0],Be=Ie[1],Ue=(0,i.useState)(!1),_e=Ue[0],ze=Ue[1],Fe=(0,i.useState)(null),qe=Fe[0],We=Fe[1],Ye=function(){He(!1),ke("add"),we(e.t("condition.add.new")),fe(""),ve(""),Ee("01-01-1970"),Oe("01-01-1970"),xe(!pe)},Ge=function(e){ze(!_e),We(e)};return(0,i.useEffect)((function(){t&&se(Math.ceil(t.length/K))}),[t,K]),(0,i.useEffect)((function(){if(t){var e=re*K,n=e-K,s=e-1;s>t.length-1&&(s=t.length),oe(t.slice(n,s+1)),ue||he(!0)}}),[t,ne,re,K,ue]),(0,i.useEffect)((function(){!E&&D&&(L(),(0,k.ES)(e.t("message.success.genericMessage")),(0,A.U)(w.Wn.HEALTH_RECORDS,w.ou.CONDITIONS,null,w.lZ.CONDITIONS_ADDED)),!E&&C&&(L(),(0,k.Jv)(T),(0,A.U)(w.Wn.HEALTH_RECORDS,w.ou.CONDITIONS,null,w.lZ.CONDITIONS_ADD_ERROR)),!B&&_&&(q(),(0,k.ES)(e.t("message.success.genericMessage")),(0,A.U)(w.Wn.HEALTH_RECORDS,w.ou.CONDITIONS,null,w.lZ.CONDITIONS_UPDATED)),!B&&U&&(q(),(0,k.Jv)(z),(0,A.U)(w.Wn.HEALTH_RECORDS,w.ou.CONDITIONS,null,w.lZ.ERROR_CONDITIONS_UPDATED)),!W&&G&&(Q(),(0,k.ES)(e.t("message.success.genericMessage")),(0,A.U)(w.Wn.HEALTH_RECORDS,w.ou.CONDITIONS,null,w.lZ.DELETE_CONDITION)),!W&&Y&&(Q(),(0,k.Jv)(J),(0,A.U)(w.Wn.HEALTH_RECORDS,w.ou.CONDITIONS,null,w.lZ.ERROR_DELETE_CONDITION))}),[T,L,J,Q,C,Y,U,E,W,B,e,D,G,_,z,q]),(0,M.jsxs)(M.Fragment,{children:[n?null:(0,M.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,M.jsx)(a.Z,{color:"primary",onClick:function(){Ye()},className:"waves-effect waves-light btn btn-block w25-min-150-button float-right",children:e.t("condition.add.new")})}),Z?null:(0,M.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,M.jsx)(a.Z,{color:"primary",className:"btn btn-block",children:e.t("condition.add.new")})}),(0,M.jsxs)(l.Z,{className:"w-100",children:[ue?0!==ce.length?(0,M.jsx)(M.Fragment,{children:(0,M.jsxs)(r.Z,{xs:"12",children:[(0,M.jsx)("div",{className:"table-responsive",children:(0,M.jsxs)(c.Z,{className:"project-list-table table-centered table-borderless",children:[(0,M.jsx)("thead",{children:(0,M.jsxs)("tr",{children:[(0,M.jsx)("th",{scope:"col",style:{maxWidth:"300px"},children:e.t("patientHealthRecords.details")}),(0,M.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.startDate")}),(0,M.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.endDate")}),n?null:(0,M.jsx)("th",{style:V,children:e.t("actions")})]})}),(0,M.jsx)("tbody",{children:ce.map((function(t,s){return(0,M.jsxs)("tr",{children:[(0,M.jsxs)("td",{children:[(0,M.jsx)("h5",{className:"text-truncate font-size-14 mb-0",children:t.name}),(0,M.jsx)("p",{className:"text-truncate text-muted mb-0",children:(0,M.jsx)("small",{children:t.comments})})]}),(0,M.jsx)("td",{children:(0,I.k3)(t.startDate)}),(0,M.jsx)("td",{children:t.endDate?(0,I.k3)(t.endDate):(0,M.jsx)("span",{children:e.t("patientHealthRecords.onGoing")})}),n?null:(0,M.jsx)("td",{style:V,children:(0,M.jsxs)(o.Z,{children:[(0,M.jsx)(d.Z,{href:"#",className:"card-drop",tag:"i",children:(0,M.jsx)("i",{className:"mdi mdi-dots-vertical",style:{fontSize:"1.5rem",cursor:"pointer"}})}),(0,M.jsxs)(u.Z,{right:!0,children:[(0,M.jsxs)(h.Z,{onClick:function(){!function(t,n){He(!1),ke(n),Be(t),we(e.t("condition."+n)),fe(t.name),ve(t.comments),Ee(t.startDate),Oe(t.endDate),t.endDate&&null!==t.endDate||He(!0),xe(!pe)}(t,"edit")},className:"d-flex align-items-center",children:[(0,M.jsx)("i",{className:"bx bx-edit font-size-16 text-success m-2"}),e.t("patientHealthRecords.edit")]}),(0,M.jsxs)(h.Z,{onClick:function(){Ge(t.id)},className:"d-flex align-items-center",children:[(0,M.jsx)("i",{className:"bx bx-trash font-size-16 text-danger m-2"}),e.t("patientHealthRecords.delete")]})]})]})})]},s)}))})]})}),(0,M.jsx)(r.Z,{md:"12",children:(0,M.jsxs)(l.Z,{className:"mt-2",children:[(0,M.jsx)(r.Z,{sm:"6",xs:"12",children:(0,M.jsx)(m.Z,{children:(0,M.jsxs)(p.Z,{children:[(0,M.jsx)(x.Z,{children:e.t("showNoOfRecords")}),(0,M.jsxs)(j.Z,{style:{maxWidth:"100px"},id:"showNoOfRecords",className:"form-control mx-2",type:"select",label:e.t("showNoOfRecords"),value:K,onChange:function(e){ee(e.target.value),se(Math.ceil(t.length/e.target.value)),ae(1)},children:[(0,M.jsx)("option",{value:5,children:"5"},0),(0,M.jsx)("option",{value:10,children:"10"},1),(0,M.jsx)("option",{value:20,children:"20"},2)]})]})})}),(0,M.jsx)(r.Z,{sm:"6",xs:"12",className:"d-flex justify-content-end align-items-end",children:(0,M.jsxs)(g.Z,{size:"md",className:"pagination pagination-rounded justify-content-end mb-2",children:[(0,M.jsx)(f.Z,{disabled:1===re,children:(0,M.jsx)(b.Z,{onClick:function(){ae(re-1)},previous:!0})}),(0,s.Z)(Array(ne)).map((function(e,t){return t+1>=re-1&&t+1<=re+1?(0,M.jsx)(f.Z,{active:t+1===re,children:(0,M.jsx)(b.Z,{onClick:function(){ae(t+1)},children:t+1})},t):null})),(0,M.jsx)(f.Z,{disabled:re===ne,children:(0,M.jsx)(b.Z,{onClick:function(){ae(re+1)},next:!0})})]})})]})})]})}):(0,M.jsx)(R.Z,{iconClass:"bx bx-calendar-x"}):null,(0,M.jsx)(r.Z,{sm:6,md:4,xl:3,className:"mt-4",children:(0,M.jsx)(y.Z,{size:"lg",isOpen:pe,toggle:function(){Ye()},children:(0,M.jsxs)(v.Z,{fluid:!0,children:[(0,M.jsxs)("div",{className:"modal-header",children:[(0,M.jsx)("h5",{className:"modal-title mt-0",id:"myLargeModalLabel",children:Ae}),(0,M.jsx)("button",{onClick:function(){Ye()},type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",children:(0,M.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),(0,M.jsx)("div",{className:"modal-body",children:(0,M.jsx)("form",{onSubmit:function(e){if(e.preventDefault(),document.getElementById("nameErr").style.display=ge?"n
1one":"block",document.getElementById("descriptionErr").style.display=ye?"none":"block",document.getElementById("dateErr").style.display="none",Te||(N()(Re,"DD-MM-YYYY HH:mm:ss")>N()(Se,"DD-MM-YYYY HH:mm:ss")?document.getElementById("dateErr").style.display="block":document.getElementById("dateErr").style.display="none"),ge&&ye&&Re&&(Te||!(N()(Re,"DD-MM-YYYY HH:mm:ss")>N()(Se,"DD-MM-YYYY HH:mm:ss")))){if("add"===Pe){var t={name:ge,comments:ye,startDate:Re,endDate:Se};return Te&&(t.endDate=null),void H(t)}var n=Object.assign({},Me);return n.name=ge,n.comments=ye,n.startDate=Re,n.endDate=Se,Te&&(n.endDate=null),void F(n)}},children:(0,M.jsxs)(l.Z,{children:[(0,M.jsx)(r.Z,{md:"12",children:(0,M.jsxs)(p.Z,{children:[(0,M.jsx)(x.Z,{children:e.t("patientHealthRecords.name")}),(0,M.jsx)("input",{name:"name",placeholder:e.t("patientHealthRecords.name"),value:ge,onChange:function(e){fe(e.target.value)},className:"form-control"}),(0,M.jsxs)("div",{id:"nameErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,M.jsx)(r.Z,{md:"12",children:(0,M.jsxs)(p.Z,{children:[(0,M.jsx)(x.Z,{children:e.t("patientHealthRecords.description")}),(0,M.jsx)("textarea",{name:"description",placeholder:e.t("patientHealthRecords.description"),value:ye,onChange:function(e){ve(e.target.value)},className:"form-control",rows:"5"}),(0,M.jsxs)("div",{id:"descriptionErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,M.jsx)(r.Z,{md:"12",children:(0,M.jsxs)(l.Z,{children:[(0,M.jsx)(r.Z,{lg:"6",children:(0,M.jsxs)(p.Z,{children:[(0,M.jsx)(x.Z,{children:e.t("patientHealthRecords.startDate")}),(0,M.jsx)(S.Z,{value:Re,onDateChange:function(e){Ee(e)}}),(0,M.jsxs)("div",{id:"dateErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("startDate.not.to.be.greater.then.endDate"),"!"]})]})}),(0,M.jsx)(r.Z,{lg:"6",children:(0,M.jsx)(l.Z,{children:(0,M.jsx)(r.Z,{xs:"12",className:"mb-0",children:(0,M.jsxs)(p.Z,{children:[(0,M.jsx)(x.Z,{children:e.t("patientHealthRecords.endDate")}),(0,M.jsx)(S.Z,{value:Se,disabled:Te,onDateChange:function(e){Oe(e)}}),(0,M.jsx)("div",{className:"text-center",children:(0,M.jsx)(x.Z,{children:e.t("patientHealthRecords.OR")})}),(0,M.jsxs)("div",{className:"text-center",children:[(0,M.jsx)("input",{name:"isOnGoing",id:"isOnGoing",type:"checkbox",className:"form-check-inline",checked:Te,onChange:function(){Te&&Oe("01-01-1970"),He(!Te)}}),(0,M.jsx)(x.Z,{for:"isOnGoing",className:"form-check-label",children:e.t("patientHealthRecords.onGoing")})]})]})})})})]})}),(0,M.jsx)(r.Z,{md:"12",children:(0,M.jsxs)("div",{className:"modal-footer d-flex w-100 justify-content-center align-self-center",children:[(0,M.jsx)("button",{type:"button",onClick:function(){Ye()},className:"btn btn-secondary btn-lg waves-effect ","data-dismiss":"modal",children:e.t("patientHealthRecords.close")}),(0,M.jsx)(O.Z,{htmlType:"submit",buttonText:e.t("patientHealthRecords.save"),load:E||B,buttonColor:"primary",buttonSize:"lg"})]})})]})})})]})})}),_e?(0,M.jsx)(P(),{title:e.t("patientHealthRecords.areYouSure"),warning:!0,showCancel:!0,confirmBtnBsStyle:"success",cancelBtnBsStyle:"danger",onConfirm:function(){},customButtons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(a.Z,{color:"success",onClick:function(){ze(!1)},size:"lg",className:"w25-min-150-button m-1",children:e.t("patientHealthRecords.cancel")}),(0,M.jsx)(O.Z,{className:"w25-min-150-button m-1",htmlType:"button",buttonText:e.t("patientHealthRecords.yes"),load:W,buttonColor:"danger",buttonSize:"lg",onClick:function(){$(qe),ze(!1)}})]}),children:e.t("patientHealthRecords.youWontBeAbleToRevertThis")}):null]})]})};B.defaultProps={readOnly:!0,patientReadOnly:!0};t.Z=(0,C.$j)((function(e){var t=e.AddPatientConditionReducer,n=t.isLoading,s=t.error,i=t.success,r=t.addPatientCondition,a=t.addPatientConditionError,l=e.UpdatePatientConditionReducer,c=l.isLoading,o=l.error,d=l.success,u=l.updatePatientCondition,h=l.updatePatientConditionError,m=e.DeletePatientConditionReducer;return{isLoadingAddCondition:n,errorAddCondition:s,successAddCondition:i,addPatientCondition:r,addPatientConditionError:a,isLoadingUpdateCondition:c,errorUpdate
1Condition:o,successUpdateCondition:d,updatePatientCondition:u,updatePatientConditionError:h,isLoadingDeleteCondition:m.isLoading,errorDeleteCondition:m.error,successDeleteCondition:m.success,deletePatientCondition:m.deletePatientCondition,deletePatientConditionError:m.deletePatientConditionError}}),{addPatientConditionAction:D.F,addPatientConditionUpdateSuccessOrErrorToggleAction:D.X_,updatePatientConditionAction:T.MC,updatePatientConditionUpdateSuccessOrErrorToggleAction:T.L5,deletePatientConditionAction:H.GW,deletePatientConditionUpdateSuccessOrErrorToggleAction:H.vJ})((0,Z.hr)()(B))},94117:function(e,t,n){var s=n(83789),i=n(67294),r=n(51252),a=n(97975),l=n(10267),c=n(36595),o=n(83823),d=n(32842),u=n(42365),h=n(98227),m=n(15538),p=n(82669),x=n(67954),j=n(68959),g=n(2667),f=n(23812),b=n(16450),y=n(85677),v=n(98595),Z=n(8801),R=n(54219),E=n(2097),N=n(28216),S=n(60515),O=n(70988),C=n(20880),A=n(81643),w=n.n(A),D=n(21153),T=n(57145),H=n(55519),L=n(97105),P=n(51573),k=n(85893),I=function(e){var t=e.patientGenericHealthRecord,n=e.readOnly,Z=e.patientReadOnly,N=e.appointmentId,S=e.isLoadingActions,O=e.errorActions,A=e.successActions,I=e.patientGenericHealthRecordError,M=e.currentAction,B=e.addPatientGenericHealthRecordAction,U=e.updatePatientGenericHealthRecordAction,_=e.deletePatientGenericHealthRecordAction,z=e.PatientGenericHealthRecordActionsSuccessOrErrorToggleAction,F=e.isLoadingUpcomingAppointments,q=e.errorUpcomingAppointments,W=e.successUpcomingAppointments,Y=e.patientUpcomingAppointments,G=e.fetchFirstTimeUpcomingAppoointment,J=e.fetchPatientAllUpcomingAppointmentsAction,$=e.fetchPatientAllUpcomingAppointmentsSuccessOrErrorToggleAction,Q={textAlign:"center",width:"80px"},V=(0,i.useState)(5),X=V[0],K=V[1],ee=(0,i.useState)(1),te=ee[0],ne=ee[1],se=(0,i.useState)(1),ie=se[0],re=se[1],ae=(0,i.useState)([]),le=ae[0],ce=ae[1],oe=(0,i.useState)(!1),de=oe[0],ue=oe[1],he=(0,i.useState)(!1),me=he[0],pe=he[1],xe=(0,i.useState)(""),je=xe[0],ge=xe[1],fe=(0,i.useState)(""),be=fe[0],ye=fe[1],ve=(0,i.useState)("Add New Record"),Ze=ve[0],Re=ve[1],Ee=(0,i.useState)("add"),Ne=Ee[0],Se=Ee[1],Oe=(0,i.useState)([]),Ce=Oe[0],Ae=Oe[1],we=(0,i.useState)(null),De=we[0],Te=we[1],He=(0,i.useState)(!1),Le=He[0],Pe=He[1],ke=(0,i.useState)(null),Ie=ke[0],Me=ke[1],Be=(0,i.useState)(N?{value:N,label:N}:{label:e.t("general.none"),value:null}),Ue=Be[0],_e=Be[1],ze=(0,i.useState)(N?[]:[{label:e.t("general.none"),value:null}]),Fe=ze[0],qe=ze[1],We=function(){Se("add"),Re(e.t("patientGenericHealthRecord.add.new")),ge(null),ye(""),pe(!me),Ae([])},Ye=function(t,n){Te(t),Se(n),Re(e.t("patientGenericHealthRecord."+n)),ge(t.name),ye(t.description);var s={value:null,label:e.t("general.none")};t.appointment&&(s={value:t.appointment.appointmentId,label:t.appointment.appointmentId}),_e(s);var i=JSON.parse(t.fileUrl);Ae(i?i.map((function(t){return{preview:t.url,name:""!==t.fileName?t.fileName:e.t("general.attachedFile"),formattedSize:null,type:t.contentType,toBeUploaded:!1,uuid:t.uuid}})):[]),pe(!me)},Ge=function(e){Pe(!Le),Me(e)};return(0,i.useEffect)((function(){t&&ne(Math.ceil(t.length/X))}),[t,X]),(0,i.useEffect)((function(){if(t){var e=ie*X,n=e-X,s=e-1;s>t.length-1&&(s=t.length),ce(t.slice(n,s+1)),de||ue(!0)}}),[t,te,ie,X,de]),(0,i.useEffect)((function(){!S&&A&&("add"===M?((0,C.ES)(e.t("message.success.genericMessage")),(0,L.U)(P.Wn.HEALTH_RECORDS,P.ou.GENERIC_HEALTH_RECORDS,null,P.lZ.ADD_GENERIC_HEALTH_RECORDS)):"update"===M?((0,C.ES)(e.t("message.success.genericMessage")),(0,L.U)(P.Wn.HEALTH_RECORDS,P.ou.GENERIC_HEALTH_RECORDS,null,P.lZ.UPDATE_GENERIC_HEALTH_RECORDS)):"delete"===M&&(Pe(!1),(0,C.ES)(e.t("message.success.genericMessage")),(0,L.U)(P.Wn.HEALTH_RECORDS,P.ou.GENERIC_HEALTH_RECORDS,null,P.lZ.DELETE_GENERIC_HEALTH_RECORDS)),pe(!1),z()),!S&&O&&("add"===M?((0,C.Jv)(I),(0,L.U)(P.Wn.HEALTH_RECORDS,P.ou.GENERIC_HEALTH_RECORDS,null,P.lZ.ERROR_ADD_GENERIC_HEALTH_RECORDS)):"update"===M?(0,C.Jv)(I):"delete"===M&&(Pe(!1),(0,C.Jv)(I)),z())}),[e,S,A,O,M,z,I]),(0,i.useEffect)((function(){if(!F&&G&&null===Y&&J(
1),!F&&W&&$(),!F&&q&&$(),Y&&void 0===N){var e=Y.map((function(e){return{label:e.appointmentId,value:e.appointmentId}}));qe(e)}}),[N,q,G,J,$,F,Y,W]),(0,k.jsxs)("div",{children:[n?null:(0,k.jsx)(r.Z,{md:"12",className:"text-right my-2",children:(0,k.jsx)(a.Z,{color:"primary",onClick:function(){We()},className:"waves-effect waves-light btn btn-block w25-min-150-button",children:e.t("patientGenericHealthRecord.add.new")})}),Z?null:(0,k.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,k.jsx)(a.Z,{className:" btn btn-block",color:"primary",children:e.t("patientGenericHealthRecord.add.new")})}),(0,k.jsxs)(l.Z,{children:[de?0!==le.length?(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)(r.Z,{xs:"12",children:[(0,k.jsx)("div",{className:"table-responsive",children:(0,k.jsxs)(c.Z,{className:"project-list-table table-centered table-borderless",children:[(0,k.jsx)("thead",{children:(0,k.jsxs)("tr",{children:[(0,k.jsx)("th",{scope:"col",style:{width:"30%",minWidth:"200px"},children:e.t("patientHealthRecords.name")}),(0,k.jsx)("th",{scope:"col",children:e.t("patientHealthRecords.description")}),(0,k.jsx)("th",{scope:"col",style:{width:"10%",minWidth:"50px"},className:"text-center",children:e.t("patientHealthRecords.appointmentId")}),(0,k.jsx)("th",{style:Q,children:e.t("actions")})]})}),(0,k.jsx)("tbody",{children:le.map((function(t,s){var i=!0;return t.appointment&&(i=(0,T.Lz)((0,T.ow)((0,T.zE)()),(0,T.ow)(t.appointment.startTime))),(0,k.jsxs)("tr",{children:[(0,k.jsx)("td",{children:t&&t.name?t.name:(0,k.jsx)("span",{children:e.t("general.none")})}),(0,k.jsx)("td",{children:t.description}),(0,k.jsx)("td",{className:"text-center",children:t.appointment&&t.appointment.appointmentId?(0,k.jsx)("span",{children:t.appointment.appointmentId}):(0,k.jsx)("span",{children:e.t("general.none")})}),(0,k.jsx)("td",{style:Q,children:n?(0,k.jsx)(a.Z,{className:"text-white btn btn-rounded btn-success text-center",onClick:function(){Ye(t,"view")},children:(0,k.jsx)("i",{className:"bx bx-window-open"})}):(0,k.jsxs)(o.Z,{children:[(0,k.jsx)(d.Z,{href:"#",className:"card-drop",tag:"i",children:(0,k.jsx)("i",{className:"mdi mdi-dots-vertical",style:{fontSize:"1.5rem",cursor:"pointer"}})}),(0,k.jsxs)(u.Z,{right:!0,children:[(0,k.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){Ye(t,"view")},children:[(0,k.jsx)("i",{className:"bx bx-window-open font-size-16 m-2"}),e.t("patientHealthRecords.view")]}),i&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){Ye(t,"edit")},children:[(0,k.jsx)("i",{className:"bx bx-edit font-size-16 text-success m-2"}),e.t("patientHealthRecords.edit")]}),(0,k.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){Ge(t.id)},children:[(0,k.jsx)("i",{className:"bx bx-trash font-size-16 text-danger m-2"}),e.t("patientHealthRecords.delete")]})]})]})]})})]},s)}))})]})}),(0,k.jsx)(r.Z,{md:"12",children:(0,k.jsxs)(l.Z,{className:"mt-2",children:[(0,k.jsx)(r.Z,{sm:"6",xs:"12",children:(0,k.jsx)(m.Z,{children:(0,k.jsxs)(p.Z,{children:[(0,k.jsx)(x.Z,{children:e.t("showNoOfRecords")}),(0,k.jsxs)(j.Z,{style:{maxWidth:"100px"},id:"showNoOfRecords",className:"form-control mx-2",type:"select",label:e.t("showNoOfRecords"),value:X,onChange:function(e){K(e.target.value),ne(Math.ceil(t.length/e.target.value)),re(1)},children:[(0,k.jsx)("option",{value:5,children:"5"},0),(0,k.jsx)("option",{value:10,children:"10"},1),(0,k.jsx)("option",{value:20,children:"20"},2)]})]})})}),(0,k.jsx)(r.Z,{sm:"6",xs:"12",className:"d-flex justify-content-end align-items-end",children:(0,k.jsxs)(g.Z,{size:"md",className:"pagination pagination-rounded justify-content-end mb-2",children:[(0,k.jsx)(f.Z,{disabled:1===ie,children:(0,k.jsx)(b.Z,{onClick:function(){re(ie-1)},previous:!0})}),(0,s.Z)(Array(te)).map((function(e,t){return t+1>=ie-1&&t+1<=ie+1?(0,k.jsx)(f.Z,{active:t+1===ie,children:(0,k.jsx)(b.Z,{onClick:function(){re(t+1)},children:t+1})},t):null})),(0,k.jsx)(f.Z,{disabled:ie===te,children:(0,k.jsx)(b.Z,{onClick:function(){re(ie+1)},next:!0})})]})})]})})]})}):(0,k.jsx)(R.Z,{iconClass:"bx bx-calendar-x"}):null,(0,k.jsx)(r.Z,{sm:6,md:4,xl:3,className:"mt-4",children:(0,k.jsx)(y.Z,{size:"lg",isOpen:me,toggle:function(){We()},children:(0,k.jsxs)(v.Z,{fluid:!0,children:[(0,k.jsxs)("div",{className:"modal-header",children:[(0,k.jsx)("h5",{className:"modal-title mt-0",id:"myLargeModalLabel",children:Ze}),(0,k.jsx)("button",{onClick:function(){We()},type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",children:(0,k.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),(0,k.jsx)("div",{className:"modal-body",children:(0,k.jsx)("form",{onSubmit:function(e){if(e.preventDefault(),document.getElementById("nameErr").style.display=je?"none":"block",document.getElementById("descriptionErr").style.display=be?"n
1one":"block",0===Ce.length?document.getElementById("fileErr").style.display="block":document.getElementById("fileErr").style.display="none",je&&be&&0!==Ce.length){if("add"===Ne){var t={description:be,name:je,appointment:{appointmentId:Ue.value},patient:{}};return void B({data:t,filesData:Ce,appointmentId:N})}var n=Object.assign({},De);return n.description=be,n.name=je,void U({data:n,filesData:Ce,appointmentId:N})}},children:(0,k.jsxs)(l.Z,{children:[(0,k.jsx)(r.Z,{md:"12",children:(0,k.jsxs)(p.Z,{children:[(0,k.jsx)(x.Z,{children:e.t("patientHealthRecords.name")}),(0,k.jsx)("input",{name:"name",placeholder:e.t("patientHealthRecords.name"),value:je||"",onChange:function(e){ge(e.target.value)},className:"form-control",disabled:"view"===Ne}),(0,k.jsxs)("div",{id:"nameErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,k.jsx)(r.Z,{md:"12",children:(0,k.jsxs)(p.Z,{children:[(0,k.jsx)(x.Z,{children:e.t("patientHealthRecords.appointmentId")}),(0,k.jsx)(H.default,{name:"name",placeholder:e.t("patientHealthRecords.appointment"),value:Ue,onChange:function(e){_e(e)},options:Fe,isLoading:F,isDisabled:"edit"===Ne||"view"===Ne})]})}),(0,k.jsx)(r.Z,{md:"12",children:(0,k.jsxs)(p.Z,{children:[(0,k.jsx)(x.Z,{children:e.t("patientHealthRecords.description")}),(0,k.jsx)("textarea",{name:"description",placeholder:e.t("patientHealthRecords.description"),value:be||"",onChange:function(e){ye(e.target.value)},className:"form-control",rows:"5",disabled:"view"===Ne}),(0,k.jsxs)("div",{id:"descriptionErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,k.jsxs)(r.Z,{md:"12",children:[(0,k.jsx)(D.Z,{selectedFiles:Ce,setselectedFiles:function(e){Ae(e)},readOnly:"view"===Ne}),(0,k.jsxs)("div",{id:"fileErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]}),(0,k.jsx)(r.Z,{md:"12",children:(0,k.jsxs)("div",{className:"modal-footer d-flex w-100 justify-content-center align-self-centerl",children:[(0,k.jsx)("button",{type:"button",onClick:function(){We()},className:"btn btn-secondary btn-lg waves-effect ","data-dismiss":"modal",children:e.t("patientHealthRecords.close")}),"view"!==Ne&&(0,k.jsx)(E.Z,{htmlType:"submit",buttonText:e.t("patientHealthRecords.save"),load:S,buttonColor:"primary",buttonSize:"lg"})]})})]})})})]})})}),Le?(0,k.jsx)(w(),{title:e.t("patientHealthRecords.areYouSure"),warning:!0,showCancel:!0,onConfirm:function(){},confirmBtnBsStyle:"success",cancelBtnBsStyle:"danger",customButtons:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(a.Z,{color:"success",onClick:function(){Pe(!1)},size:"lg",className:"w25-min-150-button m-1",children:e.t("patientHealthRecords.cancel")}),(0,k.jsx)(E.Z,{htmlType:"button",className:"w25-min-150-button m-1",buttonText:e.t("patientHealthRecords.yes"),load:S,buttonColor:"danger",buttonSize:"lg",onClick:function(){_({id:Ie,appointmentId:N})}})]}),children:e.t("patientHealthRecords.youWontBeAbleToRevertThis")}):null]})]})};I.defaultProps={readOnly:!0,patientReadOnly:!0};I.defaultProps={loaderHeight:"75vh",readOnly:!0,patientReadOnly:!0},t.Z=(0,N.$j)((function(e){var t=e.PatientGenericHealthRecordActionsReducer,n=t.isLoading,s=t.error,i=t.success,r=t.PatientGenericHealthRecordActions,a=t.patientGenericHealthRecordError,l=t.currentAction,c=e.GetAllUpcomingAppointmentsPatientReducer;return{isLoadingActions:n,errorActions:s,successActions:i,PatientGenericHealthRecordActions:r,patientGenericHealthRecordError:a,currentAction:l,isLoadingUpcomingAppointments:c.isLoading,errorUpcomingAppointments:c.error,successUpcomingAppointments:c.success,patientUpcomingAppointments:c.patientUpcomingAppointments,patientUpcomingAppointmentsError:c.patientUpcomingAppointmentsError,fetchFirstTimeUpcomingAppoointment:c.fetchFirstTime}}),{addPatientGenericHealthRecordAction:S.gJ,updatePatientGenericHealthRecordAction:S.Oy,deletePatientGenericHealthRecordAction:S.Zu,PatientGenericHealthRecordActionsSuccessOrErrorToggleAction:S.Of,fetchPatientAllUpcomingAppointmentsAction:O.$L,fetchPatientAllUpcomingAppointmentsSuccessOrErrorToggleAction:O.yL})((0,Z.hr)()(I))},99619:function(e,t,n){var s=n(83789),i=n(92809),r=n(67294),a=n(51252),l=n(97975),c=n(10267),o=n(36595),d=n(83823),u=n(32842),h=n(42365),m=n(98227),p=n(15538),x=n(82669),j=n(67954),g=n(68959),f=n(2667),b=n(23812),y=n(16450),v=n(85677),Z=n(98595),R=n(8801),E=n(54219),N=n(29303),S=n(2097),O
1=n(28216),C=n(48893),A=n(55519),w=n(17925),D=n(69884),T=n(20880),H=n(81643),L=n.n(H),P=n(57145),k=n(21153),I=n(97105),M=n(51573),B=n(85893);function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}var _=function(e){var t=e.patientLabs,n=e.readOnly,R=e.patientReadOnly,O=e.labTypes,w=e.labTypesError,D=e.isLoadingLabTypes,H=e.successLabTypes,_=e.errorLabTypes,z=e.getLabTypesAction,F=e.getLabTypesSuccessOrErrorToggleAction,q=e.labSpecimenTypes,W=e.labSpecimenTypesError,Y=e.isLoadingLabSpecimenTypes,G=e.successLabSpecimenTypes,J=e.errorLabSpecimenTypes,$=e.getLabSpecimenTypesAction,Q=e.getLabSpecimenTypesSuccessOrErrorToggleAction,V=e.isLoadingActions,X=e.errorActions,K=e.successActions,ee=e.patientLabActionsError,te=e.currentAction,ne=e.addPatientLabAction,se=e.updatePatientLabAction,ie=e.deletePatientLabAction,re=e.patientLabActionsSuccessOrErrorToggleAction,ae={textAlign:"center",width:"80px"},le=(0,r.useState)(5),ce=le[0],oe=le[1],de=(0,r.useState)(1),ue=de[0],he=de[1],me=(0,r.useState)(1),pe=me[0],xe=me[1],je=(0,r.useState)([]),ge=je[0],fe=je[1],be=(0,r.useState)(!1),ye=be[0],ve=be[1],Ze=(0,r.useState)(!1),Re=Ze[0],Ee=Ze[1],Ne=(0,r.useState)(""),Se=Ne[0],Oe=Ne[1],Ce=(0,r.useState)(""),Ae=Ce[0],we=Ce[1],De=(0,r.useState)([]),Te=De[0],He=De[1],Le=(0,r.useState)(""),Pe=Le[0],ke=Le[1],Ie=(0,r.useState)(""),Me=Ie[0],Be=Ie[1],Ue=(0,r.useState)("01-01-1970"),_e=Ue[0],ze=Ue[1],Fe=(0,r.useState)("Add New Lab"),qe=Fe[0],We=Fe[1],Ye=(0,r.useState)("add"),Ge=Ye[0],Je=Ye[1],$e=(0,r.useState)([]),Qe=$e[0],Ve=$e[1],Xe=(0,r.useState)(null),Ke=Xe[0],et=Xe[1],tt=(0,r.useState)(!1),nt=tt[0],st=tt[1],it=(0,r.useState)(null),rt=it[0],at=it[1],lt=function(){O||null!==O||n||z(),Je("add"),We(e.t("lab.add.new")),Oe(null),we(null),He([]),Be(""),ze("01-01-1970"),Ee(!Re),Ve([])},ct=function(t,s){O||null!==O||n||z(),et(t),Je(s),We(e.t("lab."+s)),Oe({label:t.labType.name,value:t.labType.name,id:t.labType.id}),He(t.patientLabTypeSpecimenDTO.map((function(e){return{id:e.labTypeSpecimen.labSpecimen.id,value:e.labTypeSpecimen.labSpecimen.name,label:e.labTypeSpecimen.labSpecimen.name,orignal:e}}))),"Other"===t.labType.name&&(we(t.nameOther),ke(t.specimenTypeOther)),Be(t.description),ze(t.dateRecorded),n||$(t.labType);var i=JSON.parse(t.imageUrl);Ve(i?i.map((function(t){return{preview:t.url,name:""!==t.fileName?t.fileName:e.t("general.attachedFile"),formattedSize:null,type:t.contentType,toBeUploaded:!1,uuid:t.uuid}})):[]),Ee(!Re)},ot=function(e){st(!nt),at(e)};return(0,r.useEffect)((function(){t&&he(Math.ceil(t.length/ce))}),[t,ce]),(0,r.useEffect)((function(){if(t){var e=pe*ce,n=e-ce,s=e-1;s>t.length-1&&(s=t.length),fe(t.slice(n,s+1)),ye||ve(!0)}}),[t,ue,pe,ce,ye]),(0,r.useEffect)((function(){!V&&K&&("add"===te?((0,T.ES)(e.t("message.success.genericMessage")),(0,I.U)(M.Wn.HEALTH_RECORDS,M.ou.LABS,null,M.lZ.LABS_ADDED)):"update"===te?((0,T.ES)(e.t("message.success.genericMessage")),(0,I.U)(M.Wn.HEALTH_RECORDS,M.ou.LABS,null,M.lZ.LABS_UPDATE)):"delete"===te&&(st(!1),(0,T.ES)(e.t("message.success.genericMessage")),(0,I.U)(M.Wn.HEALTH_RECORDS,M.ou.LABS,null,M.lZ.LABS_DELETED)),Ee(!1),re()),!V&&X&&("add"===te?((0,I.U)(M.Wn.HEALTH_RECORDS,M.ou.LABS,null,M.lZ.LABS_ADD_ERROR),(0,T.Jv)(ee)):"update"===te?(0,T.Jv)(ee):"delete"===te&&(st(!1),(0,T.Jv)(ee)),re())}),[e,V,K,X,te,re,ee]),(0,r.useEffect)((function(){!D&&H&&F(),!D&&_&&(F(),(0,T.Jv)(w)),!Y&&G&&Q(),!Y&&J&&(Q(),(0,T.Jv)(W))}),[J,_,Q,F,Y,D,W,w,e,G,H]),(0,B.jsxs)("div",{children:[n?null:(0,B.jsx)(a.Z,{md:"12",className:"text-center my-2",children:(0,B.jsx)(l.Z,{color:"primary",onClick:function(){lt()},className:"waves-effect waves-light btn btn-block w25-min-150-button float-right",children:e.t("lab.add.new")})}),R?null:(0,B.jsx)(a.Z,{md:"12",className:"text-center my-2",children:(0,B.jsx)(l.Z,{className:" btn btn-block",color:"primary",children:e.t("lab.add.new")})}),(0,B.jsxs)(c.Z,{className:"w-100",children:[ye?0!==ge.length?(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)(a.Z,{xs:"12",children:[(0,B.jsx)("div",{className:"table-responsive",children:(0,B.jsxs)(o.Z,{className:"project-list-table table-centered table-borderless",children:[(0,B.jsx)("thead",{children:(0,B.jsxs)("tr",{children:[(0,B.jsx)("th",{scope:"col",style:{width:"30%",minWidth:"200px"},children:e.t("patientHealthRecords.name")}
1),(0,B.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.dateRecorded")}),(0,B.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.specimens")}),(0,B.jsx)("th",{scope:"col",children:e.t("patientHealthRecords.description")}),(0,B.jsx)("th",{style:ae,children:e.t("actions")})]})}),(0,B.jsx)("tbody",{children:ge.map((function(t,s){return(0,B.jsxs)("tr",{children:[(0,B.jsx)("td",{children:t.labType&&t.labType.name?t.labType.name:t.nameOther}),(0,B.jsx)("td",{children:(0,P.k3)(t.dateRecorded)}),(0,B.jsx)("td",{children:t.patientLabTypeSpecimenDTO.map((function(e,t){return(0,B.jsxs)("span",{children:[e.labTypeSpecimen.labSpecimen.name,", "]},t)}))}),(0,B.jsx)("td",{children:t.description}),(0,B.jsx)("td",{style:ae,children:n?(0,B.jsx)(l.Z,{onClick:function(){ct(t,"view")},className:"text-white btn btn-rounded btn-success text-center",children:(0,B.jsx)("i",{className:"bx bx-window-open"})}):(0,B.jsxs)(d.Z,{children:[(0,B.jsx)(u.Z,{href:"#",className:"card-drop",tag:"i",children:(0,B.jsx)("i",{className:"mdi mdi-dots-vertical",style:{fontSize:"1.5rem",cursor:"pointer"}})}),(0,B.jsxs)(h.Z,{right:!0,children:[(0,B.jsxs)(m.Z,{className:"d-flex align-items-center",onClick:function(){ct(t,"view")},children:[(0,B.jsx)("i",{className:"bx bx-window-open font-size-16 m-2"}),e.t("patientHealthRecords.view")]}),(0,B.jsxs)(m.Z,{className:"d-flex align-items-center",onClick:function(){ct(t,"edit")},children:[(0,B.jsx)("i",{className:"bx bx-edit font-size-16 text-success m-2"}),e.t("patientHealthRecords.edit")]}),(0,B.jsxs)(m.Z,{className:"d-flex align-items-center",onClick:function(){ot(t.id)},children:[(0,B.jsx)("i",{className:"bx bx-trash font-size-16 text-danger m-2"}),e.t("patientHealthRecords.delete")]})]})]})})]},s)}))})]})}),(0,B.jsx)(a.Z,{md:"12",children:(0,B.jsxs)(c.Z,{className:"mt-2",children:[(0,B.jsx)(a.Z,{sm:"6",xs:"12",children:(0,B.jsx)(p.Z,{children:(0,B.jsxs)(x.Z,{children:[(0,B.jsx)(j.Z,{children:e.t("showNoOfRecords")}),(0,B.jsxs)(g.Z,{style:{maxWidth:"100px"},id:"showNoOfRecords",className:"form-control mx-2",type:"select",label:e.t("showNoOfRecords"),value:ce,onChange:function(e){oe(e.target.value),he(Math.ceil(t.length/e.target.value)),xe(1)},children:[(0,B.jsx)("option",{value:5,children:"5"},0),(0,B.jsx)("option",{value:10,children:"10"},1),(0,B.jsx)("option",{value:20,children:"20"},2)]})]})})}),(0,B.jsx)(a.Z,{sm:"6",xs:"12",className:"d-flex justify-content-end align-items-end",children:(0,B.jsxs)(f.Z,{size:"md",className:"pagination pagination-rounded justify-content-end mb-2",children:[(0,B.jsx)(b.Z,{disabled:1===pe,children:(0,B.jsx)(y.Z,{onClick:function(){xe(pe-1)},previous:!0})}),(0,s.Z)(Array(ue)).map((function(e,t){return t+1>=pe-1&&t+1<=pe+1?(0,B.jsx)(b.Z,{active:t+1===pe,children:(0,B.jsx)(y.Z,{onClick:function(){xe(t+1)},children:t+1})},t):null})),(0,B.jsx)(b.Z,{disabled:pe===ue,children:(0,B.jsx)(y.Z,{onClick:function(){xe(pe+1)},next:!0})})]})})]})})]})}):(0,B.jsx)(E.Z,{iconClass:"bx bx-calendar-x"}):null,(0,B.jsx)(a.Z,{sm:6,md:4,xl:3,className:"mt-4",children:(0,B.jsx)(v.Z,{size:"lg",isOpen:Re,toggle:function(){lt()},children:(0,B.jsxs)(Z.Z,{fluid:!0,children:[(0,B.jsxs)("div",{className:"modal-header",children:[(0,B.jsx)("h5",{className:"modal-title mt-0",id:"myLargeModalLabel",children:qe}),(0,B.jsx)("button",{onClick:function(){lt()},type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",children:(0,B.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),(0,B.jsx)("div",{className:"modal-body",children:(0,B.jsx)("form",{onSubmit:function(e){if(e.preventDefault(),document.getElementById("nameErr").style.display=Se?"none":"block",document.getElementById("descriptionErr").style.display=Me?"none":"block",Se&&"Other"===Se.label?(document.getElementById("otherNameErr").style.display=Ae?"none":"block",document.getElementById("otherSpecimenNameErr").style.display=Pe?"none":"block"):0===Te.length?document.getElementById("specimenErr").style.display="block":document.getElementById("specimenErr").style.display="none",0===Qe.length?document.getElementById("fileErr").style.display="block":document.getElementById("fileErr").style.display="none",Se&&Me&&_e&&0!==Qe.length&&("Other"===Se.label?Ae&&Pe:Te&&0!==Te.length)){if("add"===Ge){var t={dateRecorded:_e,description:Me,patientLabTypeSpecimenDTO:Te.map((function(e){return{labType
1Specimen:{id:e.id}}}))};return"Other"===Se.label&&(t.nameOther=Ae,t.specimenTypeOther=Pe),void ne({data:t,filesData:Qe})}var n=Object.assign({},Ke);return n.dateRecorded=_e,n.description=Me,n.labType={id:Se.id,name:Se.label},n.patientLabTypeSpecimenDTO=Te.map((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.orignal)})),"Other"===Se.label&&(n.nameOther=Ae),void se({data:n,filesData:Qe})}},children:(0,B.jsxs)(c.Z,{children:[(0,B.jsx)(a.Z,{md:"12",children:(0,B.jsxs)(x.Z,{children:[(0,B.jsx)(j.Z,{children:e.t("patientHealthRecords.name")}),(0,B.jsx)(C.ZP,{name:"name",placeholder:e.t("patientHealthRecords.name"),value:Se,onChange:function(e){Oe(e),He([]),e&&!n&&$(e)},isLoading:D,options:null===O?[]:O,isDisabled:D||"edit"===Ge||"view"===Ge}),(0,B.jsxs)("div",{id:"nameErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),null!==Se&&"Other"===Se.label?(0,B.jsx)(a.Z,{md:"12",children:(0,B.jsxs)(x.Z,{children:[(0,B.jsx)("input",{disabled:"edit"===Ge||"view"===Ge,name:"otherName",placeholder:e.t("patientHealthRecords.otherName"),value:Ae||"",onChange:function(e){we(e.target.value)},className:"form-control"}),(0,B.jsxs)("div",{id:"otherNameErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}):null,(0,B.jsx)(a.Z,{md:"12",children:(0,B.jsxs)(x.Z,{children:[(0,B.jsx)(j.Z,{children:e.t("patientHealthRecords.specimens")}),!(null!==Se&&"Other"===Se.label)&&(0,B.jsx)(A.default,{name:"specimens",placeholder:e.t("patientHealthRecords.specimens"),closeMenuOnSelect:!1,value:Te,onChange:function(e){He(e||[])},isLoading:Y,options:null===q?[]:q,isDisabled:Y||null===Se||"edit"===Ge||"view"===Ge,onBlurResetsInput:!1,onSelectResetsInput:!1,onCloseResetsInput:!1,isMulti:!0}),(0,B.jsxs)("div",{id:"specimenErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),null!==Se&&"Other"===Se.label?(0,B.jsx)(a.Z,{md:"12",children:(0,B.jsxs)(x.Z,{children:[(0,B.jsx)("input",{disabled:"edit"===Ge||"view"===Ge,name:"otherSpecimenName",placeholder:e.t("patientHealthRecords.otherSpecimen"),value:Pe,onChange:function(e){ke(e.target.value)},className:"form-control"}),(0,B.jsxs)("div",{id:"otherSpecimenNameErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}):null,(0,B.jsx)(a.Z,{md:"12",children:(0,B.jsxs)(x.Z,{children:[(0,B.jsx)(j.Z,{children:e.t("patientHealthRecords.description")}),(0,B.jsx)("textarea",{name:"description",placeholder:e.t("patientHealthRecords.description"),value:Me,onChange:function(e){Be(e.target.value)},className:"form-control",rows:"5",disabled:"view"===Ge}),(0,B.jsxs)("div",{id:"descriptionErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,B.jsx)(a.Z,{md:"12",children:(0,B.jsxs)(x.Z,{children:[(0,B.jsx)(j.Z,{children:e.t("patientHealthRecords.dateRecorded")}),(0,B.jsx)(N.Z,{value:_e,onDateChange:function(e){ze(e)},disabled:"view"===Ge})]})}),(0,B.jsxs)(a.Z,{md:"12",children:[(0,B.jsx)(k.Z,{selectedFiles:Qe,setselectedFiles:function(e){Ve(e)},readOnly:"view"===Ge}),(0,B.jsxs)("div",{id:"fileErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]}),(0,B.jsx)(a.Z,{md:"12",children:(0,B.jsxs)("div",{className:"modal-footer d-flex w-100 justify-content-center align-self-centerl",children:[(0,B.jsx)("button",{type:"button",onClick:function(){lt()},className:"btn btn-secondary btn-lg waves-effect ","data-dismiss":"modal",children:e.t("patientHealthRecords.close")}),"view"!==Ge&&(0,B.jsx)(S.Z,{htmlType:"submit",buttonText:e.t("patientHealthRecords.save"),load:V,buttonColor:"primary",buttonSize:"lg"})]})})]})})})]})})}),nt?(0,B.jsx)(L(),{title:e.t("patientHealthRecords.areYouSure"),warning:!0,showCancel:!0,onConfirm:function(){},confirmBtnBsStyle:"success",cancelBtnBsStyle:"danger",customButtons:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(l.Z,{color:"success",onClick:function(){st(!1)},size:"lg",className:"w25-min-150-button m-1",children:e.t("patientHealthRecords.cancel")}),(0,B.jsx)(S.Z,{htmlType:"button",className:"w25-min-150-button m-1",buttonText:e.t("patientHealthRecords.yes"),load:V,buttonColor:"danger",buttonSize:"lg",onClick:function(){ie(rt)}})]}),children:e.t("patientHealthRecords.youWontBeAbleToRevertThis")}):null]})]})};_.defaultProps={readOnly:!0,patientReadOnly:!0};t.Z=(0,O.$j)((function(e){var t=e.DataForAddingHealthRecordsReducer,n=t.labTypes,s=t.labTypesError,i=t.isLoadingLabTypes,r=t.successLabTypes,a=t.errorLabTypes,l=t.labSpecimenTypes,c=t.labSpecimenTypesError,o=t.isLoadingLabSpecimenTypes,d=t.successLabSpecimenTypes,u=t.errorLabSpecimenTypes,h=e.PatientLabActionsReducer;return{labTypes:n,labTypesError:s,isLoadingLabTypes:i,successLabTypes:r,errorLabTypes:a,labSpecimenTypes:l,labSpecimenTypesError:c,isLoadingLabSpecimenTypes:o,successLabSpecimenTypes:d,errorLabSpecimenTypes:u,isLoadingActions:h.isLoading,errorActions:h.error,successActions:h.success,patientLabActions:h.patientLabActions,patientLabActionsError:h.patientLabActionsError,currentAction:h.currentAction}}),{getLabTypesAction:w.tm,getLabTypesSuccessOrErrorToggleAction:w.wM,getLabSpecimenTypesAction:w.Tj,getLabSpecimenTypesSuccessOrErrorToggleAction:w.Sn,addPatientLabAction:D.Oe,updatePatientLabAction:D.L$,deletePatientLabAction:D.xF,patientLabActionsSuccessOrErrorToggleAction:D.Sg})((0,R.hr)()(_))},18425:function(e,t,n){var s=n(83789),i=n(67294),r=n(51252),a=n(97975),l=n(10267),c=n(36595),o=n(83823),d=n(32842),u=n(42365),h=n(98227),m=n(15538),p=n(82669),x=n(67954),j=n(68959),g=n(2667),f=n(23812),b=n(16450),y=n(85677),v=n(98595),Z=n(88
101),R=n(54219),E=n(30381),N=n.n(E),S=n(29303),O=n(2097),C=n(28216),A=n(48893),w=n(17925),D=n(43746),T=n(20880),H=n(81643),L=n.n(H),P=n(57145),k=n(21153),I=n(97105),M=n(51573),B=n(85893),U=function(e){var t=e.patientMedication,n=e.readOnly,Z=e.patientReadOnly,E=e.medicationRoutes,C=e.medicationRoutesError,w=e.isLoadingMedicationRoutes,D=e.successMedicationRoutes,H=e.errorMedicationRoutes,U=e.getMedicationRoutesAction,_=e.getMedicationRoutesSuccessOrErrorToggleAction,z=e.medicationFrequencies,F=e.medicationFrequenciesError,q=e.isLoadingMedicationFrequencies,W=e.successMedicationFrequencies,Y=e.errorMedicationFrequencies,G=e.getMedicationFrequenciesAction,J=e.getMedicationFrequenciesSuccessOrErrorToggleAction,$=e.isLoadingActions,Q=e.errorActions,V=e.successActions,X=e.patientMedicationActionsError,K=e.currentAction,ee=e.addPatientMedicationAction,te=e.updatePatientMedicationAction,ne=e.deletePatientMedicationAction,se=e.patientMedicationSuccessOrErrorToggleAction,ie={textAlign:"center",width:"80px"},re=(0,i.useState)(5),ae=re[0],le=re[1],ce=(0,i.useState)(1),oe=ce[0],de=ce[1],ue=(0,i.useState)(1),he
1=ue[0],me=ue[1],pe=(0,i.useState)([]),xe=pe[0],je=pe[1],ge=(0,i.useState)(!1),fe=ge[0],be=ge[1],ye=(0,i.useState)(!1),ve=ye[0],Ze=ye[1],Re=(0,i.useState)(""),Ee=Re[0],Ne=Re[1],Se=(0,i.useState)(""),Oe=Se[0],Ce=Se[1],Ae=(0,i.useState)(null),we=Ae[0],De=Ae[1],Te=(0,i.useState)(null),He=Te[0],Le=Te[1],Pe=(0,i.useState)(""),ke=Pe[0],Ie=Pe[1],Me=(0,i.useState)(""),Be=Me[0],Ue=Me[1],_e=(0,i.useState)(""),ze=_e[0],Fe=_e[1],qe=(0,i.useState)("01-01-1970"),We=qe[0],Ye=qe[1],Ge=(0,i.useState)("01-01-1970"),Je=Ge[0],$e=Ge[1],Qe=(0,i.useState)(!1),Ve=Qe[0],Xe=Qe[1],Ke=(0,i.useState)("Add New Medication"),et=Ke[0],tt=Ke[1],nt=(0,i.useState)("add"),st=nt[0],it=nt[1],rt=(0,i.useState)([]),at=rt[0],lt=rt[1],ct=(0,i.useState)(null),ot=ct[0],dt=ct[1],ut=(0,i.useState)(!1),ht=ut[0],mt=ut[1],pt=(0,i.useState)(null),xt=pt[0],jt=pt[1],gt=function(){E||null!==E||n||U(),z||null!==z||n||G(),it("add"),tt(e.t("medication.add.new")),Ne(""),Ce(""),Fe(""),De(null),Le(null),Ie(""),Ue(""),Ye("01-01-1970"),$e("01-01-1970"),Xe(!1),lt([]),Ze(!ve)},ft=function(t,s){E||null!==E||n||U(),z||null!==z||n||G(),dt(t),it(s),tt(e.t("medication."+s)),Ne(t.name),Ce(t.strength),Fe(t.doctorDirections),Ie(t.routeOther),Ue(t.frequencyOther),De({label:t.route.name,value:t.route.name,id:t.route.id}),Le({label:t.frequency.name,value:t.frequency.name,id:t.frequency.id}),Ye(t.startDate),$e(t.endDate),Xe(!1),t.endDate&&null!==t.endDate||Xe(!0);var i=JSON.parse(t.imageUrl);lt(i?i.map((function(t){return{preview:t.url,name:""!==t.fileName?t.fileName:e.t("general.attachedFile"),formattedSize:null,type:t.contentType,toBeUploaded:!1,uuid:t.uuid}})):[]),Ze(!ve)},bt=function(e){mt(!ht),jt(e)};return(0,i.useEffect)((function(){t&&de(Math.ceil(t.length/ae))}),[t,ae]),(0,i.useEffect)((function(){if(t){var e=he*ae,n=e-ae,s=e-1;s>t.length-1&&(s=t.length),je(t.slice(n,s+1)),fe||be(!0)}}),[t,oe,he,ae,fe]),(0,i.useEffect)((function(){!$&&V&&("add"===K?((0,T.ES)(e.t("message.success.genericMessage")),(0,I.U)(M.Wn.HEALTH_RECORDS,M.ou.MEDICATION,null,M.lZ.MEDICATION_ADDED)):"update"===K?((0,T.ES)(e.t("message.success.genericMessage")),(0,I.U)(M.Wn.HEALTH_RECORDS,M.ou.MEDICATION,null,M.lZ.MEDICATION_UPDATED)):"delete"===K&&(mt(!1),(0,T.ES)(e.t("message.success.genericMessage")),(0,I.U)(M.Wn.HEALTH_RECORDS,M.ou.MEDICATION,null,M.lZ.MEDICATION_DELETED)),Ze(!1),se()),!$&&Q&&("add"===K?((0,T.Jv)(X),(0,I.U)(M.Wn.HEALTH_RECORDS,M.ou.MEDICATION,null,M.lZ.ERROR_ADD_MEDICATION)):"update"===K?(0,T.Jv)(X):"delete"===K&&(mt(!1),(0,T.Jv)(X)),se())}),[e,$,V,Q,K,se,X]),(0,i.useEffect)((function(){!w&&D&&_(),!w&&H&&(_(),(0,T.Jv)(C)),!q&&W&&J(),!q&&Y&&(J(),(0,T.Jv)(F))}),[Y,H,J,_,q,w,F,C,e,W,D]),(0,B.jsxs)("div",{children:[n?null:(0,B.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,B.jsx)(a.Z,{color:"primary",onClick:function(){gt()},className:"waves-effect waves-light btn btn-block w25-min-150-button float-right",children:e.t("medication.add.new")})}),Z?null:(0,B.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,B.jsx)(a.Z,{color:"primary",className:" btn btn-block",children:e.t("medication.add.new")})}),(0,B.jsx)(l.Z,{className:"w-100",children:fe?0!==xe.length?(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)(r.Z,{xs:"12",children:[(0,B.jsx)("div",{className:"table-responsive",children:(0,B.jsxs)(c.Z,{className:"project-list-table table-centered table-borderless",children:[(0,B.jsx)("thead",{children:(0,B.jsxs)("tr",{children:[(0,B.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.nameOfMedicine")}),(0,B.jsx)("th",{scope:"col",children:e.t("patientHealthRecords.frequency")}),(0,B.jsx)("th",{scope:"col",children:e.t("patientHealthRecords.route")}),(0,B.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.startDateOfMedicine")}),(0,B.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.endDateOfMedicine")}),(0,B.jsx)("th",{style:ie,children:e.t("actions")})]})}),(0,B.jsx)("tbody",{children:xe.map((function(t,s){return(0,B.jsxs)("tr",{children:[(0,B.jsx)("td",{children:t.name}),(0,B.jsx)("td",{children:t.frequency.name}),(0,B.jsx)("td",{children:t.route.name}),(0,B.jsx)("td",{children:(0,P.k3)(t.startDate)}),(0,B.jsx)("td",{children:t.endDate?(0,P.k3)(t.endDate):(0,B.jsx)("span",{children:e.t("patientHealthRecords.onGoing")})}),(0,B.jsx)("td",{style:ie,children:n?(0,B.jsx)(a.Z,{className:"text-white btn btn-rounded btn-success text-center",onClick:function(){ft(t,"view")},children:(0,B.jsx)("i",{className:"bx bx-window-open"})}):(0,B.jsxs)(o.Z,{children:[(0,B.jsx)(d.Z,{href:"#",className:"card-drop",tag:"i",children:(0,B.jsx)("i",{className:"mdi mdi-dots-vertical",style:{fontSize:"1.5rem",cursor:"pointer"}})}),(0,B.jsxs)(u.Z,{right:!0,children:[t.imageUrl?(0,B.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){ft(t,"view")},children:[(0,B.jsx)("i",{className:"bx bx-window-open font-size-16 m-2"}),e.t("patientHealthRecords.view")]}):null,(0,B.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){ft(t,"edit")},children:[(0,B.jsx)("i",{className:"bx bx-edit font-size-16 text-success m-2"}),e.t("patientHealthRecords.edit")]}),(0,B.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){bt(t.id)},children:[(0,B.jsx)("i",{className:"bx bx-trash font-size-16 text-danger m-2"}),e.t("patientHealthRecords.delete")]})]})]})})]},s)}))})]})}),(0,B.jsx)(r.Z,{md:"12",children:(0,B.jsxs)(l.Z,{className:"mt-2",children:[(0,B.jsx)(r.Z,{sm:"6",xs:"12",children:(0,B.jsx)(m.Z,{children:(0,B.jsxs)(p.Z,{children:[(0,B.jsx)(x.Z,{children:e.t("showNoOfRecords")}),(0,B.jsxs)(j.Z,{style:{maxWidth:"100px"},id:"showNoOfRecords",className:"form-control mx-2",type:"select",label:e.t("showNoOfRecords"),value:ae,onChange:function(e){le(e.target.value),de(Math.ceil(t.length/e.target.value)),me(1)},children:[(0,B.jsx)("option",{value:5,children:"5"},0),(0,B.jsx)("option",{value:10,children:"10"},1),(0,B.jsx)("option",{value:20,children:"20"},2)]})]})})}),(0,B.jsx)(r.Z,{sm:"6",xs:"12",className:"d-flex justify-content-end align-items-end",children:(0,B.jsxs)(g.Z,{size:"md",className:"pagination pagination-rounded justify-content-end mb-2",children:[(0,B.jsx)(f.Z,{disabled:1===he,children:(0,B.jsx)(b.Z,{onClick:function(){me(he-1)},previous:!0})}),(0,s.Z)(Array(oe)).map((function(e,t){return t+1>
1=he-1&&t+1<=he+1?(0,B.jsx)(f.Z,{active:t+1===he,children:(0,B.jsx)(b.Z,{onClick:function(){me(t+1)},children:t+1})},t):null})),(0,B.jsx)(f.Z,{disabled:he===oe,children:(0,B.jsx)(b.Z,{onClick:function(){me(he+1)},next:!0})})]})})]})})]})}):(0,B.jsx)(R.Z,{iconClass:"bx bx-calendar-x"}):null}),(0,B.jsx)(r.Z,{sm:6,md:4,xl:3,className:"mt-4",children:(0,B.jsx)(y.Z,{size:"lg",isOpen:ve,toggle:function(){gt()},children:(0,B.jsxs)(v.Z,{fluid:!0,children:[(0,B.jsxs)("div",{className:"modal-header",children:[(0,B.jsx)("h5",{className:"modal-title mt-0",id:"myLargeModalLabel",children:et}),(0,B.jsx)("button",{onClick:function(){gt()},type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",children:(0,B.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),(0,B.jsx)("div",{className:"modal-body",children:(0,B.jsx)("form",{onSubmit:function(e){if(e.preventDefault(),document.getElementById("nameErr").style.display=Ee?"none":"block",document.getElementById("strengthErr").style.display=Oe?"none":"block",document.getElementById("routeErr").style.display=we?"none":"block",document.getElementById("frequencyErr").style.display=He?"none":"block",we&&"Other"===we.label&&(document.getElementById("otherRouteErr").style.display=ke?"none":"block"),He&&"Other"===He.label&&(document.getElementById("otherFrequencyErr").style.display=Be?"none":"block"),document.getElementById("dateErr").style.display="none",Ve||(N()(We,"DD-MM-YYYY HH:mm:ss")>N()(Je,"DD-MM-YYYY HH:mm:ss")?document.getElementById("dateErr").style.display="block":document.getElementById("dateErr").style.display="none"),Ee&&Oe&&we&&He&&We&&(!we||"Other"!==we.label||ke)&&(!He||"Other"!==He.label||Be)&&(Ve||!(N()(We,"DD-MM-YYYY HH:mm:ss")>N()(Je,"DD-MM-YYYY HH:mm:ss")))){if("add"===st){var t={name:Ee,strength:Oe,doctorDirections:ze,route:{id:we.id},frequency:{id:He.id},startDate:We,endDate:Je};return Ve&&(t.endDate=null),"Other"===we.label&&(t.routeOther=ke),"Other"===He.label&&(t.frequencyOther=Be),void ee({data:t,filesData:at})}var n=Object.assign({},ot);return n.name=Ee,n.strength=Oe,n.doctorDirections=ze,n.route={id:we.id},n.frequency={id:He.id},"Other"===we.label&&(n.routeOther=ke),"Other"===He.label&&(n.frequencyOther=Be),n.startDate=We,n.endDate=Je,Ve&&(n.endDate=null),void te({data:n,filesData:at})}},children:(0,B.jsxs)(l.Z,{children:[(0,B.jsx)(r.Z,{md:"6",children:(0,B.jsxs)(p.Z,{children:[(0,B.jsx)(x.Z,{children:e.t("patientHealthRecords.name")}),(0,B.jsx)("input",{name:"name",placeholder:e.t("patientHealthRecords.nameOfMedication"),value:Ee,onChange:function(e){Ne(e.target.value)},className:"form-control",disabled:"view"===st}),(0,B.jsxs)("div",{id:"nameErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,B.jsx)(r.Z,{md:"6",children:(0,B.jsxs)(p.Z,{children:[(0,B.jsx)(x.Z,{children:e.t("patientHealthRecords.strength")}),(0,B.jsx)("input",{name:"strength",placeholder:e.t("patientHealthRecords.medicationStrengthExample"),value:Oe,onChange:function(e){Ce(e.target.value)},className:"form-control",disabled:"view"===st}),(0,B.jsxs)("div",{id:"strengthErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,B.jsx)(r.Z,{md:"12",children:(0,B.jsxs)(p.Z,{children:[(0,B.jsx)(x.Z,{children:e.t("patientHealthRecords.doctorsDirections")}),(0,B.jsx)("textarea",{name:"doctorDirections",placeholder:e.t("patientHealthRecords.doctorsDirections"),value:ze,onChange:function(e){Fe(e.target.value)},className:"form-control",rows:"5",disabled:"view"===st}),(0,B.jsxs)("div",{id:"doctorDirectionsErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,B.jsx)(r.Z,{md:"6",children:(0,B.jsxs)(l.Z,{children:[(0,B.jsx)(r.Z,{md:"12",children:(0,B.jsxs)(p.Z,{children:[(0,B.jsx)(x.Z,{children:e.t("patientHealthRecords.medicationRoute")}),(0,B.jsx)(A.ZP,{name:"route",placeholder:e.t("patientHealthRecords.medicationRoute"),value:we,onChange:function(e){De(e)},isLoading:w,options:null===E?[]:E,isDisabled:w||"view"===st}),(0,B.jsxs)("div",{id:"routeErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required")]})]})}),(0,B.jsx)(r.Z,{md:"12",children:null!==we&&"Other"===we.label?(0,B.jsxs)(p.Z,{children:[(0,B.jsx)("input",{name:"otherRoute",placeholder:e.t("patientHealthRecords.otherMedicationRoute"),value:ke,onChange:function(e){Ie(e.target.value)},className:"form-control",disabled:"view"===st}),(0,B.jsxs)("div",{id:"otherRouteErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]}):null})]})}),(0,B.jsx)(r.Z,{md:"6",children:(0,B.jsxs)(l.Z,{children:[(0,B.jsx)(r.Z,{md:"12",children:(0,B.jsxs)(p.Z,{children:[(0,B.jsx)(x.Z,{children:e.t("patientHealthRecords.medicationFrequency")}),(0,B.jsx)(A.ZP,{name:"frequency",placeholder:e.t("patientHealthRecords.medicationFrequency"),value:He,onCh
1ange:function(e){Le(e)},isLoading:q,options:null===z?[]:z,isDisabled:q||"view"===st}),(0,B.jsxs)("div",{id:"frequencyErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required")]})]})}),(0,B.jsx)(r.Z,{md:"12",children:null!==He&&"Other"===He.label?(0,B.jsxs)(p.Z,{children:[(0,B.jsx)("input",{name:"otherFrequency",placeholder:e.t("patientHealthRecords.otherMedicationFrequency"),value:Be,onChange:function(e){Ue(e.target.value)},className:"form-control",disabled:"view"===st}),(0,B.jsxs)("div",{id:"otherFrequencyErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]}):null})]})}),(0,B.jsx)(r.Z,{lg:"6",children:(0,B.jsxs)(p.Z,{children:[(0,B.jsx)(x.Z,{children:e.t("patientHealthRecords.startDate")}),(0,B.jsx)(S.Z,{value:We,onDateChange:function(e){Ye(e)},disabled:"view"===st}),(0,B.jsxs)("div",{id:"dateErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("startDate.not.to.be.greater.then.endDate"),"!"]})]})}),(0,B.jsx)(r.Z,{lg:"6",children:(0,B.jsx)(l.Z,{children:(0,B.jsx)(r.Z,{xs:"12",className:"mb-0",children:(0,B.jsxs)(p.Z,{children:[(0,B.jsx)(x.Z,{children:e.t("patientHealthRecords.endDate")}),(0,B.jsx)(S.Z,{value:Je,disabled:Ve||"view"===st,onDateChange:function(e){$e(e)}}),(0,B.jsx)("div",{className:"text-center",children:(0,B.jsx)(x.Z,{children:e.t("patientHealthRecords.OR")})}),(0,B.jsxs)("div",{className:"text-center",children:[(0,B.jsx)("input",{name:"isOnGoing",id:"isOnGoing",type:"checkbox",className:"form-check-inline",checked:Ve,onChange:function(){Ve&&$e("01-01-1970"),Xe(!Ve)},disabled:"view"===st}),(0,B.jsx)(x.Z,{for:"isOnGoing",className:"form-check-label",children:e.t("patientHealthRecords.onGoing")})]})]})})})}),(0,B.jsxs)(r.Z,{md:"12",children:[(0,B.jsx)(k.Z,{selectedFiles:at,setselectedFiles:function(e){lt(e)},readOnly:"view"===st}),(0,B.jsxs)("div",{id:"fileErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]}),(0,B.jsx)(r.Z,{md:"12",children:(0,B.jsxs)("div",{className:"modal-footer d-flex w-100 justify-content-center align-self-centerl",children:[(0,B.jsx)("button",{type:"button",onClick:function(){gt()},className:"btn btn-secondary btn-lg waves-effect ","data-dismiss":"modal",children:e.t("patientHealthRecords.close")}),"view"!==st&&(0,B.jsx)(O.Z,{htmlType:"submit",buttonText:e.t("patientHealthRecords.save"),load:$,buttonColor:"primary",buttonSize:"lg"})]})})]})})})]})})}),ht?(0,B.jsx)(L(),{title:e.t("patientHealthRecords.areYouSure"),warning:!0,showCancel:!0,onConfirm:function(){},confirmBtnBsStyle:"success",cancelBtnBsStyle:"danger",customButtons:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(a.Z,{color:"success",onClick:function(){mt(!1)},size:"lg",className:"w25-min-150-button m-1",children:"Cancel"}),(0,B.jsx)(O.Z,{htmlType:"button",className:"w25-min-150-button m-1",buttonText:e.t("patientHealthRecords.yes"),load:$,buttonColor:"danger",buttonSize:"lg",onClick:function(){ne(xt)}})]}),children:e.t("patientHealthRecords.youWontBeAbleToRevertThis")}):null]})};U.defaultProps={readOnly:!0,patientReadOnly:!0};t.Z=(0,C.$j)((function(e){var t=e.DataForAddingHealthRecordsReducer,n=t.medicationRoutes,s=t.medicationRoutesError,i=t.isLoadingMedicationRoutes,r=t.successMedicationRoutes,a=t.errorMedicationRoutes,l=t.medicationFrequencies,c=t.medicationFrequenciesError,o=t.isLoadingMedicationFrequencies,d=t.successMedicationFrequencies,u=t.errorMedicationFrequencies,h=e.PatientMedicationActionsReducer;return{medicationRoutes:n,medicationRoutesError:s,isLoadingMedicationRoutes:i,successMedicationRoutes:r,errorMedicationRoutes:a,medicationFrequencies:l,medicationFrequenciesError:c,isLoadingMedicationFrequencies:o,successMedicationFrequencies:d,errorMedicationFrequencies:u,isLoadingActions:h.isLoading,errorActions:h.error,successActions:h.success,patientMedicationActions:h.patientMedicationActions,patientMedicationActionsError:h.patientMedicationActionsError,currentAction:h.currentAction}}),{getMedicationRoutesAction:w.fP,getMedicationRoutesSuccessOrErrorToggleAction:w.t6,getMedicationFrequenciesAction:w.c,getMedicationFrequenciesSuccessOrErrorToggleAction:w.wq,addPatientMedicationAction:D.nu,updatePatientMedicationAction:D.QW,deletePatientMedicationAction:D.or,patientMedicationSuccessOrErrorToggleAction:D.H8})((0,Z.hr)()(U))},602:function(e,t,n){var s=n(83789),i=n(67294),r=n(51252),a=n(97975),l=n(10267),c=n(36595),o=n(83823),d=n(32842),u=n(42365),h=n(98227),m=n(15538),p=n(82669),x=n(67954),j=n(68959),g=n(2667),f=n(23812),b=n(16450),y=n(85677),v=n(98595),Z=n(88
101),R=n(54219),E=n(29303),N=n(2097),S=n(28216),O=n(48893),C=n(21153),A=n(17925),w=n(55371),D=n(20880),T=n(81643),H=n.n(T),L=n(57145),P=n(97105),k=n(51573),I=n(85893),M=function(e){var t=e.patientProcedures,n=e.readOnly,Z=e.patientReadOnly,S=e.procedureNames,A=e.procedureNamesError,w=e.isLoadingProcedureNames,T=e.successProcedureNames,M=e.errorProcedureNames,B=e.getProcedureNamesAction,U=e.getProcedureNamesSuccessOrErrorToggleAction,_=e.procedureLocations,z=e.procedureLocationsError,F=e.isLoadingProcedureLocations,q=e.successProcedureLocations,W=e.errorProcedureLocations,Y=e.getProcedureLocationsAction,G=e.getProcedureLocationsSuccessOrErrorToggleAction,J=e.procedureTypes,$=e.procedureTypesError,Q=e.isLoadingProcedureTypes,V=e.successProcedureTypes,X=e.errorProcedureTypes,K=e.getProcedureTypesAction,ee=e.getProcedureTypesSuccessOrErrorToggleAction,te=e.isLoadingActions,ne=e.errorActions,se=e.successActions,ie=e.patientProcedureActionsError,re=e.currentAction,ae=e.addPatientProcedureAction,le=e.updatePatientProcedureAction,ce=e.deletePatientProcedureAction,oe=e.patientProcedureActionsSuccessOrErrorToggleAction,de={textAlign:"center",width:"80px"},ue=(0,i.useState)(5),he=ue[0],me=ue[1],pe=(0,i.useState)(1),xe=pe[0],je=pe[1],ge=(0,i.useState)(1),fe=ge[0],be=ge[1],ye=(0,i.useState)([]),ve=ye[0],Ze=ye[1],Re=(0,i.useState)(!1),Ee=Re[0],Ne=Re[1],Se=(0,i.useState)(!1),Oe=Se[0],Ce=Se[1],Ae=(0,i.useState)(null),we=Ae[0],De=Ae[1],Te=(0,i.useState)(""),He=Te[0],Le=Te[1],Pe=(0,i.useState)(""),ke=Pe[0],Ie=Pe[1],Me=(0,i.useState)(null),Be=Me[0],Ue=Me[1],_e=(0,i.useState)(""),ze=_e[0],Fe=_e[1],qe=(0,i.useState)(""),We=qe[0],Ye=qe[1],Ge=(0,i.useState)("01-01-1970"),Je=Ge[0],$e=Ge[1],Qe=(0,i.useState)("Add New Lab"),Ve=Qe[0],Xe=Qe[1],Ke=(0,i.useState)("add"),et=Ke[0],tt=Ke[1],nt=(0,i.useState)([]),st=nt[0],it=nt[1],rt=(0,i.useState)(null),at=rt[0],lt=rt[1],ct=(0,i.useState)(!1),ot=ct[0],dt=ct[1],ut=(0,i.useState)(null),ht=ut[0],mt=ut[1],pt=function(){S||null!==S||n||B(),_||null!==_||n||Y(),J||null!==J||n||K(),tt("add"),Xe(e.t("procedure.add.new")),De(null),Le(""),Ie(null),Ue(null),Fe(""),Ye(""),$e("01-01-1970"),it([]),Ce(!Oe)},xt=function(t,s){S||null!==S||n||B(),_||null!==_||n||Y(),J||null!==J||n||K(),lt(t),tt(s),Xe(e.t("procedure."+s)),De({label:t.name.text,value:t.name.text,id:t.name.id}),Ie({label:t.type.text,value:t.type.text,id:t.type.id}),Ue({label:t.location.text,value:t.location.text,id:t.location.id}),t.nameOther&&Le(t.nameOther),t.locationOther&&Fe(t.locationOther),Ye(t.description),$e(t.dateRecorded);var i=JSON.parse(t.imageUrl);it(i?i.map((function(t){return{preview:t.url,name:""!==t.fileName?t.fileName:e.t("general.attachedFile"),formattedSize:null,type:t.contentType,toBeUploaded:!1,uuid:t.uuid}})):[]),Ce(!Oe)},jt=function(e){dt(!ot),mt(e)};return(0,i.useEffect)((function(){t&&je(Math.ceil(t.length/he))}),[t,he]),(0,i.useEffect)((function(){if(t){var e=fe*he,n=e-he,s=e-1;s>t.length-1&&(s=t.length),Ze(t.slice(n,s+1)),Ee||Ne(!0)}}),[t,xe,fe,he,Ee]),(0,i.useEffect)((function(){!te&&se&&("add"===re?((0,D.ES)(e.t("message.success.genericMessage")),(0,P.U)(k.Wn.HEALTH_RECORDS,k.ou.PROCEDURE,null,k.lZ.ADD_PROCEDURE)):"update"===re?((0,D.ES)(e.t("message.success.genericMessage")),(0,P.U)(k.Wn.HEALTH_RECORDS,k.ou.PROCEDURE,null,k.lZ.UPDATE_PROCEDURE)):"delete"===re&&(dt(!1),(0,D.ES)(e.t("message.success.genericMessage")),(0,P.U)(k.Wn.HEALTH_RECORDS,k.ou.PROCEDURE,null,k.lZ.DELETE_PROCEDURE)),Ce(!1),oe()),!te&&ne&&("add"===re?((0,D.Jv)(ie),(0,P.U)(k.Wn.HEALTH_RECORDS,k.ou.PROCEDURE,null,k.lZ.ERROR_ADD_PROCEDURE)):"update"===re?(0,D.Jv)(ie):"delete"===re&&(dt(!1),(0,D.Jv)(ie)),oe())}),[e,te,se,ne,re,oe,ie]),(0,i.useEffect)((function(){!w&&T&&U(),!w&&M&&(U(),(0,D.Jv)(A)),!F&&q&&G(),!F&&W&&(G(),(0,D.Jv)(z)),!Q&&V&&ee(),!Q&&X&&(ee(),(0,D.Jv)($))}),[W,M,X,G,U,ee,F,w,Q,z,A,$,e,q,T,V]),(0,I.jsxs)("div",{children:[n?null:(0,I.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,I.jsx)(a.Z,{color:"primary",onClick:function(){pt()},className:"waves-effect waves-light btn btn-block w25-min-150-button float-right",children:e.t("procedure.add.new")})}),Z?null:(0,I.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,I.jsx)(a.Z,{color:"primary",className:" btn btn-block",children:e.t("procedure.add.new")})}),(0,I.jsxs)(l.Z,{className:"w-100",children:[Ee?0!==ve.length?(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)(r.Z,{xs:"12",children:[(0,I.jsx)("div",{className:"table-responsive",children:(0,I.jsxs)(c.Z,{className:"project-list-table table-centered table-borderless",children:[(0,I.jsx)("thead",{children:(0,I.jsxs)("tr",{children:[(0,I.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.name")}
1),(0,I.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.type")}),(0,I.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.procedureLocation")}),(0,I.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.dateRecorded")}),(0,I.jsx)("th",{scope:"col",children:e.t("patientHealthRecords.description")}),(0,I.jsx)("th",{style:de,children:e.t("actions")})]})}),(0,I.jsx)("tbody",{children:ve.map((function(t,s){return(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:t.name.text}),(0,I.jsx)("td",{children:t.type.text}),(0,I.jsx)("td",{children:t.location.text}),(0,I.jsx)("td",{children:(0,L.k3)(t.dateRecorded)}),(0,I.jsx)("td",{children:t.description}),(0,I.jsx)("td",{style:de,children:n?(0,I.jsx)(a.Z,{className:"text-white btn btn-rounded btn-success text-center",onClick:function(){xt(t,"view")},children:(0,I.jsx)("i",{className:"bx bx-window-open"})}):(0,I.jsxs)(o.Z,{children:[(0,I.jsx)(d.Z,{href:"#",className:"card-drop",tag:"i",children:(0,I.jsx)("i",{className:"mdi mdi-dots-vertical",style:{fontSize:"1.5rem",cursor:"pointer"}})}),(0,I.jsxs)(u.Z,{right:!0,children:[(0,I.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){xt(t,"view")},children:[(0,I.jsx)("i",{className:"bx bx-window-open font-size-16 text-dark m-2"}),e.t("patientHealthRecords.view")]})," ",(0,I.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){xt(t,"edit")},children:[(0,I.jsx)("i",{className:"bx bx-edit font-size-16 text-success m-2"}),e.t("patientHealthRecords.edit")]}),(0,I.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){jt(t.id)},children:[(0,I.jsx)("i",{className:"bx bx-trash font-size-16 text-danger m-2"}),e.t("patientHealthRecords.delete")]})]})]})})]},s)}))})]})}),(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)(l.Z,{className:"mt-2",children:[(0,I.jsx)(r.Z,{sm:"6",xs:"12",children:(0,I.jsx)(m.Z,{children:(0,I.jsxs)(p.Z,{children:[(0,I.jsx)(x.Z,{children:e.t("showNoOfRecords")}),(0,I.jsxs)(j.Z,{style:{maxWidth:"100px"},id:"showNoOfRecords",className:"form-control mx-2",type:"select",label:e.t("showNoOfRecords"),value:he,onChange:function(e){me(e.target.value),je(Math.ceil(t.length/e.target.value)),be(1)},children:[(0,I.jsx)("option",{value:5,children:"5"},0),(0,I.jsx)("option",{value:10,children:"10"},1),(0,I.jsx)("option",{value:20,children:"20"},2)]})]})})}),(0,I.jsx)(r.Z,{sm:"6",xs:"12",className:"d-flex justify-content-end align-items-end",children:(0,I.jsxs)(g.Z,{size:"md",className:"pagination pagination-rounded justify-content-end mb-2",children:[(0,I.jsx)(f.Z,{disabled:1===fe,children:(0,I.jsx)(b.Z,{onClick:function(){be(fe-1)},previous:!0})}),(0,s.Z)(Array(xe)).map((function(e,t){return t+1>=fe-1&&t+1<=fe+1?(0,I.jsx)(f.Z,{active:t+1===fe,children:(0,I.jsx)(b.Z,{onClick:function(){be(t+1)},children:t+1})},t):null})),(0,I.jsx)(f.Z,{disabled:fe===xe,children:(0,I.jsx)(b.Z,{onClick:function(){be(fe+1)},next:!0})})]})})]})})]})}):(0,I.jsx)(R.Z,{iconClass:"bx bx-calendar-x"}):null," ",(0,I.jsx)(r.Z,{sm:6,md:4,xl:3,className:"mt-4",children:(0,I.jsx)(y.Z,{size:"lg",isOpen:Oe,toggle:function(){pt()},children:(0,I.jsxs)(v.Z,{fluid:!0,children:[(0,I.jsxs)("div",{className:"modal-header",children:[(0,I.jsx)("h5",{className:"modal-title mt-0",id:"myLargeModalLabel",children:Ve}),(0,I.jsx)("button",{onClick:function(){pt()},type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",children:(0,I.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),(0,I.jsx)("div",{className:"modal-body",children:(0,I.jsx)("form",{onSubmit:function(e){if(e.preventDefault(),document.getElementById("nameErr").style.display=we?"none":"block",document.getElementById("locationErr").style.display=Be?"none":"block",document.getElementById("typeErr").style.display=ke?"none":"block",document.getElementById("descriptionErr").style.display=We?"none":"block",we&&"Other"===we.label&&(document.getElementById("otherNameErr").style.display=He?"none":"block"),Be&&"Other"===Be.label&&(document.getElementById("otherLocationErr").style.display=ze?"n
1one":"block"),0===st.length?document.getElementById("fileErr").style.display="block":document.getElementById("fileErr").style.display="none",we&&Be&&ke&&We&&Je&&0!==st.length&&(!we||"Other"!==we.label||He)&&(!Be||"Other"!==Be.label||ze)){if("add"===et){var t={dateRecorded:Je,description:We,name:{id:we.id},location:{id:Be.id},type:{id:ke.id}};return"Other"===we.label&&(t.nameOther=He),"Other"===Be.label&&(t.locationOther=ze),void ae({data:t,filesData:st})}var n=Object.assign({},at);return n.dateRecorded=Je,n.description=We,n.name={id:we.id},n.location={id:Be.id},n.type={id:ke.id},"Other"===we.label&&(n.nameOther=He),"Other"===Be.label&&(n.locationOther=ze),void le({data:n,filesData:st})}},children:(0,I.jsxs)(l.Z,{children:[(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)(p.Z,{children:[(0,I.jsx)(x.Z,{children:e.t("patientHealthRecords.name")}),(0,I.jsx)(O.ZP,{name:"name",placeholder:e.t("patientHealthRecords.name"),value:we,onChange:function(e){De(e)},isLoading:w,options:null===S?[]:S,isDisabled:w||"view"===et}),(0,I.jsxs)("div",{id:"nameErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),null!==we&&"Other"===we.label?(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)(p.Z,{children:[(0,I.jsx)("input",{name:"otherName",placeholder:e.t("patientHealthRecords.otherName"),value:He,onChange:function(e){Le(e.target.value)},disabled:"view"===et,className:"form-control"}),(0,I.jsxs)("div",{id:"otherNameErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}):null,(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)(p.Z,{children:[(0,I.jsx)(x.Z,{children:e.t("patientHealthRecords.type")}),(0,I.jsx)(O.ZP,{name:"type",placeholder:e.t("patientHealthRecords.type"),value:ke,onChange:function(e){Ie(e)},options:null===J?[]:J,isLoading:Q,isDisabled:Q||"view"===et}),(0,I.jsxs)("div",{id:"typeErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)(p.Z,{children:[(0,I.jsx)(x.Z,{children:e.t("patientHealthRecords.procedureLocation")}),(0,I.jsx)(O.ZP,{name:"location",placeholder:e.t("patientHealthRecords.procedureLocation"),value:Be,onChange:function(e){Ue(e)},isLoading:F,options:null===_?[]:_,isDisabled:F||"view"===et}),(0,I.jsxs)("div",{id:"locationErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required")]})]})}),null!==Be&&"Other"===Be.label?(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)(p.Z,{children:[(0,I.jsx)("input",{name:"otherLocation",placeholder:e.t("patientHealthRecords.otherLocation"),value:ze,onChange:function(e){Fe(e.target.value)},className:"form-control",disabled:"view"===et}),(0,I.jsxs)("div",{id:"otherLocationErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}):null,(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)(p.Z,{children:[(0,I.jsx)(x.Z,{children:e.t("patientHealthRecords.description")}),(0,I.jsx)("textarea",{name:"description",placeholder:e.t("patientHealthRecords.description"),value:We,onChange:function(e){Ye(e.target.value)},className:"form-control",rows:"5",disabled:"view"===et}),(0,I.jsxs)("div",{id:"descriptionErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)(p.Z,{children:[(0,I.jsx)(x.Z,{children:e.t("patientHealthRecords.dateRecorded")}),(0,I.jsx)(E.Z,{value:Je,onDateChange:function(e){$e(e)},disabled:"view"===et})]})}),(0,I.jsxs)(r.Z,{md:"12",children:[(0,I.jsx)(C.Z,{selectedFiles:st,setselectedFiles:function(e){it(e)},readOnly:"view"===et}),(0,I.jsxs)("div",{id:"fileErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})," ",(0,I.jsx)(r.Z,{md:"12",children:(0,I.jsxs)("div",{className:"modal-footer d-flex w-100 justify-content-center align-self-centerl",children:[(0,I.jsx)("button",{type:"button",onClick:function(){pt()},className:"btn btn-secondary btn-lg waves-effect ","data-dismiss":"modal",children:e.t("patientHealthRecords.close")}),"view"!==et&&(0,I.jsx)(N.Z,{htmlType:"submit",buttonText:e.t("patientHealthRecords.save"),load:te,buttonColor:"primary",buttonSize:"lg"})]})})]})})})]})})}),ot?(0,I.jsx)(H(),{title:e.t("patientHealthRecords.areYouSure"),warning:!0,showCancel:!0,onConfirm:function(){},confirmBtnBsStyle:"success",cancelBtnBsStyle:"danger",customButtons:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a.Z,{className:"w25-min-150-button m-1",color:"success",onClick:function(){dt(!1)},size:"lg",children:e.t("general.cancel")}),(0,I.jsx)(N.Z,{className:"w25-min-150-button m-1",htmlType:"button",buttonText:e.t("patientHealthRecords.yes"),load:te,buttonColor:"danger",buttonSize:"lg",onClick:function(){ce(ht)}})]}),children:e.t("patientHealthRecords.youWontBeAbleToRevertThis")}):null]})]})};M.defaultProps={readOnly:!0,patientReadOnly:!0};t.Z=(0,S.$j)((function(e){var t=e.DataForAddingHealthRecordsReducer,n=t.procedureNames,s=t.procedureNamesError,i=t.isLoadingProcedureNames,r=t.successProcedureNames,a=t.errorProcedureNames,l=t.procedureLocations,c=t.procedureLocationsError,o=t.isLoadingProcedureLocations,d=t.successProcedureLocations,u=t.errorProcedureLocations,h=t.procedureTypes,m=t.procedureTypesError,p=t.isLoadingProcedureTypes,x=t.successProcedureTypes,j=t.errorProcedureTypes,g=e.PatientProcedureActionsReducer;return{procedureNames:n,procedureNamesError:s,isLoadingProcedureNames:i,successProcedureNames:r,errorProcedureNames:a,procedureLocations:l,procedureLocationsError:c,isLoadingProcedureLocations:o,successProcedureLocations:d,errorProcedureLocations:u,procedureTypes:h,procedureTypesError:m,isLoadingProcedureTypes:p,successProcedureTypes:x,errorProcedureTypes:j,isLoadingActions:g.isLoading,errorActions:g.error,successActions:g.success,patientProcedureActions:g.patientProcedureActions,patientProcedureActionsError:g.patientProcedureActionsError,currentAction:g.currentAction}}),{getProcedureNamesAction:A.p4,getProcedureNamesSuccessOrErrorToggleAction:A.CP,getProcedureLocationsAction:A._T,getProcedureLocationsSuccessOrErrorToggleAction:A.eQ,getProcedureTypesAction:A.pu,getProcedureTypesSuccessOrErrorToggleAction:A.Vt,addPatientProcedureAction:w.U6,updatePatientProcedureAction:w.Cc,deletePatientProcedureAction:w.zH,patientProcedureActionsSuccessOrErrorToggleAction:w.mH})((0,Z.hr)()(M))},22873:function(e,t,n){var s=n(83789),i=n(67294),r=n(51252),a=n(97975),l=n(10267),c=n(36595),o=n(83823),d=n(32842),u=n(42365),h=n(98227),m=n(15538),p=n(82669),x=n(67954),j=n(68959),g=n(2667),f=n(23812),b=n(16450),y=n(85677),v=n(98595),Z=n(88
101),R=n(54219),E=n(29303),N=n(2097),S=n(28216),O=n(87235),C=n(20880),A=n(81643),w=n.n(A),D=n(57145),T=n(21153),H=n(97105),L=n(51573),P=n(85893),k=function(e){var t=e.patientReports,n=e.readOnly,Z=e.patientReadOnly,S=e.isLoadingActions,O=e.errorActions,A=e.successActions,k=e.patientReportActionsError,I=e.currentAction,M=e.addPatientReportAction,B=e.updatePatientReportAction,U=e.deletePatientReportAction,_=e.patientReportSuccessOrErrorToggleAction,z={textAlign:"center",width:"80px"},F=(0,i.useState)(5),q=F[0],W=F[1],Y=(0,i.useState)(1),G=Y[0],J=Y[1],$=(0,i.useState)(1),Q=$[0],V=$[1],X=(0,i.useState)([]),K=X[0],ee=X[1],te=(0,i.useState)(!1),ne=te[0],se=te[1],ie=(0,i.useState)(!1),re=ie[0],ae=ie[1],le=(0,i.useState)(null),ce=le[0],oe=le[1],de=(0,i.useState)(""),ue=de[0],he=de[1],me=(0,i.useState)("01-01-1970"),pe=me[0],xe=me[1],je=(0,i.useState)("report.add.new"),ge=je[0],fe=je[1],be=(0,i.useState)("add"),ye=be[0],ve=be[1],Ze=(0,i.useState)([]),Re=Ze[0],Ee=Ze[1],Ne=(0,i.useState)(null),Se=Ne[0],Oe=Ne[1],Ce=(0,i.useState)(!1),Ae=Ce[0],we=Ce[1],De=(0,i.useState)(null),Te=De[0],He=De[1],Le=function(){ve("add"),fe(e.t("report.add.new")),oe(""),he(""),xe("01-01-1970"),ae(!re),Ee([])},Pe=function(t,n){Oe(t),ve(n),fe(e.t("report."+n)),oe(t.issuedBy),he(t.comments),xe(t.dateIssued);var s=JSON.parse(t.imageUrl);Ee(s?s.map((function(t){return{preview:t.url,name:""!==t.fileName?t.fileName:e.t("general.attachedFile"),formattedSize:null,type:t.contentType,toBeUploaded:!1,uuid:t.uuid}})):[]),ae(!re)},ke=function(e){we(!Ae),He(e)};return(0,i.useEffect)((function(){t&&J(Math.ceil(t.length/q))}),[t,q]),(0,i.useEffect)((function(){if(t){var e=Q*q,n=e-q,s=e-1;s>t.length-1&&(s=t.length),ee(t.slice(n,s+1)),ne||se(!0)}}),[t,G,Q,q,ne]),(0,i.useEffect)((function(){!S&&A&&("add"===I?((0,C.ES)(e.t("message.success.genericMessage")),(0,H.U)(L.Wn.HEALTH_RECORDS,L.ou.REPORT,null,L.lZ.ADD_REPORTS)):"update"===I?((0,C.ES)(e.t("message.success.genericMessage")),(0,H.U)(L.Wn.HEALTH_RECORDS,L.ou.REPORT,null,L.lZ.UPDATE_REPORTS)):"delete"===I&&(we(!1),(0,C.ES)(e.t("message.success.genericMessage")),(0,H.U)(L.Wn.HEALTH_RECORDS,L.ou.REPORT,null,L.lZ.DELETE_REPORTS)),ae(!1),_()),!S&&O&&("add"===I?((0,C.Jv)(k),(0,H.U)(L.Wn.HEALTH_RECORDS,L.ou.REPORT,null,L.lZ.ERROR_ADD_REPORTS)):"update"===I?(0,C.Jv)(k):"delete"===I&&(we(!1),(0,C.Jv)(k)),_())}),[e,S,A,O,I,_,k]),(0,P.jsxs)("div",{children:[n?null:(0,P.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,P.jsx)(a.Z,{color:"primary",onClick:function(){Le()},className:"waves-effect waves-light btn btn-block w25-min-150-button float-right",children:e.t("report.add.new")})}),Z?null:(0,P.jsx)(r.Z,{md:"12",className:"text-center my-2",children:(0,P.jsx)(a.Z,{color:"primary",className:"btn btn-block ",children:e.t("report.add.new")})}),(0,P.jsxs)(l.Z,{className:"w-100",children:[ne?0!==K.length?(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)(r.Z,{xs:"12",children:[(0,P.jsx)("div",{className:"table-responsive",children:(0,P.jsxs)(c.Z,{className:"project-list-table table-centered table-borderless",children:[(0,P.jsx)("thead",{children:(0,P.jsxs)("tr",{children:[(0,P.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.issuedBy")}),(0,P.jsx)("th",{scope:"col",style:{width:"20%",minWidth:"150px"},children:e.t("patientHealthRecords.dateIssued")}),(0,P.jsx)("th",{scope:"col",children:e.t("patientHealthRecords.comments")}),(0,P.jsx)("th",{style:z,children:e.t("actions")})]})}),(0,P.jsx)("tbody",{children:K.map((function(t,s){return(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:t.issuedBy}),(0,P.jsx)("td",{children:(0,D.k3)(t.dateIssued)}),(0,P.jsx)("td",{children:t.comments}),(0,P.jsx)("td",{style:z,children:n?(0,P.jsx)(a.Z,{className:"text-white btn btn-rounded btn-success text-center",onClick:function(){Pe(t,"view")},children:(0,P.jsx)("i",{className:"bx bx-window-open"})}):(0,P.jsxs)(o.Z,{children:[(0,P.jsx)(d.Z,{href:"#",className:"card-drop",tag:"i",children:(0,P.jsx)("i",{className:"mdi mdi-dots-vertical",style:{fontSize:"1.5rem",cursor:"pointer"}})}),(0,P.jsxs)(u.Z,{right:!0,children:[(0,P.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){Pe(t,"view")},children:[(0,P.jsx)("i",{className:"bx bx-window-open font-size-16 text-dark m-2"}),e.t("patientHealthRecords.view")]}),(0,P.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){Pe(t,"edit")},children:[(0,P.jsx)("i",{className:"bx bx-edit font-size-16 text-success m-2"}),e.t("patientHealthRecords.edit")]}),(0,P.jsxs)(h.Z,{className:"d-flex align-items-center",onClick:function(){ke(t.id)},children:[(0,P.jsx)("i",{className:"bx bx-trash font-size-16 text-danger m-2"}),e.t("patientHealthRecords.delete")]})]})]})})]},s)}))})]})}),(0,P.jsx)(r.Z,{md:"12",children:(0,P.jsxs)(l.Z,{className:"mt-2",children:[(0,P.jsx)(r.Z,{sm:"6",xs:"12",children:(0,P.jsx)(m.Z,{children:(0,P.jsxs)(p.Z,{children:[(0,P.jsx)(x.Z,{children:e.t("showNoOfRecords")}),(0,P.jsxs)(j.Z,{style:{maxWidth:"100px"},id:"showNoOfRecords",className:"form-control mx-2",type:"select",label:e.t("showNoOfRecords"),value:q,onChange:function(e){W(e.target.value),J(Math.ceil(t.length/e.target.value)),V(1)},children:[(0,P.jsx)("option",{value:5,children:"5"},0),(0,P.jsx)("option",{value:10,children:"10"},1),(0,P.jsx)("option",{value:20,children:"20"},2)]})]})})}),(0,P.jsx)(r.Z,{sm:"6",xs:"12",className:"d-flex justify-content-end align-items-end",children:(0,P.jsxs)(g.Z,{size:"md",className:"pagination pagination-rounded justify-content-end mb-2",children:[(0,P.jsx)(f.Z,{disabled:1===Q,children:(0,P.jsx)(b.Z,{onClick:function(){V(Q-1)},previous:!0})}),(0,s.Z)(Array(G)).map((function(e,t){return t+1>=Q-1&&t+1<=Q+1?(0,P.jsx)(f.Z,{active:t+1===Q,children:(0,P.jsx)(b.Z,{onClick:function(){V(t+1)},children:t+1})},t):null})),(0,P.jsx)(f.Z,{disabled:Q===G,children:(0,P.jsx)(b.Z,{onClick:function(){V(Q+1)},next:!0})})]})})]})})]})}):(0,P.jsx)(R.Z,{iconClass:"bx bx-calendar-x"}):null,(0,P.jsx)(r.Z,{sm:6,md:4,xl:3,className:"mt-4",children:(0,P.jsx)(y.Z,{size:"lg",isOpen:re,toggle:function(){Le()},children:(0,P.jsxs)(v.Z,{fluid:!0,children:[(0,P.jsxs)("div",{className:"modal-header",children:[(0,P.jsx)("h5",{className:"modal-title mt-0",id:"myLargeModalLabel",children:ge}),(0,P.jsx)("button",{onClick:function(){Le()},type:"button",className:"close","data-dismiss":"modal","aria-label":"Close",children:(0,P.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),(0,P.jsx)("div",{className:"modal-body",children:(0,P.jsx)("form",{onSubmit:function(e){if(e.preventDefault(),document.getElementById("issuedByErr").style.display=ce?"none":"block",document.getElementById("descriptionErr").style.display=ue?"none":"block",0===Re.length?document.getElementById("fileErr").style.display="block":document.getElementById("fileErr").style.display="none",ce&&ue&&pe&&0!==Re.length){if("add"===ye)return void M({data:{dateIssued:pe,comments:ue,issuedBy:ce},filesData:Re});var t=Object.assign({},Se);return t.dateIssued=pe,t.comments=ue,t.issuedBy=ce,void B({data:t,filesData:Re})}},children:(0,P.jsxs)(l.Z,{children:[(0,P.jsx)(r.Z,{md:"12",children:(0,P.jsxs)(p.Z,{children:[(0,P.jsx)(x.Z,{children:e.t("patientHealthRecords.issuedBy")}),(0,P.jsx)("input",{name:"issuedBy",placeholder:e.t("patientHealthRecords.issuedBy"),value:ce,onChange:function(e){oe(e.target.value)},className:"form-control",disabled:"view"===ye}),(0,P.jsxs)("div",{id:"issuedByErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,P.jsx)(r.Z,{md:"12",children:(0,P.jsxs)(p.Z,{children:[(0,P.jsx)(x.Z,{children:e.t("patientHealthRecords.description")}),(0,P.jsx)("textarea",{name:"description",placeholder:e.t("patientHealthRecords.description"),value:ue,onChange:function(e){he(e.target.value)},className:"form-control",rows:"5",disabled:"view"===ye}),(0,P.jsxs)("div",{id:"descriptionErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]})}),(0,P.jsx)(r.Z,{md:"12",children:(0,P.jsxs)(p.Z,{children:[(0,P.jsx)(x.Z,{children:e.t("patientHealthRecords.dateRecorded")}),(0,P.jsx)(E.Z,{value:pe,onDateChange:function(e){xe(e)},disabled:"view"===ye})]})}),(0,P.jsxs)(r.Z,{md:"12",children:[(0,P.jsx)(T.Z,{selectedFiles:Re,setselectedFiles:function(e){Ee(e)},readOnly:"view"===ye}),(0,P.jsxs)("div",{id:"fileErr",style:{color:"red",marginLeft:"5px",display:"none"},children:["*",e.t("this.field.is.required"),"!"]})]}),(0,P.jsx)(r.Z,{md:"12",children:(0,P.jsxs)("div",{className:"modal-footer d-flex w-100 justify-content-center align-self-centerl",children:[(0,P.jsx)("button",{type:"button",onClick:function(){Le()},className:"btn btn-secondary btn-lg waves-effect ","data-dismiss":"modal",children:e.t("patientHealthRecords.close")}),"view"!==ye&&(0,P.jsx)(N.Z,{htmlType:"submit",buttonText:e.t("patientHealthRecords.save"),load:S,buttonColor:"primary",buttonSize:"lg"})]})})]})})})]})})}),Ae?(0,P.jsx)(w(),{title:e.t("patientHealthRecords.areYouSure"),warning:!0,showCancel:!0,
1confirmBtnBsStyle:"success",cancelBtnBsStyle:"danger",onConfirm:function(){},customButtons:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a.Z,{className:"w25-min-150-button m-1",color:"success",onClick:function(){we(!1)},size:"lg",children:e.t("general.cancel")}),(0,P.jsx)(N.Z,{className:"w25-min-150-button m-1",htmlType:"button",buttonText:e.t("patientHealthRecords.yes"),load:S,buttonColor:"danger",buttonSize:"lg",onClick:function(){U(Te)}})]}),children:e.t("patientHealthRecords.youWontBeAbleToRevertThis")}):null]})]})};k.defaultProps={readOnly:!0,patientReadOnly:!0};t.Z=(0,S.$j)((function(e){var t=e.PatientReportActionsReducer;return{isLoadingActions:t.isLoading,errorActions:t.error,successActions:t.success,patientReportActions:t.patientReportActions,patientReportActionsError:t.patientReportActionsError,currentAction:t.currentAction}}),{addPatientReportAction:O.AO,updatePatientReportAction:O.NR,deletePatientReportAction:O.Q$,patientReportSuccessOrErrorToggleAction:O.v3})((0,Z.hr)()(k))},26726:function(e,t,n){var s=n(67294),i=n(8801),r=n(40974),a=n(2483),l=n(50500),c=n(51964),o=n.n(c),d=(n(9282),n(36595)),u=n(10267),h=n(51252),m=n(57145),p=n(54219),x=n(68311),j=n(85893);t.Z=(0,i.hr)()((function(e){var t=e.visitHistory,n=e.appointmentId,i=e.isPatient,c=(0,s.useState)(""),g=c[0],f=c[1];return(0,s.useEffect)((function(){f(i?x.Z.Patient.AppointmentView:x.Z.Doctor.AppointmentView)}),[i]),(0,j.jsx)("div",{children:(0,j.jsx)(o(),{style:{height:"150vh"},children:t&&0!==t.length?(0,j.jsxs)(d.Z,{className:"project-list-table table-centered table-borderless",children:[(0,j.jsx)("thead",{children:(0,j.jsx)("tr",{children:(0,j.jsx)("th",{scope:"col",className:"h4 text-center",children:e.t("bookAppointment.visitDetails")})})}),(0,j.jsx)("tbody",{children:t.map((function(t){return n!==t.appointmentId?(0,j.jsx)("tr",{children:(0,j.jsx)("td",{className:"event-list",children:(0,j.jsx)(r.Z,{target:"_blank",to:g+t.appointmentId,children:(0,j.jsx)(u.Z,{children:(0,j.jsx)(h.Z,{md:"12",children:(0,j.jsxs)("div",{className:"media",children:[(0,j.jsx)("div",{className:"mx-3 d-flex justify-content-center align-items-center w-25",children:(0,j.jsx)(a.Z,{alt:t.specialityDTO.name,src:t.specialityDTO.icon,avatarTextColor:"red",avatarBackgroundColor:"transparent",borderColor:"red",firstName:t.specialityDTO.name,wrapperClassName:"avatar-md font-size-20"})}),(0,j.jsx)("div",{className:"media-body text-justify",children:(0,j.jsxs)("div",{children:[(0,j.jsx)("h5",{children:t.doctor.firstName+" "+t.doctor.lastName}),(0,j.jsxs)("p",{className:"mb-0 text-muted",children:[(0,j.jsxs)("b",{className:"mx-2",children:[e.t("patientHealthRecords.physicianSpeciality"),":"]}),t.specialityDTO.name]}),(0,j.jsxs)("p",{className:"mb-0 text-muted",children:[(0,j.jsx)("b",{className:"mx-2",children:e.t("patientHealthRecords.problemDetails")}),(0,j.jsx)(l.Z,{lines:1,ellipsis:(0,j.jsx)("span",{children:"..."}),children:t.problemDetails})]}),t.diagnosis?(0,j.jsxs)("p",{className:"mb-0 text-muted",children:[(0,j.jsx)("b",{className:"mx-2",children:e.t("patientHealthRecords.diagnosis")}),(0,j.jsx)(l.Z,{lines:1,ellipsis:(0,j.jsx)("span",{children:"..."}),children:t.diagnosis})]}):null,(0,j.jsxs)("p",{className:"mb-0 text-muted",children:[(0,j.jsx)("b",{className:"mx-2",children:e.t("patientHealthRecords.appointmentDate")}),(0,m.ow)(t.startTime)]})]})})]})})})})})},t.appointmentId):null}))})]}):(0,j.jsx)(p.Z,{iconClass:"bx bx-calendar-x"})})})}))},21153:function(e,t,n){var s=n(92809),i=n(67294),r=n(41389),a=n(56941),l=n(10267),c=n(51252),o=n(97975),d=n(8801),u=n(92879),h=n(85893);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,s.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=function(e){var t=e.selectedFiles,n=e.setselectedFiles,s=e.readOnly,d=(0,i.useState)(!1),m=d[0],x=d[1],j=(0,i.useState)(0),g=j[0],f=j[1],b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(0===e)return"0 Bytes";var n=1024,s=t<0?0:t,i=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,r)).toFixed(s))+" "+i[r]};return(0,h.jsxs)("div",{children:[!s&&(0,h.jsx)(r.Z,{onDrop:function(e){var t;(t=e).map((function(e){return Object.assign(e,{preview:URL.createObjectURL(e),formattedSize:b(e.size),toBeUploaded:!0,uuid:null})})),n((function(e){return e.concat(t).filter((function(e){return!this[e.name]&&(this[e.name]=!0)}),{}).slice(0,10)}))},children:function(t){var n=t.getRootProps,s=t.getInputProps;return(0,h.jsx)("div",{className:"dropzone",children:(0,h.jsxs)("div",p(p({className:"dz-message needsclick mt-2"},n()),{},{children:[(0,h.jsx)("input",p({},s())),(0,h.jsx)("div",{className:"mb-3",children:(0,h.jsx)("i",{className:"display-4 text-muted bx bxs-cloud-upload"})}),(0,h.jsx)("h4",{children:e.t("patientHealthRecords.dropFilesHereOrClickToUpload")})]}))})}}),(0,h.jsx)("div",{className:"dropzone-previews mt-3",id:"file-previews",children:t.map((function(e,t){return(0,h.jsx)(a.Z,{className:"mt-1 mb-0 shadow-none border dz-processing dz-image-preview dz-success dz-complete",children:(0,h.jsx)("div",{className:"p-2",children:(0,h.jsxs)(l.Z,{className:"align-items-center",children:[(0,h.jsx)(c.Z,{className:"col-sm-2 col-3 text-center",children:(0,h.jsx)("img",{"data-dz-thumbnail":"",height:"80",className:"avatar-sm rounded bg-light",alt:e.name,src:e.type&&e.type.includes("image")?e.preview:"/document-placeholder.svg"})}),(0,h.jsxs)(c.Z,{className:"col-sm-10 col-9 d-flex justify-content-between",children:[(0,h.jsxs)("div",{style:{wordBreak:"break-word"},children:[e.name,(0,h.jsx)("p",{className:"mb-0",children:(0,h.jsx)("strong",{children:e.formattedSize})})]}),(0,h.jsx)("div",{className:"text-center d-flex justify-content-center align-items-center",children:(0,h.jsxs)(l.Z,{children:[!s&&(0,h.jsx)(c.Z,{sm:"6",children:(0,h.jsx)(o.Z,{color:"danger",type:"button",className:"m-1",style:{width:"40px"},onClick:function(){var t;t=e,n((function(e){return e.filter((function(e){return e.name!==t.name}))}))},children:(0,h.jsx)("strong",{children:"X"})})}),(0,h.jsx)(c.Z,{sm:s?"12":"6",children:(0,h.jsx)(o.Z,{color:"info",type:"button",className:"m-1",style:{width:"40px"},onClick:function(){window.open(e.preview,"_blank")},children:(0,h.jsx)("strong",{children:(0,h.jsx)("i",{className:"bx bx-window-open"})})})})]})})]})]})})},t+"-file")}
1))}),(0,h.jsx)("div",{className:"my-3 text-center",children:s&&t&&t.length>0&&(0,h.jsx)(o.Z,{color:"primary",type:"button",className:"mx-1",onClick:function(){x(!0)},children:e.t("Open Files (Only Images Can Be Displayed)")})}),t&&0!==t.length&&m&&(0,h.jsx)(u.Z,{wrapperClassName:"direction-ltr",className:"zIndex2000",mainSrc:t[g].preview,nextSrc:t[(g+1)%t.length].preview,prevSrc:t[(g+t.length-1)%t.length].preview,onCloseRequest:function(){return x(!1)},onMovePrevRequest:function(){return f((g+t.length-1)%t.length)},onMoveNextRequest:function(){return f((g+1)%t.length)}})]})};x.defaultProps={readOnly:!1},t.Z=(0,d.hr)()(x)},97105:function(e,t,n){n.d(t,{U:function(){return l},W:function(){return c}});var s=n(92809),i=n(9263);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){(0,s.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r={type:t};n&&(r=a(a({},r),{},{role:n})),s&&(r=a(a({},r),{},{status:s})),i.analytics().logEvent(e,r)},c=function(e,t){i.analytics().logEvent(e,t)}}}]);
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.