felicity-lims/felicity/templates/static/assets/PatientsCompact-3b57ea47.js
2023-11-10 18:48:39 +02:00

1 line
6.6 KiB
JavaScript

import{_ as l,p as te,q as se,m as oe}from"./shipment-53265c2d.js";import{f as ae,G as c,r as b,c as ne,d as ie,v as re,aj as le,h as a,k as d,B as v,u as e,x as t,y as n,ag as y,A as x,al as ce,F as k,ak as T,i as P,j as g,p as de,e as ue,s as A,D as u,_ as _e}from"./_plugin-vue_export-helper-dacf3d65.js";import{h as R,o as D,a as S}from"./constants-743d82a1.js";import{b as L,a as pe}from"./runtime-dom.esm-bundler-98433118.js";const w=h=>(de("data-v-81af20fc"),h=h(),ue(),h),me={class:""},fe={class:"flex justify-between"},ve={class:"flex items-center content-between"},he=["onClick"],ye=w(()=>t("hr",null,null,-1)),ge={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"},ke={key:1},Pe=["onClick"],we={class:"flex-grow p-1"},Ee={class:"font-semibold text-gray-800 flex justify-between"},Ce={class:"text-sm text-gray-500"},Ie={class:"text-sm text-gray-500 flex justify-between"},Te={class:"text-sm text-gray-500 flex justify-between"},Ae=w(()=>t("div",{class:"p-2"},[n(' <span class="block h-4 w-4 bg-sky-800 rounded-full bottom-0 right-0"></span> ')],-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"},Se={class:"-mb-px flex justify-start"},Le=["onClick"],Ve=w(()=>t("h3",null,"Patient Form",-1)),Fe=ae({__name:"PatientsCompact",setup(h){const V=c(()=>l(()=>import("./LoadingMessage-097e117a.js"),["assets/LoadingMessage-097e117a.js","assets/_plugin-vue_export-helper-dacf3d65.js"])),F=c(()=>l(()=>import("./PageHeading-f8f1dd15.js"),["assets/PageHeading-f8f1dd15.js","assets/_plugin-vue_export-helper-dacf3d65.js"])),N=c(()=>l(()=>import("./AnalyisRequestListing-255865d7.js"),["assets/AnalyisRequestListing-255865d7.js","assets/shipment-53265c2d.js","assets/_plugin-vue_export-helper-dacf3d65.js"])),j=c(()=>l(()=>import("./CaseTable-ae7da223.js"),["assets/CaseTable-ae7da223.js","assets/_plugin-vue_export-helper-dacf3d65.js"])),O=c(()=>l(()=>import("./AuditLog-2f096dcd.js"),["assets/AuditLog-2f096dcd.js","assets/shipment-53265c2d.js","assets/_plugin-vue_export-helper-dacf3d65.js"])),B=c(()=>l(()=>import("./SimpleModal-9e28c074.js"),["assets/SimpleModal-9e28c074.js","assets/_plugin-vue_export-helper-dacf3d65.js","assets/runtime-dom.esm-bundler-98433118.js","assets/SimpleModal-f645a074.css"])),M=c(()=>l(()=>import("./PatientForm-e5abf0f3.js"),["assets/PatientForm-e5abf0f3.js","assets/_plugin-vue_export-helper-dacf3d65.js","assets/vue-multiselect.esm-51069c0e.js","assets/runtime-dom.esm-bundler-98433118.js","assets/shipment-53265c2d.js","assets/patient.mutations-8de6e93f.js","assets/array-9d3d6c63.js","assets/vue-multiselect-b0b22fef.css"])),$=c(()=>l(()=>import("./PatientInfo-d5b67a4d.js"),["assets/PatientInfo-d5b67a4d.js","assets/shipment-53265c2d.js","assets/_plugin-vue_export-helper-dacf3d65.js","assets/constants-743d82a1.js","assets/runtime-dom.esm-bundler-98433118.js"]));let f=te(),G=se();const{patients:q,fetchingPatients:Q}=oe(f);let i=b(!1),_=b("samples");const U=["samples","cases","logs"];let p=b({}),m=ne({first:25,before:"",text:"",sortBy:["-uid"],filterAction:!1});const z=["Male","Female","Missing","Trans Gender"];G.fetchCountries(),f.fetchPatients(m);function H(o){m.first=100,m.before="",m.text=o.target.value,m.filterAction=!0,f.fetchPatients(m)}const K=ie(()=>Object.keys(p?.value)?.length>0);let W=o=>o.firstName+" "+o.lastName,J=o=>z[o],E=o=>{p.value=o,f.setPatient(o)},C=()=>{p.value={},f.resetPatient()};const X=async()=>{C(),i.value=!0},Y=o=>{E(o),i.value=!1};return(o,r)=>{const Z=re("router-link"),I=le("motion");return a(),d(k,null,[v(e(F),{title:"Patients Quick View"}),t("div",me,[t("div",fe,[t("div",ve,[n(' <h1 class="h1 my-4 font-bold text-dark-700">Listing</h1> '),y(v(Z,{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(()=>[ce(" Add Patient")]),_:1},512),[[L,R(S.CREATE,D.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:r[0]||(r[0]=s=>H(s)),onFocus:r[1]||(r[1]=s=>e(C)())},null,32)]),y(t("button",{onClick:pe(X,["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 ",8,he),[[L,R(S.CREATE,D.PATIENT)]])]),ye,t("div",ge,[y((a(),d("section",be,[e(Q)?(a(),d("div",xe,[v(e(V),{message:"Fetching patients ..."})])):(a(),d("div",ke,[(a(!0),d(k,null,T(e(q),s=>(a(),d("a",{key:s.patientId,href:"#",onClick:ee=>e(E)(s),class:A(["bg-white w-full flex items-center p-1 mb-1 rounded-sm shadow border",{"border-sky-800 bg-emerald-200":s.uid===e(p)?.uid}])},[t("div",we,[t("div",Ee,[t("span",null,u(e(W)(s)),1),t("span",Ce,u(s.age)+" yrs, "+u(e(J)(s.gender)),1)]),t("div",Ie,[t("span",null,u(s.patientId),1),t("span",null,u(s.clientPatientId),1)]),t("div",Te,[t("span",null,u(s?.client?.district?.province?.name),1),t("span",null,u(s?.client?.name),1)])]),Ae],10,Pe))),128))]))])),[[I]]),e(K)?y((a(),d("section",Re,[n(" PatientInfo "),v(e($),{onEditPatient:r[2]||(r[2]=()=>P(i)?i.value=!0:i=!0)}),n(" Sample and Case Data "),t("nav",De,[t("div",Se,[(a(),d(k,null,T(U,s=>t("a",{key:s,class:A(["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(_)===s}]),onClick:ee=>P(_)?_.value=s:_=s,href:"#"},u(s),11,Le)),64))])]),e(_)==="samples"?(a(),g(e(N),{key:0,target:"patient-samples",targetUid:e(p).uid},null,8,["targetUid"])):n("v-if",!0),e(_)==="cases"?(a(),g(e(j),{key:1})):n("v-if",!0),e(_)==="logs"?(a(),g(e(O),{key:2,targetType:"patient",targetId:e(p)?.uid},null,8,["targetId"])):n("v-if",!0)])),[[I]]):n("v-if",!0)]),n(" Patient Edit Form Modal "),e(i)?(a(),g(e(B),{key:0,onClose:r[3]||(r[3]=s=>P(i)?i.value=!1:i=!1),contentWidth:"w-3/6"},{header:x(()=>[Ve]),body:x(()=>[v(e(M),{patient:e(p),navigate:!1,onClose:Y},null,8,["patient"])]),_:1})):n("v-if",!0)])],64)}}});const Me=_e(Fe,[["__scopeId","data-v-81af20fc"],["__file","/home/aurthurm/Development/felicity-lims/webapp/views/patient/PatientsCompact.vue"]]);export{Me as default};