mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-24 17:02:55 +08:00
5 lines
11 KiB
JavaScript
5 lines
11 KiB
JavaScript
import{_ as ae,y as oe,D as ne,u as re,m as ie,L as y}from"./shipment-53265c2d.js";import{f as le,G as de,c as ce,w as C,d,v as w,aj as ue,h as c,k as m,x as e,u as s,j as pe,A as R,al as k,y as v,ag as i,B as _,s as me,D as o,F as j,ak as ve,_ as ye}from"./_plugin-vue_export-helper-dacf3d65.js";import{u as xe}from"./samples-ba5194ed.js";import{b as l}from"./runtime-dom.esm-bundler-98433118.js";const he={class:"flex justify-between"},_e=e("h3",{class:"my-4 font-bold"},"Sample Detail",-1),fe=e("hr",null,null,-1),be={class:"bg-white rounded-sm shadow-sm hover:shadow-lg duration-500 px-4 sm:px-6 md:px-2 py-4"},ge={key:0,class:"py-4 text-center"},we={key:1,class:"grid grid-cols-12 gap-3"},ke={class:"col-span-12 px-3 sm:px-0"},Se={class:"mb-2 flex justify-between sm:text-sm md:text-md lg:text-lg text-gray-700 font-bold"},Ce=e("i",{class:"fa fa-star"},null,-1),Re=[Ce],je={key:1},Le={type:"button",class:"bg-sky-800 text-white px-2 py-1 rounded-sm leading-none"},De={class:"ml-2"},Pe={class:"absolute mt-4 py-0 bg-gray-300 rounded-sm shadow-xl z-20"},$e=e("hr",null,null,-1),Ie={class:"grid grid-cols-3 gap-x-4 mt-2"},Oe={class:"col-span-1"},Te={class:"flex justify-between"},qe=e("span",{class:"text-gray-800 text-sm font-semibold"},"Client Request ID:",-1),Be={class:"text-gray-600 text-sm md:text-md"},Ue={class:"flex justify-between"},Ve=e("span",{class:"text-gray-800 text-sm font-semibold"},"Client:",-1),Ae={class:"text-gray-600 text-sm md:text-md"},Ne=e("div",{class:"flex justify-between"},[e("span",{class:"text-gray-800 text-sm font-semibold"},"Cliet Contact:"),e("span",{class:"text-gray-600 text-sm md:text-md"},"Sister in Charge")],-1),Ee={class:"col-span-1"},ze={class:"flex justify-between"},Fe=e("span",{class:"text-gray-800 text-sm font-semibold"},"Sample Type:",-1),Je={class:"text-gray-600 text-sm md:text-md"},We={class:"flex justify-between"},Ge=e("span",{class:"text-gray-800 text-sm font-semibold"},"Date Sampled:",-1),Me={class:"text-gray-600 text-sm md:text-md"},He={class:"flex justify-between"},Ke=e("span",{class:"text-gray-800 text-sm font-semibold"},"Date Registered:",-1),Qe={class:"text-gray-600 text-sm md:text-md"},Xe={class:"flex justify-between"},Ye=e("span",{class:"text-gray-800 text-sm font-semibold"},"Date Received:",-1),Ze={class:"text-gray-600 text-sm md:text-md"},et={class:"col-span-1"},tt={class:"flex justify-between"},st=e("span",{class:"text-gray-800 text-sm font-semibold"},"Date Submitted:",-1),at={class:"text-gray-600 text-sm md:text-md"},ot={class:"flex justify-between"},nt=e("span",{class:"text-gray-800 text-sm font-semibold"},"Date Verified:",-1),rt={class:"text-gray-600 text-sm md:text-md"},it={class:"flex justify-between"},lt=e("span",{class:"text-gray-800 text-sm font-semibold"},"Date Published:",-1),dt={class:"text-gray-600 text-sm md:text-md"},ct={class:"flex justify-between"},ut=e("span",{class:"text-gray-800 text-sm font-semibold"},"Date Printed:",-1),pt={class:"text-gray-600 text-sm md:text-md"},mt={class:"bg-blue-300 rounded-sm shadow-md duration-500 px-4 sm:px-6 md:px-2 py-4 my-4"},vt={class:"flex"},yt=e("div",{class:"mr-4 font-semibold"},"Storage:",-1),xt={class:"bg-orange-600 rounded-sm shadow-md duration-500 px-4 sm:px-6 md:px-2 py-4 my-4"},ht=le({__name:"index",setup(_t){const L=de(()=>ae(()=>import("./LoadingMessage-097e117a.js"),["assets/LoadingMessage-097e117a.js","assets/_plugin-vue_export-helper-dacf3d65.js"])),u=oe(),f=ne(),S=re();u.resetSample();const{cancelSamples:D,reInstateSamples:P,receiveSamples:$,invalidateSamples:I,publishSamples:O,verifySamples:T,recoverSamples:q}=xe(),h=ce({dropdownOpen:!1}),{sample:t,fetchingSample:B,repeatSample:b}=ie(u);u.fetchSampleByUid(f.params.sampleUid),C(()=>t?.value?.status,(n,a)=>{if(n)if(n!=="invalidated"){u.resetRepeatSample();return}else u.fetchRepeatSampleByParentId(f.params.sampleUid)}),C(()=>f.params.sampleUid,(n,a)=>{u.fetchSampleByUid(+n)});function U(n,a){let p=[];return n?.forEach(x=>p.push(x.name)),a?.forEach(x=>p.push(x.name)),p.join(", ")}const V=d(()=>!!["expected"].includes(t?.value?.status?.toLowerCase())),A=async()=>$([t?.value?.uid]),N=d(()=>!!["received","expected"].includes(t?.value?.status?.toLowerCase())),E=async()=>D([t?.value?.uid]),z=d(()=>!!["cancelled"].includes(t?.value?.status?.toLowerCase())),F=async()=>P([t?.value?.uid]),J=d(()=>t?.value?.status?.toLowerCase()==="awaiting"),W=async()=>T([t?.value?.uid]),G=d(()=>t?.value?.status?.toLowerCase()==="published"),g=d(()=>["approved"].includes(t?.value?.status?.toLowerCase())?"Publish":["published"].includes(t?.value?.status?.toLowerCase())?"Re publish":"Pre publish"),M=d(()=>{if(["awaiting","approved","published"].includes(t?.value?.status?.toLowerCase()))return!0;const n=u.analysisResults;return!!(["received","paired"].includes(t?.value?.status?.toLowerCase()??"")&&n?.some(a=>["approved"].includes(a.status?.toLowerCase()??"")))}),H=async()=>{const n=g.value.startsWith("Pre")?"pre-publish":g.value.startsWith("Re")?"re-publish":"publish";O([{uid:t?.value?.uid,action:n}])},K=async()=>I([t?.value?.uid]).then(n=>{let a=n?.filter(p=>p.uid!==t?.value?.uid);a.length>0&&u.setRepeatSample(a[0])}),Q=d(()=>!!["received","expected"].includes(t?.value?.status?.toLowerCase())),X=async()=>S.push({name:"reject-samples",params:{samples:JSON.stringify([t?.value])}}),Y=d(()=>!!["stored"].includes(t?.value?.status?.toLowerCase())),Z=async()=>q([t?.value?.uid]),ee=async n=>{S.push({path:"/bio-banking",state:{sample:JSON.stringify(n)}})};return(n,a)=>{const p=w("router-link"),x=w("font-awesome-icon"),te=w("router-view"),se=ue("motion-slide-right");return c(),m(j,null,[e("div",he,[_e,s(t)?.analysisRequest?.patient?.uid?(c(),pe(p,{key:0,to:{name:"patient-detail",params:{patientUid:s(t)?.analysisRequest?.patient?.uid}},class:"p-2 my-2 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"},{default:R(()=>[k(" ... other samples ")]),_:1},8,["to"])):v("v-if",!0)]),fe,i((c(),m("div",be,[s(B)?(c(),m("div",ge,[_(s(L),{message:"Fetching sample details ..."})])):(c(),m("div",we,[v(" Summary Column "),e("div",ke,[e("div",Se,[e("div",null,[s(t)?.priority??0<1?(c(),m("span",{key:0,class:me(["font-small",{"text-orange-600":s(t)?.priority??0<1}])},Re,2)):v("v-if",!0),k(" "+o(s(t)?.sampleId)+" ",1),v(` <button\r
|
||
class="ml-4 text-xs inline-flex items-center justify-center w-6 h-6 mr-2 border-sky-800 border text-gray-900 transition-colors duration-150 bg-white rounded-full focus:outline-none hover:bg-gray-200"\r
|
||
>\r
|
||
<i class="fa fa-pen"></i>\r
|
||
</button> `),s(t)?.analysisRequest?.patient?.uid&&s(b)?.uid?(c(),m("span",je,[_(x,{icon:"angle-double-right",class:"mx-2"}),_(p,{to:{name:"sample-detail",params:{patientUid:s(t)?.analysisRequest?.patient?.uid,sampleUid:s(b)?.uid}},class:"p-2 my-2 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"},{default:R(()=>[k(o(s(b)?.sampleId),1)]),_:1},8,["to"])])):v("v-if",!0)]),e("span",null,o(U(s(t)?.profiles,s(t)?.analyses)),1),v(' <button type="button" class="bg-sky-800 text-white p-1rounded-smleading-none">{{ sample?.status }}</button> '),e("div",null,[e("div",{onClick:a[0]||(a[0]=r=>h.dropdownOpen=!h.dropdownOpen),class:"hidden md:block md:flex md:items-center ml-2 mt-2"},[e("button",Le,o(s(t)?.status),1),e("div",De,[_(x,{icon:"chevron-down",class:"text-gray-400"})])]),i(e("div",{onClick:a[1]||(a[1]=r=>h.dropdownOpen=!1),class:"fixed inset-0 h-full w-full z-10"},null,512),[[l,h.dropdownOpen]]),i(e("div",Pe,[i(e("div",{onClick:a[2]||(a[2]=r=>A()),class:"no-underline text-gray-900 py-0 opacity-60 px-4 border-b border-transparent hover:opacity-100 md:hover:border-grey-dark hover:bg-sky-800 hover:text-white"}," Receive ",512),[[l,s(V)]]),i(e("div",{onClick:a[3]||(a[3]=r=>W()),class:"no-underline text-gray-900 py-0 opacity-60 px-4 border-b border-transparent hover:opacity-100 md:hover:border-grey-dark hover:bg-sky-800 hover:text-white"}," Approve ",512),[[l,s(J)]]),i(e("div",{onClick:a[4]||(a[4]=r=>X()),class:"no-underline text-gray-900 py-0 opacity-60 px-4 border-b border-transparent hover:opacity-100 md:hover:border-grey-dark hover:bg-orange-600 hover:text-white"}," Reject ",512),[[l,s(Q)]]),i(e("div",{onClick:a[5]||(a[5]=r=>E()),class:"no-underline text-gray-900 py-0 opacity-60 px-4 border-b border-transparent hover:opacity-100 md:hover:border-grey-dark hover:bg-orange-600 hover:text-white"}," Cancel ",512),[[l,s(N)]]),i(e("div",{onClick:a[6]||(a[6]=r=>F()),class:"no-underline text-gray-900 py-0 opacity-60 px-4 border-b border-transparent hover:opacity-100 md:hover:border-grey-dark hover:bg-orange-600 hover:text-white"}," Reinstate ",512),[[l,s(z)]]),i(e("div",{onClick:a[7]||(a[7]=r=>H()),class:"no-underline text-gray-900 py-0 opacity-60 px-4 border-b border-transparent hover:opacity-100 md:hover:border-grey-dark hover:bg-gray-400 hover:text-white"},o(s(g)),513),[[l,s(M)]]),i(e("div",{onClick:a[8]||(a[8]=r=>K()),class:"no-underline text-gray-900 py-0 opacity-60 px-4 border-b border-transparent hover:opacity-100 md:hover:border-grey-dark hover:bg-gray-400 hover:text-white"}," Invalidate ",512),[[l,s(G)]]),i(e("div",{onClick:a[9]||(a[9]=r=>Z()),class:"no-underline text-gray-900 py-0 opacity-60 px-4 border-b border-transparent hover:opacity-100 md:hover:border-grey-dark hover:bg-gray-400 hover:text-white"}," Recover ",512),[[l,s(Y)]])],512),[[l,h.dropdownOpen]])])]),$e,e("div",Ie,[e("div",Oe,[e("div",Te,[qe,e("span",Be,o(s(t)?.analysisRequest?.clientRequestId),1)]),e("div",Ue,[Ve,e("span",Ae,o(s(t)?.analysisRequest?.client?.name),1)]),Ne]),e("div",Ee,[e("div",ze,[Fe,e("span",Je,o(s(t)?.sampleType?.name),1)]),e("div",We,[Ge,e("span",Me,o(s(y)(s(t)?.dateCollected,!0)),1)]),e("div",He,[Ke,e("span",Qe,o(s(y)(s(t)?.createdAt,!0)),1)]),e("div",Xe,[Ye,e("span",Ze,o(s(y)(s(t)?.dateReceived,!0)),1)])]),e("div",et,[e("div",tt,[st,e("span",at,o(s(y)(s(t)?.dateSubmitted,!0)),1)]),e("div",ot,[nt,e("span",rt,o(s(y)(s(t)?.dateVerified,!0)),1)]),e("div",it,[lt,e("span",dt,o(s(y)(s(t)?.datePublished,!0)),1)]),e("div",ct,[ut,e("span",pt,o(s(y)(s(t)?.datePrinted,!0)),1)])])])])]))])),[[se]]),i(e("div",mt,[e("div",vt,[yt,v(" "),e("div",{class:"hover:underline hover:cursor-pointer",onClick:a[10]||(a[10]=r=>ee(s(t)))},[e("span",null,o(s(t)?.storageContainer?.storageSection?.storageLocation?.storeRoom?.name)+" › ",1),e("span",null,o(s(t)?.storageContainer?.storageSection?.storageLocation?.name)+" › ",1),e("span",null,o(s(t)?.storageContainer?.storageSection?.name)+" › ",1),e("span",null,o(s(t)?.storageContainer?.name)+" › ",1),e("span",null,o(s(t)?.storageSlot),1)])])],512),[[l,s(t)?.status==="stored"]]),i(e("div",xt,[v(' <h3 clas="font-bold text-gray-800 text-md">This sample was rejected because of the following reason(s):</h3> '),e("ul",null,[(c(!0),m(j,null,ve(s(t)?.rejectionReasons,r=>(c(),m("li",{key:r.uid},o(r.reason),1))),128))])],512),[[l,s(t)?.status==="rejected"]]),_(te)],64)}}}),kt=ye(ht,[["__file","/home/aurthurm/Development/felicity-lims/webapp/views/sample/_id/index.vue"]]);export{kt as default};
|