felicity-lims/felicity/templates/static/assets/PatientsCompact-8fdf82cf.js
2024-11-01 08:48:45 +02:00

1 line
6.4 KiB
JavaScript

import{d as se,A as oe,B as ae,s as ne,r as b,C as ie,D as re,z as le,n as ce,o,c as u,g as v,f as e,b as t,e as h,E as I,G as x,H as de,w as ue,F as P,p as A,i as k,q as y,x as m,j as i,I as _e,J as pe,y as R,t as _,_ as r,k as me}from"./index-e48f6898.js";import{h as D,o as V,a as L}from"./constants-8900c62d.js";const w=g=>(_e("data-v-81af20fc"),g=g(),pe(),g),fe={class:""},ve={class:"flex justify-between"},ye={class:"flex items-center content-between"},ge=w(()=>t("hr",null,null,-1)),he={class:"grid grid-cols-12 gap-4 mt-2"},be={initial:{opacity:0,y:100},enter:{opacity:1,y:0,scale:1},variants:{custom:{scale:2}},delay:400,class:"col-span-3 h-screen overflow-y-scroll overscroll-contain patient-scroll"},xe={key:0,class:"py-4 text-center bg-white w-full mb-1 rounded-sm shadow border"},Pe={key:1},ke=["onClick"],we={class:"flex-grow p-1"},Ee={class:"font-semibold text-gray-800 flex justify-between"},Ce={class:"text-sm text-gray-500"},Te={class:"text-sm text-gray-500 flex justify-between"},Ie={class:"text-sm text-gray-500 flex justify-between"},Ae=w(()=>t("div",{class:"p-2"},null,-1)),Re={key:0,initial:{opacity:0,y:-100},enter:{opacity:1,y:0,scale:1},variants:{custom:{scale:2}},delay:400,class:"col-span-9"},De={class:"bg-white shadow-md mt-2"},Ve={class:"-mb-px flex justify-start"},Le=["onClick"],Se=w(()=>t("h3",null,"Patient Form",-1)),Ne=se({__name:"PatientsCompact",setup(g){const S=i(()=>r(()=>import("./FelLoadingMessage-df6010ac.js"),["assets/FelLoadingMessage-df6010ac.js","assets/index-e48f6898.js","assets/index-7d22ceed.css"])),N=i(()=>r(()=>import("./FelPageHeading-3f642b26.js"),["assets/FelPageHeading-3f642b26.js","assets/index-e48f6898.js","assets/index-7d22ceed.css"])),O=i(()=>r(()=>import("./FelAnalyisRequestListing-1a5aeadc.js"),["assets/FelAnalyisRequestListing-1a5aeadc.js","assets/index-e48f6898.js","assets/index-7d22ceed.css"])),F=i(()=>r(()=>import("./CaseTable-9427c1b4.js"),["assets/CaseTable-9427c1b4.js","assets/index-e48f6898.js","assets/index-7d22ceed.css"])),j=i(()=>r(()=>import("./FelAuditLog-8f8fceed.js"),["assets/FelAuditLog-8f8fceed.js","assets/index-e48f6898.js","assets/index-7d22ceed.css"])),B=i(()=>r(()=>import("./FelModal-3c028bd6.js"),["assets/FelModal-3c028bd6.js","assets/index-e48f6898.js","assets/index-7d22ceed.css","assets/FelModal-a7d23795.css"])),U=i(()=>r(()=>import("./PatientForm-f27a5d7f.js"),["assets/PatientForm-f27a5d7f.js","assets/index-e48f6898.js","assets/index-7d22ceed.css","assets/vue-multiselect.esm-751dd29b.js","assets/patient.mutations-fdfdbeae.js","assets/array-fa1b54a8.js","assets/vue-multiselect-a538cd7c.css"])),M=i(()=>r(()=>import("./PatientInfo-35f1272c.js"),["assets/PatientInfo-35f1272c.js","assets/index-e48f6898.js","assets/index-7d22ceed.css","assets/constants-8900c62d.js"])),$=i(()=>r(()=>import("./PatientBill-26035372.js"),["assets/PatientBill-26035372.js","assets/index-e48f6898.js","assets/index-7d22ceed.css","assets/billing.mutations-e51f55df.js","assets/array-fa1b54a8.js","assets/PatientBill-7bdbff76.css"]));let f=oe(),G=ae();const{patients:q,fetchingPatients:z}=ne(f);let n=b(!1),l=b("samples");const H=["samples","cases","billing","logs"];let c=b({}),p=ie({first:25,before:"",text:"",sortBy:["-uid"],filterAction:!1});const Q=["Male","Female","Missing","Trans Gender"];G.fetchCountries(),f.fetchPatients(p);function J(a){p.first=100,p.before="",p.text=a.target.value,p.filterAction=!0,f.fetchPatients(p)}const K=re(()=>Object.keys(c?.value)?.length>0);let W=a=>a.firstName+" "+a.lastName,X=a=>Q[a],E=a=>{c.value=a,f.setPatient(a)},C=()=>{c.value={},f.resetPatient()};const Y=async()=>{C(),n.value=!0},Z=a=>{E(a),n.value=!1};return(a,d)=>{const ee=le("router-link"),T=ce("motion");return o(),u(P,null,[v(e(N),{title:"Patients Quick View"}),t("div",fe,[t("div",ve,[t("div",ye,[h(v(ee,{to:"/patients/search",class:"px-4 my-2 p-1 text-sm border-sky-800 border text-dark-800 transition-colors duration-150 rounded-sm focus:outline-none hover:bg-sky-800 hover:text-gray-100"},{default:x(()=>[de(" Add Patient")]),_:1},512),[[I,D(L.CREATE,V.PATIENT)]]),t("input",{class:"w-64 ml-6 pl-4 pr-2 py-1 text-sm text-gray-800 placeholder-gray-400 border-1 border-gray-400 rounded-sm focus:placeholder-gray-500 focus:border-sky-800 focus:outline-none focus:shadow-outline-purple form-input",type:"text",placeholder:"Search ...","aria-label":"Search",onKeyup:d[0]||(d[0]=s=>J(s)),onFocus:d[1]||(d[1]=s=>e(C)())},null,32)]),h(t("button",{onClick:ue(Y,["prevent"]),class:"px-4 my-2 p-1 text-sm border-sky-800 border text-dark-700 transition-colors duration-150 rounded-sm focus:outline-none hover:bg-sky-800 hover:text-gray-100"}," Quick Registration ",512),[[I,D(L.CREATE,V.PATIENT)]])]),ge,t("div",he,[h((o(),u("section",be,[e(z)?(o(),u("div",xe,[v(e(S),{message:"Fetching patients ..."})])):(o(),u("div",Pe,[(o(!0),u(P,null,A(e(q),s=>(o(),u("a",{key:s.patientId,onClick:te=>e(E)(s),class:R(["bg-white w-full flex items-center p-1 mb-1 rounded-sm shadow border",{"border-sky-800 bg-emerald-200":s.uid===e(c)?.uid}])},[t("div",we,[t("div",Ee,[t("span",null,_(e(W)(s)),1),t("span",Ce,_(s.age)+" yrs, "+_(e(X)(s.gender)),1)]),t("div",Te,[t("span",null,_(s.patientId),1),t("span",null,_(s.clientPatientId),1)]),t("div",Ie,[t("span",null,_(s?.client?.district?.province?.name),1),t("span",null,_(s?.client?.name),1)])]),Ae],10,ke))),128))]))])),[[T]]),K.value?h((o(),u("section",Re,[v(e(M),{onEditPatient:d[2]||(d[2]=()=>k(n)?n.value=!0:n=!0)}),t("nav",De,[t("div",Ve,[(o(),u(P,null,A(H,s=>t("a",{key:s,class:R(["no-underline text-gray-500 uppercase tracking-wide font-bold text-xs py-1 px-4 tab hover:bg-sky-600 hover:text-gray-200 hover:bg-sky-600 hover:text-gray-200",{"tab-active":e(l)===s}]),onClick:te=>k(l)?l.value=s:l=s},_(s),11,Le)),64))])]),e(l)==="samples"?(o(),y(e(O),{key:0,target:"patient-samples",targetUid:e(c).uid},null,8,["targetUid"])):m("",!0),e(l)==="cases"?(o(),y(e(F),{key:1})):m("",!0),e(l)==="billing"?(o(),y(e($),{key:2,patientUid:e(c)?.uid},null,8,["patientUid"])):m("",!0),e(l)==="logs"?(o(),y(e(j),{key:3,targetType:"patient",targetUid:e(c)?.uid},null,8,["targetUid"])):m("",!0)])),[[T]]):m("",!0)]),e(n)?(o(),y(e(B),{key:0,onClose:d[3]||(d[3]=s=>k(n)?n.value=!1:n=!1),contentWidth:"w-3/6"},{header:x(()=>[Se]),body:x(()=>[v(e(U),{patient:e(c),navigate:!1,onClose:Z},null,8,["patient"])]),_:1})):m("",!0)])],64)}}});const je=me(Ne,[["__scopeId","data-v-81af20fc"],["__file","/home/aurthurm/Documents/Development/felicity/felicity-lims/webapp/views/patient/PatientsCompact.vue"]]);export{je as default};