u.r&&(u.r=f.end,h.r=v),g.start John Doe added new task Patient appointment booking 4 mins ago For a guide and recipes on how to configure / customize this project,
check out the vue-cli documentation. Installed CLI Plugins
Essential Links
Ecosystem
',7);function js(t,e,a,s,n,r){return(0,i.uX)(),(0,i.CE)("div",zs,[(0,i.Lk)("h1",null,(0,o.v_)(a.msg),1),Bs])}var Vs={name:"HelloWorld",props:{msg:String}};const Ys=(0,Qt.A)(Vs,[["render",js],["__scopeId","data-v-1dfc7223"]]);var Xs=Ys,Qs=a(5775),qs=a(9148),Gs={name:"HomeView",components:{HelloWorld:Xs},data(){return{dashboardData:{patientCount:"...",scanCount:"...",lineChartData:[0,0,0,0,0,0,0,0,0,0,0,0],lineChartData2:[0,0,0,0,0,0,0,0,0,0,0,0],lineChartData3:[0,0,0,0,0,0,0,0,0,0,0,0],hospitalCount:"...",doctorCount:"...",abnormalitiesScanCount:"..."},userData:null,graph_sign_up:!0,graph_month_remarks:"",moment:qs,scans:[],mothers:[],doctors:null,hospitals:null,activities:null}},mounted(){document.title="Tamela Dashboard",this.$root.showLoader=!0,document.querySelector(".page-wrapper").style.paddingTop="70px",this.$root.loadScripts(),this.$root.resetSideBar(),"doctor"===this.$store.state.usercat?this.$router.push("/models"):"admin"!==this.$store.state.usercat&&"hospitaladmin"!==this.$store.state.usercat?this.$router.push("/\n"):(this.$store.commit("currentPage","dashboard"),this.getUserData(),this.getDashboardData(),this.getActivities(),"hospitaladmin"==this.$store.state.usercat?(this.getMothers(),this.getScans(),this.getDoctors()):"admin"==this.$store.state.usercat&&this.getHospitals())},methods:{async getUserData(){const t=this.$store.state.access,e={Authorization:`Bearer ${t}`};try{const t=await Ut.A.get("accounts/userdata?user=current&usercat="+this.$store.state.usercat,{headers:e});this.userData=t.data.data,console.log(this.userData),this.$root.showLoader=!1}catch(a){if(a.response){const t=a.response.status;401===t?await this.refreshToken(this.getUserData):(console.error(`Error ${t}: ${a.response.data.message}`),zt.oR.error(`Error ${t}: ${a.response.data.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}else a.request?(console.error("No response received:",a.request),zt.oR.error("No response received. Please try again later.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):(console.error("Error",a),zt.oR.error(`Error: ${a}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}},async refreshToken(t){try{const e=await Ut.A.post("api/token/refresh",{refresh:this.$store.state.refresh});e.data.access?(this.$store.commit("setAccess",e.data.access),Ut.A.defaults.headers.common["Authorization"]="Bearer "+e.data.access,await t()):this.$router.push("/login")}catch(e){console.error("Failed to refresh token",e),this.$router.push("/login")}},async getDoctors(){const t=this.$store.state.access,e={Authorization:`Bearer ${t}`};try{const t=await Ut.A.get("accounts/doctors?user=current",{headers:e});this.doctors=t.data.data,console.log(this.doctors)}catch(a){if(a.response){const t=a.response.status;401===t?await this.refreshToken(this.getDoctors):(console.error(`Error ${t}: ${a.response.data.message}`),zt.oR.error(`Error ${t}: ${a.response.data.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}else a.request?(console.error("No response received:",a.request),zt.oR.error("No response received. Please try again later.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):(console.error("Error",a),zt.oR.error(`Error: ${a}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}},async getActivities(){const t=this.$store.state.access,e={Authorization:`Bearer ${t}`};try{const t=await Ut.A.get("api/v1/activities",{headers:e});this.activities=t.data.data,this.$root.showLoader=!1}catch(a){if(a.response){const t=a.response.status;401===t?await this.refreshToken(this.getActivities):(console.error(`Error ${t}: ${a.response.data.message}`),zt.oR.error(`Error ${t}: ${a.response.data.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}else a.request?(console.error("No response received:",a.request),zt.oR.error("No response received. Please try again later.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):"ERR_NETWORK"===a.code?(console.error("Network error:",a),zt.oR.error("Unable to connect. Check your network connection.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):(console.error("Error",a),zt.oR.error(`Error: ${a.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}},addExtraChart(){let t=(new Date).getMonth(),e=t>=1?t-1:11,a=this.dashboardData.lineChartData[t],s=0==this.dashboardData.lineChartData[e]?1:this.dashboardData.lineChartData[e],i=100*(a-s)/s;i=Math.abs(i),a>=s?(this.graph_month_remarks=`${i.toFixed(2)}% increase from last month`,this.graph_sign_up=!0):(this.graph_month_remarks=`${i.toFixed(2)}% decrease from last month`,this.graph_sign_up=!1);let o={labels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[{label:"Number of Scans",backgroundColor:"rgba(42, 45, 116, 0.5)",data:[10,25,11,34,13,10,25,11,34,13,20,25]},{label:"No of Patients",backgroundColor:"rgba(224, 104, 58, 0.7)",fill:!0,data:[10,25,11,34,10,25,11,34,13,13,20,25]}]},n=document.getElementById("linegraph2").getContext("2d");window.myLine=new Qs.Chart(n,{type:"line",data:o,options:{responsive:!0,legend:{display:!1},tooltips:{mode:"index",intersect:!1}}})},setChartData(){"admin"===this.$store.state.usercat&&this.addExtraChart();let t=(new Date).getMonth(),e=t>=1?t-1:11,a=this.dashboardData.lineChartData[t],s=0==this.dashboardData.lineChartData[e]?1:this.dashboardData.lineChartData[e],i=100*(a-s)/s;i=Math.abs(i),a>=s?(this.graph_month_remarks=`${i.toFixed(2)}% increase from last month`,this.graph_sign_up=!0):(this.graph_month_remarks=`${i.toFixed(2)}% decrease from last month`,this.graph_sign_up=!1);let o={labels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[{label:"Number of Scans",backgroundColor:"rgba(42, 45, 116, 0.5)",data:this.dashboardData.lineChartData},{label:"No of Patients",backgroundColor:"rgba(224, 104, 58, 0.7)",fill:!0,data:this.dashboardData.lineChartData2}]},n=document.getElementById("linegraph").getContext("2d");window.myLine=new Qs.Chart(n,{type:"line",data:o,options:{responsive:!0,legend:{display:!1},tooltips:{mode:"index",intersect:!1}}});var r={labels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[{label:"Abnormalities",backgroundColor:"rgba(0, 158, 251, 0.5)",borderColor:"rgba(0, 158, 251, 1)",borderWidth:1,data:[0,0,0,0,0,0,0,0,0,0,0,0]},{label:"Dataset 2",backgroundColor:"rgba(255, 188, 53, 0.5)",borderColor:"rgba(255, 188, 53, 1)",borderWidth:1,data:[0,0,0,0,0,0,0,0,0,0,0,0]},{label:"Dataset 3",backgroundColor:"rgba(231, 76, 60, 0.5)",borderColor:"rgba(231, 76, 60, 0.5)",borderWidth:1,data:this.dashboardData.lineChartData3}]},l=document.getElementById("bargraph").getContext("2d");window.myBar=new Qs.Chart(l,{type:"bar",data:r,options:{responsive:!0,legend:{display:!1}}})},async getDashboardData(){const t=this.$store.state.access,e={Authorization:`Bearer ${t}`};try{const t=await Ut.A.get("api/v1/dashboard/data",{headers:e}),a=t.data.data;console.log(a),this.dashboardData.patientCount=a.patient_count,this.dashboardData.scanCount=a.scan_count,this.dashboardData.lineChartData=a.scan_count_list,this.dashboardData.lineChartData2=a.patient_count_list,this.dashboardData.lineChartData3=a.abnormality_count_list,this.dashboardData.hospitalCount=a.hospitalCount,this.dashboardData.abnormalitiesScanCount=a.abnormalitiesScanCount,this.setChartData(),this.$root.showLoader=!1}catch(a){if(a.response){const t=a.response.status;401===t?await this.refreshToken(this.getDashboardData):(console.error(`Error ${t}: ${a.response.data.message}`),zt.oR.error(`Error ${t}: ${a.response.data.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}else a.request?(console.error("No response received:",a.request),zt.oR.error("No response received. Please try again later.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):"ERR_NETWORK"===a.code?(console.error("Network error:",a),zt.oR.error("Unable to connect. Check your network connection.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):(console.error("Error",a),zt.oR.error(`Error: ${a.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}},isIOS(){const t=navigator.userAgent;return/iPad|iPhone|iPod/.test(t)&&!window.MSStream},async getScans(t=null){const e=this.$store.state.access,a={Authorization:`Bearer ${e}`};await Ut.A.get("api/v1/scan?usercat="+this.$store.state.usercat,{headers:a}).then((t=>{this.scans=t.data.data,this.$root.showLoader=!1})).catch((t=>{if("ERR_NETWORK"!=t.code)401===t.response.status&&this.refreshToken(this.getScans);else{console.error(t);const e="ERR_NETWORK"===t.code?"Unable to Connect. Check your network connection.":t.code;zt.oR.error(e,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})}}))},async getMothers(t=null){const e=this.$store.state.access,a={Authorization:`Bearer ${e}`};await Ut.A.get("accounts/mothers?hospital=current",{headers:a}).then((t=>{this.mothers=t.data.data,this.$root.showLoader=!1})).catch((t=>{if("ERR_NETWORK"!=t.code)401===t.response.status&&this.refreshToken(this.getMothers);else{console.error(t);const e="ERR_NETWORK"===t.code?"Unable to Connect. Check your network connection.":t.code;zt.oR.error(e,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})}}))},async getHospitals(t=null){const e=this.$store.state.access,a={Authorization:`Bearer ${e}`};t||await Ut.A.get("accounts/hospitals",{headers:a}).then((t=>{this.hospitals=t.data.data,console.log(this.hospitals),this.$root.showLoader=!1})).catch((t=>{if("ERR_NETWORK"!=t.code)401===t.response.status&&this.refreshToken(this.getHospitals);else{console.error(t);const e="ERR_NETWORK"===t.code?"Unable to Connect. Check your network connection.":t.code;zt.oR.error(e,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})}}))}}};const Js=(0,Qt.A)(Gs,[["render",Us],["__scopeId","data-v-36ba3a33"]]);var Ks=Js;const Zs=t=>((0,i.Qi)("data-v-4836cdeb"),t=t(),(0,i.jt)(),t),ti={class:"content"},ei={class:"row"},ai={class:"col-lg-6 wideTable"},si={class:"card-box"},ii={class:"card-block"},oi=Zs((()=>(0,i.Lk)("h4",{class:"card-title"},"Hospital Patients Record",-1))),ni={class:"search-box"},ri={class:"table-responsive"},li={class:"table mb-0"},di=Zs((()=>(0,i.Lk)("thead",null,[(0,i.Lk)("tr",null,[(0,i.Lk)("th",null,"Tamela ID"),(0,i.Lk)("th",null,"Surname / Lastname"),(0,i.Lk)("th",null,"Firstname"),(0,i.Lk)("th",null,"Othername"),(0,i.Lk)("th",null,"Age"),(0,i.Lk)("th",null,"City"),(0,i.Lk)("th",null,"State"),(0,i.Lk)("th",null,"Date Added"),(0,i.Lk)("th")])],-1))),ci={key:0},ui=["onClick"],hi=Zs((()=>(0,i.Lk)("td",null,null,-1))),pi={key:0,class:"content-modal"},vi={class:"modal-content"},mi={class:"close-button"},fi={class:"svg-icon"},gi=Zs((()=>(0,i.Lk)("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z"},null,-1))),bi=[gi],ki={class:"center-img"},yi={key:0,class:"imgbox"},_i=["src"],Li={class:"items"},xi={class:"title"},wi={style:{"text-transform":"lowercase"}},Ci=["href"],Si={class:"split-options",style:{display:"flex","justify-content":"space-between"}},Di={key:1,class:"content-modal",style:{"z-index":"1000"}},Mi={class:"modal-content"},Ai={class:"close-button"},Ii={class:"svg-icon"},Ti=Zs((()=>(0,i.Lk)("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z"},null,-1))),Pi=[Ti],Ri={class:"upload-div"},Oi=Zs((()=>(0,i.Lk)("h3",{class:"title"},"Upload Ultrasound Scan for smart analysis",-1))),Ei={class:"form-data",id:"upload-form",ref:"scanform"},Ni={class:"field"},Fi=Zs((()=>(0,i.Lk)("label",{for:""},"Name",-1))),$i=["value"],Hi={class:"field"},Wi=Zs((()=>(0,i.Lk)("label",{for:""},"Tamela ID",-1))),Ui=["value"],zi={class:"field"},Bi=Zs((()=>(0,i.Lk)("label",{for:""},"Foetus age in weeks",-1))),ji={class:"field"},Vi=Zs((()=>(0,i.Lk)("label",{for:""},"Foetus label",-1))),Yi={class:"field"},Xi=Zs((()=>(0,i.Lk)("label",{for:""},"Ultrasound Image",-1))),Qi={key:0,class:"image-show"},qi=["src"],Gi=["disabled"],Ji={key:2,class:"content-modal"},Ki={class:"modal-content"},Zi={class:"close-button"},to={class:"svg-icon"},eo=Zs((()=>(0,i.Lk)("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z"},null,-1))),ao=[eo],so={id:"reg"},io=Zs((()=>(0,i.Lk)("h3",{class:"title"},"Add Mothers",-1))),oo={class:"field2"},no={class:"field2"},ro={class:"field2"};function lo(t,e,a,n,r,l){return(0,i.uX)(),(0,i.CE)("main",null,[(0,i.Lk)("div",ti,[(0,i.Lk)("div",ei,[(0,i.Lk)("div",ai,[(0,i.Lk)("div",si,[(0,i.Lk)("div",ii,[oi,(0,i.Lk)("button",{class:"add-mothers",onClick:e[0]||(e[0]=t=>r.isCreateMother=!0)}," Add Patients + "),(0,i.Lk)("div",ni,[(0,i.bo)((0,i.Lk)("input",{type:"text",placeholder:"Search for Mothers","onUpdate:modelValue":e[1]||(e[1]=t=>r.searchQuery=t)},null,512),[[s.Jo,r.searchQuery]])]),(0,i.Lk)("div",ri,[(0,i.Lk)("table",li,[di,r.patients&&r.patients.length>=1?((0,i.uX)(),(0,i.CE)("tbody",ci,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(r.patients,((t,e)=>(0,i.bo)(((0,i.uX)(),(0,i.CE)("tr",{key:e},[(0,i.Lk)("td",{onClick:e=>r.selectedMotherData=t},(0,o.v_)(t.tamelaID),9,ui),(0,i.Lk)("td",null,(0,o.v_)(t.firstname),1),(0,i.Lk)("td",null,(0,o.v_)(t.lastname),1),(0,i.Lk)("td",null,(0,o.v_)(t.othername),1),(0,i.Lk)("td",null,(0,o.v_)(t.age),1),(0,i.Lk)("td",null,(0,o.v_)(t.city),1),(0,i.Lk)("td",null,(0,o.v_)(t.state),1),(0,i.Lk)("td",null,(0,o.v_)(r.moment(`${t.date_added}`).format("DD MMM, YYYY")),1),hi])),[[s.aG,l.isMatch(t)]]))),128))])):(0,i.Q3)("",!0)])])])])])])]),r.selectedMotherData?((0,i.uX)(),(0,i.CE)("div",pi,[(0,i.Lk)("div",vi,[(0,i.Lk)("div",mi,[(0,i.Lk)("span",fi,[((0,i.uX)(),(0,i.CE)("svg",{onClick:e[2]||(e[2]=t=>r.selectedMotherData=null),xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48"},bi))])]),(0,i.Lk)("div",ki,[r.selectedMotherData.mother_image?((0,i.uX)(),(0,i.CE)("div",yi,[(0,i.Lk)("img",{class:"profile",src:r.selectedMotherData.mother_image,alt:""},null,8,_i)])):(0,i.Q3)("",!0)]),(0,i.Lk)("div",Li,[(0,i.Lk)("h3",xi,(0,o.v_)(r.selectedMotherData.lastname)+" "+(0,o.v_)(r.selectedMotherData.firstname)+" "+(0,o.v_)(r.selectedMotherData.othername),1),(0,i.Lk)("h3",null,[(0,i.eW)(" Email Address: "),(0,i.Lk)("span",wi,[(0,i.Lk)("a",{href:`mailto:${r.selectedMotherData.email}`},(0,o.v_)(r.selectedMotherData.email),9,Ci)])]),(0,i.Lk)("h3",null,[(0,i.eW)(" Phone Number: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedMotherData.phone_number),1)]),(0,i.Lk)("h3",null,[(0,i.eW)(" Age: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedMotherData.age),1)]),(0,i.Lk)("h3",null,[(0,i.eW)(" city: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedMotherData.city),1)]),(0,i.Lk)("h3",null,[(0,i.eW)(" state: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedMotherData.state),1)]),(0,i.Lk)("h3",null,[(0,i.eW)(" address: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedMotherData.address),1)]),(0,i.Lk)("h3",null,[(0,i.eW)(" date added: "),(0,i.Lk)("span",null,(0,o.v_)(r.moment(`${r.selectedMotherData.date_added}`).format("DD MMM, YYYY")),1)])]),(0,i.Lk)("div",Si,[(0,i.Lk)("button",{onClick:e[3]||(e[3]=t=>l.goToScan(r.selectedMotherData))},"Upload Scan"),(0,i.Lk)("button",{onClick:e[4]||(e[4]=t=>l.showScan(r.selectedMotherData))},"View Scan History")])])])):(0,i.Q3)("",!0),r.isScanOpen&&r.selectedMotherData?((0,i.uX)(),(0,i.CE)("div",Di,[(0,i.Lk)("div",Mi,[(0,i.Lk)("div",Ai,[(0,i.Lk)("span",Ii,[((0,i.uX)(),(0,i.CE)("svg",{onClick:e[5]||(e[5]=t=>r.isScanOpen=null),xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48"},Pi))])]),(0,i.Lk)("div",Ri,[Oi,(0,i.Lk)("form",Ei,[(0,i.Lk)("div",Ni,[Fi,(0,i.Lk)("input",{type:"text",name:"",id:"",value:r.selectedMotherData.lastname.toUpperCase()+" "+r.selectedMotherData.firstname.toUpperCase()+" "+r.selectedMotherData.othername.toUpperCase(),disabled:""},null,8,$i)]),(0,i.Lk)("div",Hi,[Wi,(0,i.Lk)("input",{type:"text",name:"",id:"",value:r.selectedMotherData.tamelaID,disabled:""},null,8,Ui)]),(0,i.Lk)("div",zi,[Bi,(0,i.bo)((0,i.Lk)("input",{type:"number",name:"",id:"",placeholder:"",min:"0",max:"52","onUpdate:modelValue":e[6]||(e[6]=t=>r.foetusAge=t),onInput:e[7]||(e[7]=t=>r.foetusAge=r.foetusAge<0?0:r.foetusAge>52?52:r.foetusAge),required:""},null,544),[[s.Jo,r.foetusAge]])]),(0,i.Lk)("div",ji,[Vi,(0,i.bo)((0,i.Lk)("input",{type:"text",name:"",id:"",value:"","onUpdate:modelValue":e[8]||(e[8]=t=>r.foetusLabel=t)},null,512),[[s.Jo,r.foetusLabel]])]),(0,i.Lk)("p",null,"Image should not exceed "+(0,o.v_)(r.maxSize/1048576)+"MB",1),(0,i.Lk)("div",Yi,[Xi,(0,i.Lk)("input",{type:"file",accept:"image/jpeg, image/png",name:"",id:"",value:"",onChange:e[9]||(e[9]=(...t)=>l.handleImageChange&&l.handleImageChange(...t)),required:""},null,32)])],512),r.imageUrl?((0,i.uX)(),(0,i.CE)("div",Qi,[(0,i.Lk)("img",{src:r.imageUrl,alt:""},null,8,qi)])):(0,i.Q3)("",!0),(0,i.Lk)("button",{onClick:e[10]||(e[10]=t=>l.uploadImage()),disabled:!r.image},"Upload Image",8,Gi)])])])):(0,i.Q3)("",!0),r.isCreateMother?((0,i.uX)(),(0,i.CE)("div",Ji,[(0,i.Lk)("div",Ki,[(0,i.Lk)("div",Zi,[(0,i.Lk)("span",to,[((0,i.uX)(),(0,i.CE)("svg",{onClick:e[11]||(e[11]=t=>r.isCreateMother=!1),xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48"},ao))])]),(0,i.Lk)("div",so,[(0,i.Lk)("form",{class:"add-mother-form",onSubmit:e[23]||(e[23]=(0,s.D$)(((...e)=>t.submitForm&&t.submitForm(...e)),["prevent"])),id:"add-mother-form",ref:"addMotherForm"},[io,(0,i.Lk)("div",oo,[(0,i.bo)((0,i.Lk)("input",{type:"text",placeholder:"Surname/Lastname","onUpdate:modelValue":e[12]||(e[12]=t=>r.surname=t),required:""},null,512),[[s.Jo,r.surname]]),(0,i.bo)((0,i.Lk)("input",{type:"text",placeholder:"Firstname","onUpdate:modelValue":e[13]||(e[13]=t=>r.firstname=t),required:""},null,512),[[s.Jo,r.firstname]])]),(0,i.Lk)("div",no,[(0,i.bo)((0,i.Lk)("input",{type:"text",placeholder:"Othername","onUpdate:modelValue":e[14]||(e[14]=t=>r.othername=t)},null,512),[[s.Jo,r.othername]]),(0,i.bo)((0,i.Lk)("input",{type:"number",placeholder:"Age","onUpdate:modelValue":e[15]||(e[15]=t=>r.age=t),onInput:e[16]||(e[16]=t=>r.age=r.age<0?0:r.age),required:""},null,544),[[s.Jo,r.age]])]),(0,i.bo)((0,i.Lk)("input",{type:"text",pattern:"[0-9]*",inputmode:"numeric",placeholder:"Phone Number","onUpdate:modelValue":e[17]||(e[17]=t=>r.phoneNumber=t),required:""},null,512),[[s.Jo,r.phoneNumber]]),(0,i.bo)((0,i.Lk)("input",{type:"email",placeholder:"Email",autocomplete:"off","onUpdate:modelValue":e[18]||(e[18]=t=>r.email=t),required:""},null,512),[[s.Jo,r.email]]),(0,i.Lk)("div",ro,[(0,i.bo)((0,i.Lk)("input",{type:"text",placeholder:"City","onUpdate:modelValue":e[19]||(e[19]=t=>r.city=t),required:""},null,512),[[s.Jo,r.city]]),(0,i.bo)((0,i.Lk)("input",{type:"text",placeholder:"State","onUpdate:modelValue":e[20]||(e[20]=t=>r.state=t),required:""},null,512),[[s.Jo,r.state]])]),(0,i.bo)((0,i.Lk)("textarea",{name:"",id:"",cols:"30",rows:"3",placeholder:"Home Address","onUpdate:modelValue":e[21]||(e[21]=t=>r.homeAddress=t),required:""},null,512),[[s.Jo,r.homeAddress]]),(0,i.Lk)("input",{type:"file",onChange:e[22]||(e[22]=(...t)=>l.handleFileChange&&l.handleFileChange(...t)),accept:"image/jpeg, image/png, image/gif"},null,32)],544),(0,i.Lk)("button",{onClick:e[24]||(e[24]=(...t)=>l.createMother&&l.createMother(...t))},"Add Mother +")])])])):(0,i.Q3)("",!0)])}var co=a(9148),uo={name:"mothers",components:{},data(){return{patients:[],moment:co,selectedMotherData:null,searchQuery:"",isScanOpen:!1,foetusAge:"",foetusLabel:"",image:null,imageUrl:null,maxSize:2097152,age:"",isCreateMother:!1,surname:"",firstname:"",othername:"",phoneNumber:"",email:"",city:"",state:"",homeAddress:"",imageFile:null,formData:null,motherFormData:null}},computed:{},mounted(){this.$store.state.doctor_username?this.$router.push("/doctor"):(document.title="Tamela Dashboard | Mothers",this.$store.commit("currentPage","mothers"),document.querySelector(".page-wrapper").style.paddingTop="50px",this.$root.loadScripts(),this.$root.resetSideBar(),this.getPatient(),this.$root.showLoader=!0)},methods:{async getPatient(t=null){const e=this.$store.state.access,a={Authorization:`Bearer ${e}`};t||await Ut.A.get("accounts/mothers",{headers:a}).then((t=>{this.patients=t.data.data,this.$root.showLoader=!1})).catch((t=>{if("ERR_NETWORK"!=t.code)401===t.response.status&&this.refreshToken(this.getPatient);else{console.error(t);const e="ERR_NETWORK"===t.code?"Unable to Connect. Check your network connection.":t.code;zt.oR.error(e,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})}}))},isMatch(t){const e=this.searchQuery.toLowerCase();return t.tamelaID.includes(this.searchQuery.toUpperCase())||t.firstname.toLowerCase().includes(e)||t.lastname.toLowerCase().includes(e)||t.othername.toLowerCase().includes(e)||t.city.toLowerCase().includes(e)||t.state.toLowerCase().includes(e)},async sendImage(t){const e=this.$store.state.access,a={Authorization:`Bearer ${e}`,"Content-Type":"application/json"};console.log(t),await Ut.A.post("api/v1/scan",t,{headers:a}).then((t=>{console.log(t.data),t.data.status&&(zt.oR.success("Scan Uploaded",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}),this.image=null,this.imageUrl=null,this.isScanOpen=!1)})).catch((e=>{if("ERR_NETWORK"!=e.code)401===e.response.status&&this.refreshToken(this.sendImage(t));else{console.error(e);const t="ERR_NETWORK"===e.code?"Unable to Connect. Check your network connection.":e.code;zt.oR.error(t,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})}}))},showScan(t){this.$store.commit("selectPatient",t),null!==t&&this.$router.push("/motherscans")},goToScan(t){this.$store.commit("currentPage","models"),this.$store.commit("selectPatient",t),this.$router.push("/models")},async uploadImage(){const t=this.$refs.scanform;if(t.checkValidity())if(this.image){const t=new FormData;t.append("image",this.image),t.append("uid",this.selectedMotherData.uuid),t.append("foetus_age",this.foetusAge),t.append("foetus_label",this.foetusLabel);const a=this.$store.state.access,s={Authorization:`Bearer ${a}`,"Content-Type":"multipart/form-data"};try{const e=await Ut.A.post("api/v1/scan",t,{headers:s});console.log(e.data),e.data.status&&(zt.oR.success("Scan Uploaded",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}),this.image=null,this.imageUrl=null,this.isScanOpen=!1)}catch(e){if("ERR_NETWORK"!=e.code)401===e.response.status&&this.refreshToken(this.uploadImage);else{console.error(e);const t="ERR_NETWORK"===e.code?"Unable to Connect. Check your network connection.":e.code;zt.oR.error(t,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})}}}else console.error("No image selected.");else t.reportValidity()},handleImageChange(t){const e=t.target.files[0];if(e){if(e.size>this.maxSize)return void zt.oR.error("Max file size exceeded. Please select a smaller image.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT});this.image=e;const t=new FileReader;t.onload=()=>{this.imageUrl=t.result},t.readAsDataURL(e)}},handleFileChange(t){const e=t.target.files[0];if(e){if(e.size>this.maxSize)return void zt.oR.error("Max file size exceeded. Please select a smaller image.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT});this.imageFile=e}},async refreshToken(t){await Ut.A.post("api/token/refresh",{refresh:this.$store.state.refresh}).then((e=>{e.data.access&&(this.$store.commit("setAccess",e.data.access),Ut.A.defaults.headers.common["Authorization"]="Bearer "+e.data.access,t())})).catch((t=>{}))},async sendNewMother(){this.motherFormData;const t=this.$store.state.access,e={Authorization:`Bearer ${t}`,"Content-Type":"multipart/form-data"};await Ut.A.post("accounts/mothers",this.motherFormData,{headers:e}).then((t=>{this.getPatient(),t.data.status?(zt.oR.success("Mother Added",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}),this.isCreateMother=!1,this.surname="",this.firstname="",this.othername="",this.phoneNumber="",this.email="",this.city="",this.state="",this.homeAddress="",this.imageFile=null):zt.oR.error(t.data.message,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})})).catch((t=>{if("ERR_NETWORK"!=t.code)401===t.response.status&&this.refreshToken(this.sendNewMother);else{console.error(t);const e="ERR_NETWORK"===t.code?"Unable to Connect. Check your network connection.":t.code;zt.oR.error(e,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})}}))},createMother(){const t=this.$refs.addMotherForm;if(t.checkValidity()){const t=new FormData;t.append("lastname",this.surname),t.append("firstname",this.firstname),t.append("othername",this.othername),t.append("age",this.age),t.append("phone_number",this.phoneNumber),t.append("email",this.email),t.append("city",this.city),t.append("state",this.state),t.append("address",this.homeAddress),t.append("image",this.imageFile),this.motherFormData=t,this.sendNewMother()}else t.reportValidity()},async addGoal(t,e,a,s,i,o,n,r,l,d,c,u,h,p,v,m,f){try{t="Select Type"===t?null:parseInt(t),e="Select Term"===e?null:parseInt(e);const g={planTypeId:t,planTermId:e,goalSummary:a,achievementApproach:s,requiredResources:i,successCriteria:o,potentialChallenges:n,solutionToChallenges:r,targetCompletionDate:l,actualCompletionDate:d,progressMetrics:c,status:u,feedback:h,evidenceURL:p,createdBy:v,lastModifiedBy:m,recordOwner:f};console.log("Submitting payload:",g);const b=new FormData;Object.keys(g).forEach((t=>{void 0!==g[t]&&null!==g[t]&&b.append(t,g[t])}));const k=await Ut.A.post("https://infracredit.pythonanywhere.com/api/v1/development-plans",b,{headers:{"Content-Type":"multipart/form-data"}});console.log("Server response:",k),k.data?console.log("Goal added:",k.data):console.error("Server response data is empty")}catch(g){g.response?console.error("Error adding goal:",g.response.data):console.error("Error adding goal:",g)}}}};const ho=(0,Qt.A)(uo,[["render",lo],["__scopeId","data-v-4836cdeb"]]);var po=ho;const vo=t=>((0,i.Qi)("data-v-53f0329a"),t=t(),(0,i.jt)(),t),mo={class:"content"},fo={class:"row"},go={class:"wideTable",style:{overflow:"auto",width:"100%"}},bo={class:"card-box"},ko={class:"card-block"},yo=vo((()=>(0,i.Lk)("h4",{class:"card-title"},"AI Scan Results",-1))),_o=vo((()=>(0,i.Lk)("button",{class:"add-scan",style:{display:"none"}},"Upload Scan",-1))),Lo={class:"search-box"},xo={class:"table-responsive"},wo={class:"table mb-0"},Co=vo((()=>(0,i.Lk)("thead",null,[(0,i.Lk)("tr",null,[(0,i.Lk)("th",null,"Scan ID"),(0,i.Lk)("th",null,"Mother's ID"),(0,i.Lk)("th",null,"Mother's Name"),(0,i.Lk)("th",null,"Scan Status"),(0,i.Lk)("th",null,"AI Model"),(0,i.Lk)("th",null,"Foetus Label"),(0,i.Lk)("th",null,"Scanned On"),(0,i.Lk)("th",null,"Issues Present?"),(0,i.Lk)("th",null,"Issues Priority"),(0,i.Lk)("th",null,"Model Used By:"),(0,i.Lk)("th")])],-1))),So={key:0},Do=["onClick"],Mo={key:0,class:"primary"},Ao={key:1,style:{"text-transform":"Capitalize"}},Io={key:0},To={key:1},Po={key:0,class:"primary",style:{"vertical-align":"middle"}},Ro={key:1,style:{"text-transform":"Capitalize"}},Oo={key:0},Eo={key:1},No=["href"],Fo={key:0,class:"content-modal scans"},$o={class:"modal-content"},Ho={class:"close-button"},Wo=vo((()=>(0,i.Lk)("i",{class:"fa-solid fa-angles-left"},null,-1))),Uo=vo((()=>(0,i.Lk)("span",null,"Back",-1))),zo={class:"report",ref:"content",id:"scanReport"},Bo={class:"center-img"},jo={class:"imgbox",style:{}},Vo=["src"],Yo={class:"top-level"},Xo={class:"info"},Qo={class:"primary"},qo={style:{"text-transform":"uppercase"}},Go={class:"primary"},Jo={class:"info"},Ko={class:"report-info"},Zo=vo((()=>(0,i.Lk)("div",{class:"report-results",style:{"margin-top":"1rem","border-top":"1px solid var(--dark)","padding-top":"1rem","overflow-y":"auto"}},null,-1))),tn={style:{"font-size":"16px","text-align":"center","text-transform":"uppercase","margin-bottom":"1rem"}},en={style:{"font-weight":"600",color:"var(--primary)","font-size":"12px"}},an={style:{"font-size":"16px"}},sn={style:{"font-weight":"400",color:"var(--info-dark)"}},on={key:0,style:{"font-size":"16px"}},nn={style:{"font-weight":"400",color:"var(--info-dark)"}},rn={key:1,style:{"font-size":"16px"}},ln={style:{"font-weight":"400",color:"var(--info-dark)"}},dn={key:2,style:{"font-size":"16px","margin-top":"1rem"}},cn={style:{"font-weight":"400",color:"var(--info-dark)"}},un={key:3,style:{"font-size":"20px","text-transform":"uppercase","justify-content":"center","text-align":"center",color:"var(--primary)","margin-top":"1rem"}},hn={key:4,class:"model-result-table"},pn={style:{"font-weight":"400",color:"var(--info-dark)"}},vn=vo((()=>(0,i.Lk)("thead",null,[(0,i.Lk)("tr",null,[(0,i.Lk)("th",null,"AI Model"),(0,i.Lk)("th",null,"Predicted Class"),(0,i.Lk)("th",null,"Confidence")])],-1))),mn=vo((()=>(0,i.Lk)("h3",{style:{"font-size":"16px","margin-top":"1rem"}},"Most recent recorded vitals before scan: ",-1))),fn={style:{"font-weight":"400",color:"var(--info-dark)"}},gn={key:5,style:{"font-size":"16px","margin-top":"1rem",display:"flex","flex-direction":"column"}},bn=vo((()=>(0,i.Lk)("h3",{style:{"font-size":"20px","text-transform":"uppercase","justify-content":"center","text-align":"center",color:"var(--primary)"}},"AI Report:",-1))),kn=vo((()=>(0,i.Lk)("i",{class:"fa fa-download"},null,-1))),yn={key:1,class:"content-modal issue-modal",style:{"z-index":"999"}},_n={class:"modal-content"},Ln={class:"close-button"},xn={class:"svg-icon"},wn=vo((()=>(0,i.Lk)("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z"},null,-1))),Cn=[wn],Sn={class:"report priority"},Dn={class:"field"},Mn=vo((()=>(0,i.Lk)("label",{for:"",style:{"margin-top":"1rem","font-weight":"bold","font-size":"16px"}},"Priority",-1))),An=vo((()=>(0,i.Lk)("option",{value:"",selected:"",disabled:""},"Select a Priority",-1))),In=vo((()=>(0,i.Lk)("option",{value:"3"},"Low",-1))),Tn=vo((()=>(0,i.Lk)("option",{value:"2"},"Medium",-1))),Pn=vo((()=>(0,i.Lk)("option",{value:"1"},"High",-1))),Rn=[An,In,Tn,Pn],On={class:"field",style:{"margin-top":"1rem"}},En=["disabled"],Nn=vo((()=>(0,i.Lk)("i",{class:"fa fa-spinner"},null,-1))),Fn={key:2,class:"content-modal viewer-div",style:{"z-index":"9999"}},$n={class:"modal-content-viewer"},Hn={class:"close-button"},Wn=vo((()=>(0,i.Lk)("i",{class:"fa-solid fa-angles-left"},null,-1))),Un=vo((()=>(0,i.Lk)("span",null,"Exit Viewer",-1))),zn={class:"viewer",ref:"viewer",id:"dicomImage"},Bn=["src"],jn={key:1},Vn=(0,i.Fv)('',1);function Yn(t,e,a,n,r,l){return(0,i.uX)(),(0,i.CE)("main",null,[(0,i.Lk)("div",mo,[(0,i.Lk)("div",fo,[(0,i.Lk)("div",go,[(0,i.Lk)("div",bo,[(0,i.Lk)("div",ko,[yo,_o,(0,i.Lk)("div",Lo,[(0,i.bo)((0,i.Lk)("input",{type:"text",placeholder:"Search for Scans","onUpdate:modelValue":e[0]||(e[0]=t=>r.searchQuery=t)},null,512),[[s.Jo,r.searchQuery]])]),(0,i.Lk)("div",xo,[(0,i.Lk)("table",wo,[Co,r.scans&&r.scans.length>=1?((0,i.uX)(),(0,i.CE)("tbody",So,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(r.scans,((e,a)=>(0,i.bo)(((0,i.uX)(),(0,i.CE)("tr",{key:a},[(0,i.Lk)("td",{onClick:t=>r.selectedScanData=e},(0,o.v_)(e.scanID),9,Do),(0,i.Lk)("td",null,(0,o.v_)(e.mother_data.tamelaID),1),(0,i.Lk)("td",null,(0,o.v_)(e.mother_data.lastname)+" "+(0,o.v_)(e.mother_data.firstname)+" "+(0,o.v_)(e.mother_data.othername),1),(0,i.Lk)("td",{class:(0,o.C4)(e.status)},(0,o.v_)(e.status),3),(0,i.Lk)("td",null,(0,o.v_)(e.model_name),1),(0,i.Lk)("td",null,(0,o.v_)(e.foetus_label),1),(0,i.Lk)("td",null,(0,o.v_)(r.moment(`${e.date_added}`).format("DD MMMM YYYY, HH:MM:SS")),1),(0,i.Lk)("td",{class:(0,o.C4)({success:!e.issue_present,failed:e.issue_present})},(0,o.v_)(e.issue_present?"YES":"NONE"),3),(0,i.Lk)("td",{class:(0,o.C4)({failed:1===e.issue_priority,awaiting:2===e.issue_priority,plain:3===e.issue_priority}),style:{"font-size":"24px !important","text-align":"center"}},(0,o.v_)(e.issue_priority||"-"),3),"doctor"==t.$store.state.usercat?((0,i.uX)(),(0,i.CE)(i.FK,{key:0},[e.scan_by.username===r.userData.staff_user_details.username?((0,i.uX)(),(0,i.CE)("td",Mo,"You")):((0,i.uX)(),(0,i.CE)("td",Ao,["doctor"===e.scan_by.usercat?((0,i.uX)(),(0,i.CE)("span",Io,"Dr. "+(0,o.v_)(e.scan_by.name),1)):((0,i.uX)(),(0,i.CE)("span",To,"Dr. "+(0,o.v_)(e.scan_by.personal_name),1))]))],64)):(0,i.Q3)("",!0),"hospitaladmin"==t.$store.state.usercat?((0,i.uX)(),(0,i.CE)(i.FK,{key:1},[e.scan_by.username===r.userData.contactEmail||e.scan_by.name===r.userData.hospitalAdminInfo.perrsonal_name?((0,i.uX)(),(0,i.CE)("td",Po,"You")):((0,i.uX)(),(0,i.CE)("td",Ro,["hospitaladmin"===e.scan_by.usercat?((0,i.uX)(),(0,i.CE)("span",Oo,"Dr. "+(0,o.v_)(e.scan_by.personal_name)+(0,o.v_)(r.userData),1)):((0,i.uX)(),(0,i.CE)("span",Eo,"Dr. "+(0,o.v_)(e.scan_by.name),1))]))],64)):(0,i.Q3)("",!0),(0,i.Lk)("td",null,[e.scan_image?((0,i.uX)(),(0,i.CE)("a",{key:0,target:"_blank",href:e.scan_image},"click to View Image",8,No)):(0,i.Q3)("",!0)])])),[[s.aG,l.isMatch(e)]]))),128))])):(0,i.Q3)("",!0)])])])])])])]),r.selectedScanData?((0,i.uX)(),(0,i.CE)("div",Fo,[(0,i.Lk)("div",$o,[(0,i.Lk)("div",Ho,[(0,i.Lk)("span",{class:"svg-icon",onClick:e[1]||(e[1]=t=>r.selectedScanData=null)},[Wo,(0,i.eW)(" "),Uo])]),(0,i.Lk)("div",zo,[(0,i.Lk)("div",Bo,[(0,i.Lk)("div",jo,[(0,i.Lk)("img",{class:"profile",src:r.selectedScanData.mother_data.image,alt:""},null,8,Vo)])]),(0,i.Lk)("div",Yo,[(0,i.Lk)("div",Xo,[(0,i.Lk)("h3",null,[(0,i.eW)("Tamela ID: "),(0,i.Lk)("span",Qo,(0,o.v_)(r.selectedScanData.mother_data.tamelaID),1)]),(0,i.Lk)("h3",qo,[(0,i.eW)("Name: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedScanData.mother_data.lastname)+" "+(0,o.v_)(r.selectedScanData.mother_data.firstname)+" "+(0,o.v_)(r.selectedScanData.mother_data.othername),1)]),(0,i.Lk)("h3",null,[(0,i.eW)("Scan ID: "),(0,i.Lk)("span",Go,(0,o.v_)(r.selectedScanData.scanID),1)]),(0,i.Lk)("h3",null,[(0,i.eW)("Scan Date: "),(0,i.Lk)("span",null,(0,o.v_)(r.moment(`${r.selectedScanData.date_added}`).format("DD MMM, YYYY")),1)]),(0,i.Lk)("h3",null,[(0,i.eW)("Scan Status: "),(0,i.Lk)("span",{class:(0,o.C4)(r.selectedScanData.status),style:{"font-weight":"400"}},(0,o.v_)(r.selectedScanData.status),3)])]),(0,i.Lk)("div",Jo,[(0,i.Lk)("h3",null,[(0,i.eW)("Mother's Age: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedScanData.mother_data.age),1)]),(0,i.Lk)("h3",null,[(0,i.eW)("Foetus age: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedScanData.foetus_age_in_weeks)+" Weeks",1)]),(0,i.Lk)("h3",null,[(0,i.eW)("city: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedScanData.mother_data.city),1)]),(0,i.Lk)("h3",null,[(0,i.eW)("state: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedScanData.mother_data.state||"None")+" State.",1)]),(0,i.Lk)("h3",null,[(0,i.eW)("Address: "),(0,i.Lk)("span",null,(0,o.v_)(r.selectedScanData.mother_data.address),1)])])])],512),(0,i.Lk)("div",Ko,[Zo,(0,i.Lk)("h3",tn,[(0,i.eW)("SCAN MODEL: "),(0,i.Lk)("span",en,(0,o.v_)(r.selectedScanData.model_name),1)]),(0,i.Lk)("h3",an,[(0,i.eW)("Issues Found: "),(0,i.Lk)("span",sn,(0,o.v_)(r.selectedScanData.issue_present?"ISSUES PRESENT":"NONE EXISTENT"),1),(0,i.eW)(),r.selectedScanData.issue_present?(0,i.Q3)("",!0):((0,i.uX)(),(0,i.CE)("span",{key:0,onClick:e[2]||(e[2]=t=>r.setPriorityModal=!0),class:"failed",style:{"text-decoration":"underline","margin-left":"2rem",cursor:"pointer"}},"Report Issues"))]),r.selectedScanData.issue_present?((0,i.uX)(),(0,i.CE)("h3",on,[(0,i.eW)("Issues Priority "),(0,i.Lk)("span",nn,(0,o.v_)(r.selectedScanData.issue_priority),1)])):(0,i.Q3)("",!0),r.selectedScanData.issue_present?((0,i.uX)(),(0,i.CE)("h3",rn,[(0,i.eW)("Issues Description "),(0,i.Lk)("span",ln,(0,o.v_)(r.selectedScanData.issue_details),1)])):(0,i.Q3)("",!0),"all"!=r.selectedScanData.model_name?((0,i.uX)(),(0,i.CE)("h3",dn,[(0,i.eW)(" Scan Result Summary: "),(0,i.Lk)("span",cn,(0,o.v_)(r.selectedScanData.model_result_summary),1)])):(0,i.Q3)("",!0),"all"==r.selectedScanData.model_name?((0,i.uX)(),(0,i.CE)("h3",un,"Detailed Scan Result Summary: ")):(0,i.Q3)("",!0),"all"==r.selectedScanData.model_name?((0,i.uX)(),(0,i.CE)("div",hn,[(0,i.Lk)("table",pn,[vn,(0,i.Lk)("tbody",null,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(Object.keys(JSON.parse(r.selectedScanData.results)),(t=>((0,i.uX)(),(0,i.CE)("tr",{key:t,style:{}},["predicted_class"!==t&&"confidence"!==t?((0,i.uX)(),(0,i.CE)(i.FK,{key:0},[(0,i.Lk)("td",null,(0,o.v_)(t),1),(0,i.Lk)("td",null,(0,o.v_)(JSON.parse(r.selectedScanData.results)[t]["predicted_class"]),1),(0,i.Lk)("td",null,(0,o.v_)(parseFloat(JSON.parse(r.selectedScanData.results)[t]["confidence"]).toFixed(2))+"%",1)],64)):(0,i.Q3)("",!0)])))),128))])])])):(0,i.Q3)("",!0),mn,(0,i.Lk)("span",fn,(0,o.v_)(r.selectedScanData.vitals_data),1),r.selectedScanData.gemini_recommendation?((0,i.uX)(),(0,i.CE)("h3",gn,[bn,(0,i.eW)(),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(r.selectedScanData.gemini_recommendation.split("\n"),(t=>((0,i.uX)(),(0,i.CE)("span",{style:{"font-weight":"400",color:"var(--info-dark)",padding:".2rem"},key:t},(0,o.v_)(t),1)))),128))])):(0,i.Q3)("",!0),(0,i.Lk)("span",{style:{color:"var(--secondary)","font-size":"16px",cursor:"pointer"},onClick:e[3]||(e[3]=t=>r.showImage=!0)},"Click to View Image")]),(0,i.Lk)("button",{onClick:e[4]||(e[4]=t=>l.saveAsPDF(r.selectedScanData.mother_data))},[(0,i.eW)("Download Report "),kn])])])):(0,i.Q3)("",!0),r.setPriorityModal?((0,i.uX)(),(0,i.CE)("div",yn,[(0,i.Lk)("div",_n,[(0,i.Lk)("div",Ln,[(0,i.Lk)("span",xn,[((0,i.uX)(),(0,i.CE)("svg",{onClick:e[5]||(e[5]=t=>r.setPriorityModal=!1),xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48"},Cn))])]),(0,i.Lk)("div",Sn,[(0,i.Lk)("div",Dn,[Mn,(0,i.bo)((0,i.Lk)("select",{name:"",id:"","onUpdate:modelValue":e[6]||(e[6]=t=>r.selectPriority=t)},Rn,512),[[s.u1,r.selectPriority]])])]),(0,i.Lk)("div",On,[(0,i.bo)((0,i.Lk)("textarea",{"onUpdate:modelValue":e[7]||(e[7]=t=>r.selectPriorityDescription=t),style:{width:"100%",background:"var(--light)"},name:"",id:"",cols:"30",rows:"10",placeholder:"Description"},null,512),[[s.Jo,r.selectPriorityDescription]])]),(0,i.Lk)("button",{disabled:!r.selectPriority,onClick:e[8]||(e[8]=t=>l.updatePriority(r.selectedScanData))},[(0,i.eW)("Update Priority "),Nn],8,En)])])):(0,i.Q3)("",!0),r.showImage?((0,i.uX)(),(0,i.CE)("div",Fn,[(0,i.Lk)("div",$n,[(0,i.Lk)("div",Hn,[(0,i.Lk)("span",{class:"svg-icon",onClick:e[9]||(e[9]=t=>r.showImage=!1)},[Wn,(0,i.eW)(" "),Un])]),(0,i.Lk)("div",zn,[r.selectedScanData.scan_image?((0,i.uX)(),(0,i.CE)("img",{key:0,src:r.selectedScanData.scan_image,alt:""},null,8,Bn)):((0,i.uX)(),(0,i.CE)("h3",jn,"NO IMAGE AVAILABLE"))],512)])])):(0,i.Q3)("",!0),Vn])}var Xn=a(1749),Qn=a(9148),qn={name:"mothers",components:{},data(){return{scans:[],moment:Qn,selectedScanData:null,searchQuery:"",setPriorityModal:!1,userData:null,selectPriority:"",selectPriorityDescription:"",showImage:!1}},mounted(){this.$store.state.doctor_username?this.$router.push("/doctor"):(document.title="Tamela Dashboard | Scans",this.$store.commit("currentPage","scans"),document.querySelector(".page-wrapper").style.paddingTop="70px",this.$root.loadScripts(),this.$root.showLoader=!0,this.$root.resetSideBar(),this.getUserData(),this.getScans())},methods:{async getUserData(){const t=this.$store.state.access,e={Authorization:`Bearer ${t}`};try{const t=await Ut.A.get("accounts/userdata?user=current&usercat="+this.$store.state.usercat,{headers:e});this.userData=t.data.data,console.log(this.userData),this.userData&&(this.$store.commit("setUsercat",this.userData.usercat),"doctor"==this.userData.usercat&&this.$store.commit("setUserImage",this.userData.staff_user_details.image))}catch(a){if(a.response){const t=a.response.status;401===t?await this.refreshToken(this.getUserData):(console.error(`Error ${t}: ${a.response.data.message}`),zt.oR.error(`Error ${t}: ${a.response.data.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}else a.request?(console.error("No response received:",a.request),zt.oR.error("No response received. Please try again later.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):(console.error("Error",a),zt.oR.error(`Error: ${a}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}},async updatePriority(t){const e=this.$store.state.access,a={Authorization:`Bearer ${e}`},s={uuid:t.uuid,priority:this.selectPriority,priority_description:this.selectPriorityDescription};await Ut.A.put("api/v1/scan/priority/update",s,{headers:a}).then((t=>{t.status&&(this.getScans(),this.setPriorityModal=!1,zt.oR.success("Priority Updated",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))})).catch((t=>{}))},async refreshToken(t){await Ut.A.post("api/token/refresh",{refresh:this.$store.state.refresh}).then((e=>{e.data.access&&(this.$store.commit("setAccess",e.data.access),Ut.A.defaults.headers.common["Authorization"]="Bearer "+e.data.access,t())})).catch((t=>{}))},isMatch(t){const e=this.searchQuery.toLowerCase();return t.mother_data.tamelaID.includes(this.searchQuery.toUpperCase())||t.scanID.includes(this.searchQuery.toUpperCase())||t.mother_data.lastname.toLowerCase().includes(e)||t.mother_data.firstname.toLowerCase().includes(e)||t.mother_data.othername.toLowerCase().includes(e)||t.foetus_label.toLowerCase().includes(e)},async getScans(t=null){const e=this.$store.state.access,a={Authorization:`Bearer ${e}`};if(!t)try{const t=await Ut.A.get("api/v1/scan",{headers:a});this.scans=t.data.data,this.$root.showLoader=!1}catch(s){if(s.response){const t=s.response.status;401===t?await this.refreshToken(this.getScans):(console.error(`Error ${t}: ${s.response.data.message}`),zt.oR.error(`Error ${t}: ${s.response.data.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}else s.request?(console.error("No response received:",s.request),zt.oR.error("No response received. Please try again later.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):"ERR_NETWORK"===s.code?(console.error("Network error:",s),zt.oR.error("Unable to connect. Check your network connection.",{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT})):(console.error("Error",s),zt.oR.error(`Error: ${s.message}`,{autoClose:3e3,position:zt.oR.POSITION.TOP_RIGHT}))}},saveAsPDF(t){let e=document.querySelector("#scanReport").offsetWidth,a=document.querySelector("#scanReport").offsetHeight,s=15,i=e+2*s,o=1.5*i+2*s,n=e,r=a,l=Math.ceil(a/o)-1;html2canvas(document.querySelector("#scanReport")).then((function(e){let d=e.toDataURL("image/jpeg",1),c=new Xn.Ay("p","pt",[i,o]);c.addImage(d,"JPG",s,s,n,r);for(let t=1;t<=l;t++){c.addPage(i,o),c.addImage(d,"JPG",s,-o*t+4*s,n,r);let e=document.querySelector("#scanReport").innerHTML;c.text(20,a+20,e)}const u=`${t.lastname}_${t.firstname}_${t.tamelaID}_SCAN`;c.save(`${u}.pdf`)}))}}};const Gn=(0,Qt.A)(qn,[["render",Yn],["__scopeId","data-v-53f0329a"]]);var Jn=Gn;const Kn=t=>((0,i.Qi)("data-v-55a295bc"),t=t(),(0,i.jt)(),t),Zn={class:"content"},tr={class:"row"},er={class:"col-lg-6 wideTable"},ar={class:"card-box"},sr={class:"card-block"},ir={key:0,class:"card-title"},or={key:1,class:"card-title"},nr={key:2,class:"card-title"},rr=Kn((()=>(0,i.Lk)("button",{class:"add-scan",style:{display:"none"}},"Upload Scan",-1))),lr={class:"table-responsive"},dr={key:0},cr={class:"table mb-0"},ur=Kn((()=>(0,i.Lk)("thead",null,[(0,i.Lk)("tr",null,[(0,i.Lk)("th",null,"Scan ID"),(0,i.Lk)("th",null,"Date Added"),(0,i.Lk)("th")])],-1))),hr={key:0},pr=["id"],vr=["onClick"],mr=["onClick"],fr={key:1,class:"pagination"},gr={key:0},br={key:0},kr={key:1,style:{cursor:"default"}},yr=["onClick"],_r={key:2},Lr=["disabled"],xr={key:3,style:{cursor:"default"}},wr=["disabled"],Cr={key:0,class:"content-modal",style:{left:"0","z-index":"99999"}},Sr={class:"modal-content"},Dr={class:"close-button"},Mr={class:"svg-icon"},Ar=Kn((()=>(0,i.Lk)("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z"},null,-1))),Ir=[Ar],Tr={class:"report"},Pr={class:"left"},Rr=["src"],Or={key:0,class:"right",style:{overflow:"auto !important"}},Er={class:"item"},Nr=Kn((()=>(0,i.Lk)("label",null,"Orientation",-1))),Fr=(0,i.Fv)('',6),$r=[Fr],Hr={class:"item"},Wr=Kn((()=>(0,i.Lk)("label",null,"Presentation",-1))),Ur=(0,i.Fv)('',5),zr=[Ur],Br={class:"item"},jr=Kn((()=>(0,i.Lk)("label",null,"Fetal Planes",-1))),Vr=(0,i.Fv)('',7),Yr=[Vr],Xr={class:"item"},Qr=Kn((()=>(0,i.Lk)("label",null,"Liquor Volume",-1))),qr=(0,i.Fv)('',5),Gr=[qr],Jr={class:"item"},Kr=Kn((()=>(0,i.Lk)("label",null,"Placenta Location",-1))),Zr=(0,i.Fv)('',13),tl=[Zr],el={style:{"margin-top":"1rem"}},al=Kn((()=>(0,i.Lk)("label",{for:"",style:{"font-size":"16px"}},"Was an abnormality found?",-1))),sl={key:0,style:{"margin-top":".5rem"},class:"abnormality-bar"},il=Kn((()=>(0,i.Lk)("option",{value:""},"Select Abnormality Severity",-1))),ol=Kn((()=>(0,i.Lk)("option",{value:"high"},"High",-1))),nl=Kn((()=>(0,i.Lk)("option",{value:"medium"},"Medium",-1))),rl=Kn((()=>(0,i.Lk)("option",{value:"low"},"Low",-1))),ll=[il,ol,nl,rl],dl=Kn((()=>(0,i.Lk)("i",{class:"fa fa-send-o"},null,-1))),cl={key:1,class:"right",style:{overflow:"auto !important"}},ul={class:"item"},hl=Kn((()=>(0,i.Lk)("label",null,"Baseline FHR",-1))),pl=(0,i.Fv)('',5),vl=[pl],ml={class:"item"},fl=Kn((()=>(0,i.Lk)("label",null,"Baseline Variability",-1))),gl=(0,i.Fv)('',5),bl=[gl],kl={class:"item"},yl=Kn((()=>(0,i.Lk)("label",null,"Acceleration",-1))),_l=(0,i.Fv)('',5),Ll=[_l],xl={class:"item"},wl=Kn((()=>(0,i.Lk)("label",null,"Deceleration Early Late Variable",-1))),Cl=(0,i.Fv)('',5),Sl=[Cl],Dl={class:"item"},Ml=Kn((()=>(0,i.Lk)("label",null,"Contraction",-1))),Al=(0,i.Fv)('',5),Il=[Al],Tl={style:{"margin-top":"1rem"}},Pl=Kn((()=>(0,i.Lk)("label",{for:"",style:{"font-size":"16px"}},"Was an abnormality found?",-1))),Rl={key:0,style:{"margin-top":".5rem"},class:"abnormality-bar"},Ol=Kn((()=>(0,i.Lk)("option",{value:""},"Select Abnormality Severity",-1))),El=Kn((()=>(0,i.Lk)("option",{value:"high"},"High",-1))),Nl=Kn((()=>(0,i.Lk)("option",{value:"medium"},"Medium",-1))),Fl=Kn((()=>(0,i.Lk)("option",{value:"low"},"Low",-1))),$l=[Ol,El,Nl,Fl],Hl=Kn((()=>(0,i.Lk)("i",{class:"fa fa-send-o"},null,-1))),Wl=(0,i.Fv)('',1);function Ul(t,e,a,n,r,l){return(0,i.uX)(),(0,i.CE)("main",null,[(0,i.Lk)("div",Zn,[(0,i.Lk)("div",tr,[(0,i.Lk)("div",er,[(0,i.Lk)("div",ar,[(0,i.Lk)("div",sr,[t.$store.state.userdata&&"radiologist"===t.$store.state.userdata.role?((0,i.uX)(),(0,i.CE)("h4",ir,"Pending Ultrasound Results")):t.$store.state.userdata&&"obstetrcian"===t.$store.state.userdata.role?((0,i.uX)(),(0,i.CE)("h4",or,"Pending CTG Results")):((0,i.uX)(),(0,i.CE)("h4",nr,"Pending Results")),rr,(0,i.Lk)("div",lr,[r.scans&&r.scans.pagination?((0,i.uX)(),(0,i.CE)("h3",dr,"Page "+(0,o.v_)(r.scans.pagination.current_page)+" of "+(0,o.v_)(r.scans.pagination.total_pages),1)):(0,i.Q3)("",!0),(0,i.Lk)("table",cr,[ur,r.scans&&r.scans.data&&r.scans.data.length>=1?((0,i.uX)(),(0,i.CE)("tbody",hr,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(r.scans.data,((t,e)=>((0,i.uX)(),(0,i.CE)("tr",{key:e,id:`SCAN${t.uuid}`},[(0,i.Lk)("td",{onClick:e=>r.selectedScanData=t},"Image_"+(0,o.v_)(t.image_name.split("_")[0]),9,vr),(0,i.Lk)("td",null,[(0,i.Lk)("button",{onClick:e=>r.selectedScanData=t,style:{"background-color":"var(--primary)",color:"var(--white)",padding:".5rem 1rem",border:"none","border-radius":"var(--border-radius-1)"}},"Set Result",8,mr)])],8,pr)))),128))])):(0,i.Q3)("",!0)]),r.scans?((0,i.uX)(),(0,i.CE)("div",fr,[r.scans.pagination?((0,i.uX)(),(0,i.CE)("ul",gr,[r.scans.pagination.current_page>1?((0,i.uX)(),(0,i.CE)("li",br,[(0,i.Lk)("i",{class:(0,o.C4)(["fas fa-chevron-left",{disabled:r.scans.pagination.current_page<=1}]),onClick:e[0]||(e[0]=t=>l.getScans(r.scans.pagination.current_page-1))},null,2)])):((0,i.uX)(),(0,i.CE)("li",kr,[(0,i.Lk)("i",{class:(0,o.C4)(["fas fa-chevron-left",{disabled:r.scans.pagination.current_page<=1}])},null,2)])),((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(r.scans.pagination.total_pages,((t,e)=>((0,i.uX)(),(0,i.CE)("li",{key:t,class:(0,o.C4)({active:r.scans.pagination.current_page==t}),onClick:e=>l.getScans(t)},[(0,i.Lk)("span",null,(0,o.v_)(t),1)],10,yr)))),128)),r.scans.pagination.current_pageMothers Scan Data
Patients Admitted