@photonhealth/elements 0.0.103 → 0.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.mjs +15 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4079,4 +4079,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
4079
4079
|
|
|
4080
4080
|
<slot part="label" class="radio__label"></slot>
|
|
4081
4081
|
</span>
|
|
4082
|
-
`}};Pr.styles=Zue;x([Dr()],Pr.prototype,"checked",2);x([Dr()],Pr.prototype,"hasFocus",2);x([C()],Pr.prototype,"value",2);x([C({reflect:!0})],Pr.prototype,"size",2);x([C({type:Boolean,reflect:!0})],Pr.prototype,"disabled",2);x([et("checked")],Pr.prototype,"handleCheckedChange",1);x([et("disabled",{waitUntilFirstUpdate:!0})],Pr.prototype,"handleDisabledChange",1);Pr=x([cn("sl-radio")],Pr);const ede=T('<div><style></style><photon-card><div class="flex items-center gap-2"><p class="font-sans flex-grow text-gray-600 text-sm"><slot></slot></p><input type="radio"></div></photon-card></div>',13);At("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");De("photon-radio-card",{selected:!1,value:""},e=>{let t;const n=()=>{const r=new CustomEvent("photon-radio-selected",{composed:!0,bubbles:!0,detail:{value:e.value}});t?.dispatchEvent(r)};return(()=>{const r=q(()=>document.importNode(ede,!0)),i=r.firstChild,o=i.nextSibling,a=o.firstChild,s=a.firstChild,c=s.firstChild,l=s.nextSibling,u=t;return typeof u=="function"?de(u,r):t=r,E(i,ct),o.addEventListener("click",()=>n()),o._$owner=P(),c._$owner=P(),K(()=>l.checked=e.selected),r})()});function tde(e){const[t,n]=Wi(Array());return Te(()=>{if(!e)return;const r=()=>{n(e()?.assignedElements()||[])};return e()?.addEventListener("slotchange",r)},[e]),t}const nde=T('<div><style></style><div class="flex flex-col gap-3"><slot></slot></div></div>',8);At("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");De("photon-radio-group",{},()=>{let e;const[t,n]=F(),r=tde(t),i=o=>{const a=new CustomEvent("photon-option-selected",{composed:!0,bubbles:!0,detail:{value:o}});e?.dispatchEvent(a)};return(()=>{const o=nde.cloneNode(!0),a=o.firstChild,s=a.nextSibling,c=s.firstChild,l=e;return typeof l=="function"?de(l,o):e=o,o.addEventListener("photon-radio-selected",u=>{u.stopImmediatePropagation(),u.stopPropagation();for(const d of r)d.value.id===u.detail.value.id||d.value===u.detail.value?d.selected=!0:d.selected=!1;i(u.detail.value)}),E(a,ct),de(u=>n(u),c),c._$owner=P(),o})()});const rde=T('<div><photon-dialog cancel-text="Back" confirm-text="Select Medication" width="min-content"><photon-med-search></photon-med-search></photon-dialog></div>',6);De("photon-med-search-dialog",{open:{value:!1,reflect:!0,notify:!1,attribute:"open",parse:!0}},e=>{const t=Et();let n;const[r,i]=F(void 0),[o,a]=F(!1),[s,c]=F(""),[l,u]=F(!1),d=()=>{const f=new CustomEvent("photon-medication-selected",{composed:!0,bubbles:!0,detail:{medication:r()}});n?.dispatchEvent(f)};return(()=>{const f=q(()=>document.importNode(rde,!0)),h=f.firstChild,p=h.firstChild,v=n;return typeof v=="function"?de(v,f):n=f,f.addEventListener("photon-form-updated",m=>{i(m.detail.medication),a(m.detail.addToCatalog),c(m.detail.catalogId)}),h.addEventListener("photon-dialog-confirmed",async()=>{u(!0),o()&&await t.getSDK().clinical.catalog.addToCatalog({})({variables:{catalogId:s(),treatmentId:r()?.id},awaitRefetchQueries:!1}),d(),u(!1),e.open=!1}),h.addEventListener("photon-dialog-canceled",()=>{e.open=!1}),h._$owner=P(),p._$owner=P(),K(m=>{const y=e.open,g=l(),b=!r();return y!==m._v$&&(h.open=m._v$=y),g!==m._v$2&&(h.loading=m._v$2=g),b!==m._v$3&&(h.disableSubmit=m._v$3=b),m},{_v$:void 0,_v$2:void 0,_v$3:void 0}),f})()});const ide=T('<div class="min-w-[125px]"></div>',2),S8=[{id:"mcg/kg",name:"mcg/kg"},{id:"mg/kg",name:"mg/kg"},{id:"g/kg",name:"g/kg"}],ode=()=>{const[e,t]=F(""),n=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});r?.dispatchEvent(o)};let r;return(()=>{const i=ide.cloneNode(!0),o=r;return typeof o=="function"?de(o,i):r=i,i.addEventListener("photon-data-selected",a=>{n(a.detail.data.name)}),E(i,U(bn,{get data(){return S8.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a?.name||"",onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return S8[1]}})),i})()},ade=T('<div class="min-w-[125px]"></div>',2),E8=[{id:"mg",name:"mg"},{id:"mcg",name:"mcg"},{id:"g",name:"g"}],sde=()=>{const[e,t]=F(""),n=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});r?.dispatchEvent(o)};let r;return(()=>{const i=ade.cloneNode(!0),o=r;return typeof o=="function"?de(o,i):r=i,i.addEventListener("photon-data-selected",a=>{n(a.detail.data.name)}),E(i,U(bn,{get data(){return E8.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a?.name||"",onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return E8[0]}})),i})()},lde=T('<div class="min-w-[125px]"></div>',2),O8=[{id:"mL",name:"mL"},{id:"L",name:"L"}],cde=()=>{const[e,t]=F(""),n=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});r?.dispatchEvent(o)};let r;return(()=>{const i=lde.cloneNode(!0),o=r;return typeof o=="function"?de(o,i):r=i,i.addEventListener("photon-data-selected",a=>{n(a.detail.data.name)}),E(i,U(bn,{get data(){return O8.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a?.name||"",onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return O8[0]}})),i})()},ude=T('<div class="min-w-[125px]"></div>',2),k8=[{id:"lbs",name:"lbs"},{id:"kgs",name:"kgs"}],dde=()=>{const[e,t]=F(""),n=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});r?.dispatchEvent(o)};let r;return(()=>{const i=ude.cloneNode(!0),o=r;return typeof o=="function"?de(o,i):r=i,i.addEventListener("photon-data-selected",a=>{n(a.detail.data.name)}),E(i,U(bn,{get data(){return k8.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a?.name||"",onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return k8[0]}})),i})()},fde=T('<div><style></style><div class="flex flex-col xs:flex-row items-start xs:items-center gap-2 pb-2"><p class="font-sans text-lg">Selected Drug: </p></div><div class="flex flex-col"><p class="font-sans pb-1">Input</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Dosage</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Weight</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><p class="font-sans pb-1">Liquid Formation</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Drug Amount</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3 flex-shrink"></photon-number-input></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Per Volume</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><p class="font-sans">Result</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-36 xs:basis-[10.5rem]">Dose</p><photon-text-input class="mb-1.5 max-w-[180px] pl-3 pr-3"></photon-text-input><photon-button class="mb-7">Use<sl-icon name="chevron-right" slot="postfix"></sl-icon></photon-button></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-36 xs:basis-[10.5rem]">Liquid Dose</p><photon-text-input class="mb-1.5 max-w-[180px] pl-3 pr-3"></photon-text-input><photon-button class="mb-7">Use<sl-icon name="chevron-right" slot="postfix"></sl-icon></photon-button></div></div></div>',60),hde=T("<p></p>",2),pde=T('<p class="text-gray-500 font-sans italic">None selected</p>',2),bh=(e,t)=>!!((t==="kgs"||t==="g")&&e.includes("kg")||(t==="lbs"||t==="oz")&&e.includes("lb")),vde=(e,t)=>e.includes("kg")&&t.unit==="oz"?t.value/16*.453592:e.includes("kg")&&t.unit==="lbs"?t.value*.453592:e.includes("lb")&&t.unit==="kgs"?t.value*2.20462:e.includes("lb")&&t.unit==="g"?t.value/1e3*2.20462:0,mde=(e,t)=>t==="mcg"&&e.split("/")[0]==="mcg"||t==="mg"&&e.split("/")[0]==="mg"||t==="g"&&e.split("/")[0]==="g",gde=(e,t)=>e.includes("mcg")&&t.unit==="mcg"?t.value/(1e3*1e3):e.includes("mcg")&&t.unit==="g"?t.value*(1e3*1e3):e.includes("mg")&&t.unit==="mcg"?t.value/1e3:e.includes("mg")&&t.unit==="g"?t.value*1e3:e.includes("g")&&t.unit==="mcg"?t.value/(1e3*1e3):e.includes("g")&&t.unit==="mg"?t.value/1e3:0,yde=(e,t)=>bh(e.unit,t.unit)&&t.unit==="g"?e.value*(t.value/1e3):bh(e.unit,t.unit)&&t.unit==="oz"?e.value*(t.value/16):bh(e.unit,t.unit)?e.value*t.value:e.value*vde(e.unit,t),bde=(e,t,n,r,i)=>n===0||n.toString().length===0||parseInt(n.toString(),10)===0||window.isNaN(n)?0:mde(t,r)?e*i/n:e*i/gde(t,{value:n,unit:r});De("photon-dosage-calculator",{medication:void 0},e=>{let t;const[n,r]=F(0),[i,o]=F(0),[a,s]=F(0),[c,l]=F(0),[u,d]=F("mg/kg"),[f,h]=F("lbs"),[p,v]=F("mg"),[m,y]=F("mL"),[g,b]=F(""),[w,_]=F(""),O=S=>{const k=new CustomEvent("photon-dosage-selected",{composed:!0,bubbles:!0,detail:{value:Number(S?w().split(" ")[0]:g().split(" ")[0]),unit:S?w().split(" ")[1]:g().split(" ")[1]}});t?.dispatchEvent(k)};return Te(()=>{let S=yde({value:n(),unit:u()},{value:a(),unit:f()});S.toString().split(".").length>1&&S.toString().split(".")[1].length>4&&(S=parseFloat(S.toFixed(4))),b(`${S} ${u().split("/")[0]}`);let k=bde(S,u().split("/")[0],i(),p(),c());i.toString().split(".").length>1&&i.toString().split(".")[1].length>4&&(k=parseFloat(k.toFixed(4))),_(`${k} ${m()}`)},[n,u,f,a,i,c,p,m]),(()=>{const S=q(()=>document.importNode(fde,!0)),k=S.firstChild,A=k.nextSibling;A.firstChild;const D=A.nextSibling,re=D.firstChild,W=re.nextSibling,z=W.firstChild,Q=z.nextSibling,H=W.nextSibling,X=H.firstChild,R=X.nextSibling,B=H.nextSibling,Y=B.nextSibling,ae=Y.firstChild,fe=ae.nextSibling,I=Y.nextSibling,Re=I.firstChild,V=Re.nextSibling,Lt=I.nextSibling,en=Lt.nextSibling,te=en.firstChild,ie=te.nextSibling,oe=ie.nextSibling,me=oe.firstChild,_e=me.nextSibling,xe=en.nextSibling,ut=xe.firstChild,at=ut.nextSibling,Rt=at.nextSibling,Cn=Rt.firstChild,hr=Cn.nextSibling,Kn=t;return typeof Kn=="function"?de(Kn,S):t=S,E(k,ct),E(A,(()=>{const st=Ce(()=>!!e.medication);return()=>st()?(()=>{const ri=hde.cloneNode(!0);return E(ri,()=>e.medication.name),ri})():pde.cloneNode(!0)})(),null),W.addEventListener("photon-input-changed",st=>{r(st.detail.input)}),W.addEventListener("photon-unit-selected",st=>{d(st.detail.unit)}),Q._$owner=P(),E(W,U(ode,{}),null),H.addEventListener("photon-input-changed",st=>{s(st.detail.input)}),H.addEventListener("photon-unit-selected",st=>{h(st.detail.unit)}),R._$owner=P(),E(H,U(dde,{}),null),Y.addEventListener("photon-input-changed",st=>{o(st.detail.input)}),Y.addEventListener("photon-unit-selected",st=>{v(st.detail.unit)}),fe._$owner=P(),E(Y,U(sde,{}),null),I.addEventListener("photon-input-changed",st=>{l(st.detail.input)}),I.addEventListener("photon-unit-selected",st=>{y(st.detail.unit)}),V._$owner=P(),E(I,U(cde,{}),null),ie.disabled=!0,ie._$owner=P(),oe.addEventListener("photon-clicked",()=>O(!1)),oe._$owner=P(),_e._$owner=P(),at.disabled=!0,at._$owner=P(),Rt.addEventListener("photon-clicked",()=>O(!0)),Rt._$owner=P(),hr._$owner=P(),K(()=>ie.value=g()??"0"),K(()=>at.value=w()??"0"),S})()});const $de=T('<div><photon-dialog label="Dosage Calculator"><photon-dosage-calculator></photon-dosage-calculator></photon-dialog></div>',6);De("photon-dosage-calculator-dialog",{open:{value:!1,reflect:!0,notify:!1,attribute:"open",parse:!0},medication:{value:void 0,reflect:!0,notify:!1,attribute:"medication",parse:!0}},e=>{Et();let t;const n=(r,i)=>{const o=new CustomEvent("photon-dose-selected",{composed:!0,bubbles:!0,detail:{value:r,unit:i}});t?.dispatchEvent(o)};return(()=>{const r=q(()=>document.importNode($de,!0)),i=r.firstChild,o=i.firstChild,a=t;return typeof a=="function"?de(a,r):t=r,r.addEventListener("photon-dosage-selected",s=>{s.stopImmediatePropagation(),s.stopPropagation(),n(s.detail.value,s.detail.unit),e.open=!1}),i.header=!0,i.hideFooter=!0,i.addEventListener("photon-dialog-canceled",()=>{e.open=!1}),i._$owner=P(),o._$owner=P(),K(s=>{const c=e.open,l=e.medication;return c!==s._v$&&(i.open=s._v$=c),l!==s._v$2&&(o.medication=s._v$2=l),s},{_v$:void 0,_v$2:void 0}),r})()});const wde=T(`<div><photon-dialog label="Lose Unsaved Prescription?" confirm-text="Yes, Continue" cancel-text="Keep Editing" width="500px"><p class="font-sans text-lg xs:text-base">You have a prescription "<!>" that hasn't been added. Please add it or continue.</p></photon-dialog><photon-dialog label="Save prescriptions without an order?" confirm-text="Save and create order" cancel-text="Yes, Save Only" width="500px"><p class="font-sans text-lg xs:text-base">You're about to save prescriptions without creating a pharmacy order. You can create an order now, or at a later date.</p></photon-dialog></div>`,11),_de=T('<div class="flex flex-row gap-1 lg:gap-2 justify-end items-end"><photon-button size="sm" variant="outline">Save prescriptions</photon-button><photon-button size="sm">Save and create order</photon-button></div>',6),xde=T('<div class="w-full h-full bg-[#f7f4f4]"><div class="w-full h-full sm:w-[600px] xs:mx-auto"><photon-prescribe-workflow hide-submit="true"></photon-prescribe-workflow></div></div>',6),Sde=T('<div class="pt-2"><sl-alert variant="danger" open><div class="flex items-start xs:items-center gap-4"><sl-icon slot="icon" name="exclamation-octagon" class="text-red-500" style="font-size: 24px;"></sl-icon><p class="font-sans"></p></div></sl-alert></div>',10),Ede=e=>e().notes?.value.length>0||e().instructions?.value.length>0||e().treatment?.value||e().patient?.value||e().dispenseAsWritten?.value!=!1||e().dispenseQuantity?.value!=1||e().dispenseUnit?.value!="Each"||e().daysSupply?.value!=30||e().refillsInput?.value!=0||e().addToTemplates?.value!=!1||e().effectiveDate?.value!=Ef(new Date,"yyyy-MM-dd").toString()||e().draftPrescriptions?.value.length>0;De("photon-multirx-form-wrapper",{hideTemplates:!1,patientId:void 0,templateIds:void 0},e=>{let t;const n=Et(),[r,i]=F(!1),[o,a]=F([]),[s,c]=F(!1),[l,u]=F(!1),[d,f]=F(!1),[h,p]=F(),[v,m]=F(),[y,g]=F(!1),[b,w]=F(!1),{actions:_}=xf;Zt(async()=>{const A=await n.getSDK().authentication.getAccessToken();lx(A).permissions?.includes("write:prescription")&&c(!0)});const O=(A,D,re)=>{const W=new CustomEvent("photon-prescriptions-created",{composed:!0,bubbles:!0,detail:{patientId:re,prescriptionIds:D,createOrder:A}});t?.dispatchEvent(W)},S=()=>{const A=new CustomEvent("photon-prescriptions-closed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(A)},k=async(A,D,re)=>{f(re),a([]);const W=["patient","draftPrescriptions"];if(D.validate(W),!D.hasErrors(W)){u(!0),D.updateFormValue({key:"errors",value:[]});const Q=n.getSDK().clinical.prescription.createPrescriptions({}),H=n.getSDK().clinical.prescriptionTemplate.createPrescriptionTemplate({}),X=[];for(const R of A.draftPrescriptions.value){if(R.addToTemplates)try{const{errors:Y}=await H({variables:{catalogId:R.catalogId,treatmentId:R.treatment.id,dispenseAsWritten:R.dispenseAsWritten,dispenseQuantity:R.dispenseQuantity,dispenseUnit:R.dispenseUnit,fillsAllowed:R.refillsInput+1,daysSupply:R.daysSupply,instructions:R.instructions,notes:R.notes},awaitRefetchQueries:!1});Y&&a(Y)}catch(Y){a([Y])}const B={daysSupply:R.daysSupply,dispenseAsWritten:R.dispenseAsWritten,dispenseQuantity:R.dispenseQuantity,dispenseUnit:R.dispenseUnit,effectiveDate:R.effectiveDate,instructions:R.instructions,notes:R.notes,patientId:A.patient?.value.id,fillsAllowed:R.refillsInput+1,treatmentId:R.treatment.id};X.push(B)}if(o().length>0)return;try{const{data:R,errors:B}=await Q({variables:{prescriptions:X},refetchQueries:[],awaitRefetchQueries:!1});if(B){a(B);return}O(re,R.createPrescriptions.map(Y=>Y.id),A.patient?.value.id),_.clearSelectedPatient()}catch(R){a([R])}u(!1)}};return(()=>{const A=q(()=>document.importNode(wde,!0)),D=A.firstChild,re=D.firstChild,W=re.firstChild,z=W.nextSibling;z.nextSibling;const Q=D.nextSibling,H=t;return typeof H=="function"?de(H,A):t=A,D.addEventListener("photon-dialog-confirmed",()=>{g(!1),k(h(),v(),!0)}),D.addEventListener("photon-dialog-canceled",()=>{g(!1)}),D._$owner=P(),E(re,()=>h()?.treatment?.value?.name,z),Q.addEventListener("photon-dialog-confirmed",()=>{w(!1),k(h(),v(),!0)}),Q.addEventListener("photon-dialog-canceled",()=>{w(!1),k(h(),v(),!1)}),Q._$owner=P(),E(A,U(_S,{closeTitle:"Lose unsaved prescriptions?",closeBody:"You will not be able to recover unsaved prescriptions.",onClosed:()=>{S(),_.clearSelectedPatient(),e.open=!1},checkShouldWarn:()=>Ede(h),title:"New Prescriptions",titleIconName:"prescription",get headerRight(){return(()=>{const X=q(()=>document.importNode(_de,!0)),R=X.firstChild,B=R.nextSibling;return R.addEventListener("photon-clicked",()=>w(!0)),R._$owner=P(),B.addEventListener("photon-clicked",()=>h()?.treatment?.value?.name?g(!0):k(h(),v(),!0)),B._$owner=P(),K(Y=>{const ae=!r()||!s(),fe=l()&&!d(),I=!r()||!s(),Re=l()&&d(),V=l()&&d();return ae!==Y._v$3&&(R.disabled=Y._v$3=ae),fe!==Y._v$4&&(R.loading=Y._v$4=fe),I!==Y._v$5&&(B.disabled=Y._v$5=I),Re!==Y._v$6&&(B.loading=Y._v$6=Re),V!==Y._v$7&&(B.loading=Y._v$7=V),Y},{_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0}),X})()},get form(){return(()=>{const X=q(()=>document.importNode(xde,!0)),R=X.firstChild,B=R.firstChild;return E(X,U(ue,{get when(){return o().length>0},get children(){return U(I0,{get each(){return o()},children:Y=>(()=>{const ae=q(()=>document.importNode(Sde,!0)),fe=ae.firstChild,I=fe.firstChild,Re=I.firstChild,V=Re.nextSibling;return fe._$owner=P(),Re._$owner=P(),E(V,()=>Y.message),ae})()})}}),R),B.addEventListener("photon-form-validate",Y=>{i(Y.detail.canSubmit),m(Y.detail.actions),p(Y.detail.form)}),B._$owner=P(),K(Y=>{const ae=e.hideTemplates,fe=l(),I=e.patientId,Re=e.templateIds;return ae!==Y._v$8&&(B.hideTemplates=Y._v$8=ae),fe!==Y._v$9&&(B.loading=Y._v$9=fe),I!==Y._v$10&&(B.patientId=Y._v$10=I),Re!==Y._v$11&&(B.templateIds=Y._v$11=Re),Y},{_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0}),X})()}}),null),K(X=>{const R=y(),B=b();return R!==X._v$&&(D.open=X._v$=R),B!==X._v$2&&(Q.open=X._v$2=B),X},{_v$:void 0,_v$2:void 0}),A})()});const Ode=T("<div></div>",2);De("photon-audit",{},()=>(()=>{const e=Ode.cloneNode(!0);return E(e,U(EB,{uP:Et})),e})());
|
|
4082
|
+
`}};Pr.styles=Zue;x([Dr()],Pr.prototype,"checked",2);x([Dr()],Pr.prototype,"hasFocus",2);x([C()],Pr.prototype,"value",2);x([C({reflect:!0})],Pr.prototype,"size",2);x([C({type:Boolean,reflect:!0})],Pr.prototype,"disabled",2);x([et("checked")],Pr.prototype,"handleCheckedChange",1);x([et("disabled",{waitUntilFirstUpdate:!0})],Pr.prototype,"handleDisabledChange",1);Pr=x([cn("sl-radio")],Pr);const ede=T('<div><style></style><photon-card><div class="flex items-center gap-2"><p class="font-sans flex-grow text-gray-600 text-sm"><slot></slot></p><input type="radio"></div></photon-card></div>',13);At("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");De("photon-radio-card",{selected:!1,value:""},e=>{let t;const n=()=>{const r=new CustomEvent("photon-radio-selected",{composed:!0,bubbles:!0,detail:{value:e.value}});t?.dispatchEvent(r)};return(()=>{const r=q(()=>document.importNode(ede,!0)),i=r.firstChild,o=i.nextSibling,a=o.firstChild,s=a.firstChild,c=s.firstChild,l=s.nextSibling,u=t;return typeof u=="function"?de(u,r):t=r,E(i,ct),o.addEventListener("click",()=>n()),o._$owner=P(),c._$owner=P(),K(()=>l.checked=e.selected),r})()});function tde(e){const[t,n]=Wi(Array());return Te(()=>{if(!e)return;const r=()=>{n(e()?.assignedElements()||[])};return e()?.addEventListener("slotchange",r)},[e]),t}const nde=T('<div><style></style><div class="flex flex-col gap-3"><slot></slot></div></div>',8);At("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.82/dist/");De("photon-radio-group",{},()=>{let e;const[t,n]=F(),r=tde(t),i=o=>{const a=new CustomEvent("photon-option-selected",{composed:!0,bubbles:!0,detail:{value:o}});e?.dispatchEvent(a)};return(()=>{const o=nde.cloneNode(!0),a=o.firstChild,s=a.nextSibling,c=s.firstChild,l=e;return typeof l=="function"?de(l,o):e=o,o.addEventListener("photon-radio-selected",u=>{u.stopImmediatePropagation(),u.stopPropagation();for(const d of r)d.value.id===u.detail.value.id||d.value===u.detail.value?d.selected=!0:d.selected=!1;i(u.detail.value)}),E(a,ct),de(u=>n(u),c),c._$owner=P(),o})()});const rde=T('<div><photon-dialog cancel-text="Back" confirm-text="Select Medication" width="min-content"><photon-med-search></photon-med-search></photon-dialog></div>',6);De("photon-med-search-dialog",{open:{value:!1,reflect:!0,notify:!1,attribute:"open",parse:!0}},e=>{const t=Et();let n;const[r,i]=F(void 0),[o,a]=F(!1),[s,c]=F(""),[l,u]=F(!1),d=()=>{const f=new CustomEvent("photon-medication-selected",{composed:!0,bubbles:!0,detail:{medication:r()}});n?.dispatchEvent(f)};return(()=>{const f=q(()=>document.importNode(rde,!0)),h=f.firstChild,p=h.firstChild,v=n;return typeof v=="function"?de(v,f):n=f,f.addEventListener("photon-form-updated",m=>{i(m.detail.medication),a(m.detail.addToCatalog),c(m.detail.catalogId)}),h.addEventListener("photon-dialog-confirmed",async()=>{if(u(!0),o()){const m=t.getSDK().clinical.catalog.addToCatalog({});try{await m({variables:{catalogId:s(),treatmentId:r()?.id},awaitRefetchQueries:!1})}catch(y){console.log("Error adding to catalog: ",y?.message)}}d(),u(!1),e.open=!1}),h.addEventListener("photon-dialog-canceled",()=>{e.open=!1}),h._$owner=P(),p._$owner=P(),K(m=>{const y=e.open,g=l(),b=!r();return y!==m._v$&&(h.open=m._v$=y),g!==m._v$2&&(h.loading=m._v$2=g),b!==m._v$3&&(h.disableSubmit=m._v$3=b),m},{_v$:void 0,_v$2:void 0,_v$3:void 0}),f})()});const ide=T('<div class="min-w-[125px]"></div>',2),S8=[{id:"mcg/kg",name:"mcg/kg"},{id:"mg/kg",name:"mg/kg"},{id:"g/kg",name:"g/kg"}],ode=()=>{const[e,t]=F(""),n=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});r?.dispatchEvent(o)};let r;return(()=>{const i=ide.cloneNode(!0),o=r;return typeof o=="function"?de(o,i):r=i,i.addEventListener("photon-data-selected",a=>{n(a.detail.data.name)}),E(i,U(bn,{get data(){return S8.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a?.name||"",onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return S8[1]}})),i})()},ade=T('<div class="min-w-[125px]"></div>',2),E8=[{id:"mg",name:"mg"},{id:"mcg",name:"mcg"},{id:"g",name:"g"}],sde=()=>{const[e,t]=F(""),n=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});r?.dispatchEvent(o)};let r;return(()=>{const i=ade.cloneNode(!0),o=r;return typeof o=="function"?de(o,i):r=i,i.addEventListener("photon-data-selected",a=>{n(a.detail.data.name)}),E(i,U(bn,{get data(){return E8.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a?.name||"",onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return E8[0]}})),i})()},lde=T('<div class="min-w-[125px]"></div>',2),O8=[{id:"mL",name:"mL"},{id:"L",name:"L"}],cde=()=>{const[e,t]=F(""),n=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});r?.dispatchEvent(o)};let r;return(()=>{const i=lde.cloneNode(!0),o=r;return typeof o=="function"?de(o,i):r=i,i.addEventListener("photon-data-selected",a=>{n(a.detail.data.name)}),E(i,U(bn,{get data(){return O8.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a?.name||"",onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return O8[0]}})),i})()},ude=T('<div class="min-w-[125px]"></div>',2),k8=[{id:"lbs",name:"lbs"},{id:"kgs",name:"kgs"}],dde=()=>{const[e,t]=F(""),n=i=>{const o=new CustomEvent("photon-unit-selected",{composed:!0,bubbles:!0,detail:{unit:i}});r?.dispatchEvent(o)};let r;return(()=>{const i=ude.cloneNode(!0),o=r;return typeof o=="function"?de(o,i):r=i,i.addEventListener("photon-data-selected",a=>{n(a.detail.data.name)}),E(i,U(bn,{get data(){return k8.filter(a=>a.name.includes(e()))},forceLabelSize:!0,isLoading:!1,disabled:!1,placeholder:"Select a unit...",hasMore:!1,displayAccessor:a=>a?.name||"",onSearchChange:async a=>t(a),onHide:async()=>{t("")},noDataMsg:"No units found",required:!1,get selectedData(){return k8[0]}})),i})()},fde=T('<div><style></style><div class="flex flex-col xs:flex-row items-start xs:items-center gap-2 pb-2"><p class="font-sans text-lg">Selected Drug: </p></div><div class="flex flex-col"><p class="font-sans pb-1">Input</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Dosage</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Weight</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><p class="font-sans pb-1">Liquid Formation</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Drug Amount</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3 flex-shrink"></photon-number-input></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-56 xs:basis-60">Per Volume</p><photon-number-input min="0" value="0" class="mb-1.5 max-w-[140px] pl-3 xs:pl-4 pr-3"></photon-number-input></div><p class="font-sans">Result</p><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-36 xs:basis-[10.5rem]">Dose</p><photon-text-input class="mb-1.5 max-w-[180px] pl-3 pr-3"></photon-text-input><photon-button class="mb-7">Use<sl-icon name="chevron-right" slot="postfix"></sl-icon></photon-button></div><div class="flex items-center"><p class="font-sans text-gray-700 text-sm mb-7 basis-36 xs:basis-[10.5rem]">Liquid Dose</p><photon-text-input class="mb-1.5 max-w-[180px] pl-3 pr-3"></photon-text-input><photon-button class="mb-7">Use<sl-icon name="chevron-right" slot="postfix"></sl-icon></photon-button></div></div></div>',60),hde=T("<p></p>",2),pde=T('<p class="text-gray-500 font-sans italic">None selected</p>',2),bh=(e,t)=>!!((t==="kgs"||t==="g")&&e.includes("kg")||(t==="lbs"||t==="oz")&&e.includes("lb")),vde=(e,t)=>e.includes("kg")&&t.unit==="oz"?t.value/16*.453592:e.includes("kg")&&t.unit==="lbs"?t.value*.453592:e.includes("lb")&&t.unit==="kgs"?t.value*2.20462:e.includes("lb")&&t.unit==="g"?t.value/1e3*2.20462:0,mde=(e,t)=>t==="mcg"&&e.split("/")[0]==="mcg"||t==="mg"&&e.split("/")[0]==="mg"||t==="g"&&e.split("/")[0]==="g",gde=(e,t)=>e.includes("mcg")&&t.unit==="mcg"?t.value/(1e3*1e3):e.includes("mcg")&&t.unit==="g"?t.value*(1e3*1e3):e.includes("mg")&&t.unit==="mcg"?t.value/1e3:e.includes("mg")&&t.unit==="g"?t.value*1e3:e.includes("g")&&t.unit==="mcg"?t.value/(1e3*1e3):e.includes("g")&&t.unit==="mg"?t.value/1e3:0,yde=(e,t)=>bh(e.unit,t.unit)&&t.unit==="g"?e.value*(t.value/1e3):bh(e.unit,t.unit)&&t.unit==="oz"?e.value*(t.value/16):bh(e.unit,t.unit)?e.value*t.value:e.value*vde(e.unit,t),bde=(e,t,n,r,i)=>n===0||n.toString().length===0||parseInt(n.toString(),10)===0||window.isNaN(n)?0:mde(t,r)?e*i/n:e*i/gde(t,{value:n,unit:r});De("photon-dosage-calculator",{medication:void 0},e=>{let t;const[n,r]=F(0),[i,o]=F(0),[a,s]=F(0),[c,l]=F(0),[u,d]=F("mg/kg"),[f,h]=F("lbs"),[p,v]=F("mg"),[m,y]=F("mL"),[g,b]=F(""),[w,_]=F(""),O=S=>{const k=new CustomEvent("photon-dosage-selected",{composed:!0,bubbles:!0,detail:{value:Number(S?w().split(" ")[0]:g().split(" ")[0]),unit:S?w().split(" ")[1]:g().split(" ")[1]}});t?.dispatchEvent(k)};return Te(()=>{let S=yde({value:n(),unit:u()},{value:a(),unit:f()});S.toString().split(".").length>1&&S.toString().split(".")[1].length>4&&(S=parseFloat(S.toFixed(4))),b(`${S} ${u().split("/")[0]}`);let k=bde(S,u().split("/")[0],i(),p(),c());i.toString().split(".").length>1&&i.toString().split(".")[1].length>4&&(k=parseFloat(k.toFixed(4))),_(`${k} ${m()}`)},[n,u,f,a,i,c,p,m]),(()=>{const S=q(()=>document.importNode(fde,!0)),k=S.firstChild,A=k.nextSibling;A.firstChild;const D=A.nextSibling,re=D.firstChild,W=re.nextSibling,z=W.firstChild,Q=z.nextSibling,H=W.nextSibling,X=H.firstChild,R=X.nextSibling,B=H.nextSibling,Y=B.nextSibling,ae=Y.firstChild,fe=ae.nextSibling,I=Y.nextSibling,Re=I.firstChild,V=Re.nextSibling,Lt=I.nextSibling,en=Lt.nextSibling,te=en.firstChild,ie=te.nextSibling,oe=ie.nextSibling,me=oe.firstChild,_e=me.nextSibling,xe=en.nextSibling,ut=xe.firstChild,at=ut.nextSibling,Rt=at.nextSibling,Cn=Rt.firstChild,hr=Cn.nextSibling,Kn=t;return typeof Kn=="function"?de(Kn,S):t=S,E(k,ct),E(A,(()=>{const st=Ce(()=>!!e.medication);return()=>st()?(()=>{const ri=hde.cloneNode(!0);return E(ri,()=>e.medication.name),ri})():pde.cloneNode(!0)})(),null),W.addEventListener("photon-input-changed",st=>{r(st.detail.input)}),W.addEventListener("photon-unit-selected",st=>{d(st.detail.unit)}),Q._$owner=P(),E(W,U(ode,{}),null),H.addEventListener("photon-input-changed",st=>{s(st.detail.input)}),H.addEventListener("photon-unit-selected",st=>{h(st.detail.unit)}),R._$owner=P(),E(H,U(dde,{}),null),Y.addEventListener("photon-input-changed",st=>{o(st.detail.input)}),Y.addEventListener("photon-unit-selected",st=>{v(st.detail.unit)}),fe._$owner=P(),E(Y,U(sde,{}),null),I.addEventListener("photon-input-changed",st=>{l(st.detail.input)}),I.addEventListener("photon-unit-selected",st=>{y(st.detail.unit)}),V._$owner=P(),E(I,U(cde,{}),null),ie.disabled=!0,ie._$owner=P(),oe.addEventListener("photon-clicked",()=>O(!1)),oe._$owner=P(),_e._$owner=P(),at.disabled=!0,at._$owner=P(),Rt.addEventListener("photon-clicked",()=>O(!0)),Rt._$owner=P(),hr._$owner=P(),K(()=>ie.value=g()??"0"),K(()=>at.value=w()??"0"),S})()});const $de=T('<div><photon-dialog label="Dosage Calculator"><photon-dosage-calculator></photon-dosage-calculator></photon-dialog></div>',6);De("photon-dosage-calculator-dialog",{open:{value:!1,reflect:!0,notify:!1,attribute:"open",parse:!0},medication:{value:void 0,reflect:!0,notify:!1,attribute:"medication",parse:!0}},e=>{Et();let t;const n=(r,i)=>{const o=new CustomEvent("photon-dose-selected",{composed:!0,bubbles:!0,detail:{value:r,unit:i}});t?.dispatchEvent(o)};return(()=>{const r=q(()=>document.importNode($de,!0)),i=r.firstChild,o=i.firstChild,a=t;return typeof a=="function"?de(a,r):t=r,r.addEventListener("photon-dosage-selected",s=>{s.stopImmediatePropagation(),s.stopPropagation(),n(s.detail.value,s.detail.unit),e.open=!1}),i.header=!0,i.hideFooter=!0,i.addEventListener("photon-dialog-canceled",()=>{e.open=!1}),i._$owner=P(),o._$owner=P(),K(s=>{const c=e.open,l=e.medication;return c!==s._v$&&(i.open=s._v$=c),l!==s._v$2&&(o.medication=s._v$2=l),s},{_v$:void 0,_v$2:void 0}),r})()});const wde=T(`<div><photon-dialog label="Lose Unsaved Prescription?" confirm-text="Yes, Continue" cancel-text="Keep Editing" width="500px"><p class="font-sans text-lg xs:text-base">You have a prescription "<!>" that hasn't been added. Please add it or continue.</p></photon-dialog><photon-dialog label="Save prescriptions without an order?" confirm-text="Save and create order" cancel-text="Yes, Save Only" width="500px"><p class="font-sans text-lg xs:text-base">You're about to save prescriptions without creating a pharmacy order. You can create an order now, or at a later date.</p></photon-dialog></div>`,11),_de=T('<div class="flex flex-row gap-1 lg:gap-2 justify-end items-end"><photon-button size="sm" variant="outline">Save prescriptions</photon-button><photon-button size="sm">Save and create order</photon-button></div>',6),xde=T('<div class="w-full h-full bg-[#f7f4f4]"><div class="w-full h-full sm:w-[600px] xs:mx-auto"><photon-prescribe-workflow hide-submit="true"></photon-prescribe-workflow></div></div>',6),Sde=T('<div class="pt-2"><sl-alert variant="danger" open><div class="flex items-start xs:items-center gap-4"><sl-icon slot="icon" name="exclamation-octagon" class="text-red-500" style="font-size: 24px;"></sl-icon><p class="font-sans"></p></div></sl-alert></div>',10),Ede=e=>e().notes?.value.length>0||e().instructions?.value.length>0||e().treatment?.value||e().patient?.value||e().dispenseAsWritten?.value!=!1||e().dispenseQuantity?.value!=1||e().dispenseUnit?.value!="Each"||e().daysSupply?.value!=30||e().refillsInput?.value!=0||e().addToTemplates?.value!=!1||e().effectiveDate?.value!=Ef(new Date,"yyyy-MM-dd").toString()||e().draftPrescriptions?.value.length>0;De("photon-multirx-form-wrapper",{hideTemplates:!1,patientId:void 0,templateIds:void 0},e=>{let t;const n=Et(),[r,i]=F(!1),[o,a]=F([]),[s,c]=F(!1),[l,u]=F(!1),[d,f]=F(!1),[h,p]=F(),[v,m]=F(),[y,g]=F(!1),[b,w]=F(!1),{actions:_}=xf;Zt(async()=>{const A=await n.getSDK().authentication.getAccessToken();lx(A).permissions?.includes("write:prescription")&&c(!0)});const O=(A,D,re)=>{const W=new CustomEvent("photon-prescriptions-created",{composed:!0,bubbles:!0,detail:{patientId:re,prescriptionIds:D,createOrder:A}});t?.dispatchEvent(W)},S=()=>{const A=new CustomEvent("photon-prescriptions-closed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(A)},k=async(A,D,re)=>{f(re),a([]);const W=["patient","draftPrescriptions"];if(D.validate(W),!D.hasErrors(W)){u(!0),D.updateFormValue({key:"errors",value:[]});const Q=n.getSDK().clinical.prescription.createPrescriptions({}),H=n.getSDK().clinical.prescriptionTemplate.createPrescriptionTemplate({}),X=[];for(const R of A.draftPrescriptions.value){if(R.addToTemplates)try{const{errors:Y}=await H({variables:{catalogId:R.catalogId,treatmentId:R.treatment.id,dispenseAsWritten:R.dispenseAsWritten,dispenseQuantity:R.dispenseQuantity,dispenseUnit:R.dispenseUnit,fillsAllowed:R.refillsInput+1,daysSupply:R.daysSupply,instructions:R.instructions,notes:R.notes},awaitRefetchQueries:!1});Y&&a(Y)}catch(Y){a([Y])}const B={daysSupply:R.daysSupply,dispenseAsWritten:R.dispenseAsWritten,dispenseQuantity:R.dispenseQuantity,dispenseUnit:R.dispenseUnit,effectiveDate:R.effectiveDate,instructions:R.instructions,notes:R.notes,patientId:A.patient?.value.id,fillsAllowed:R.refillsInput+1,treatmentId:R.treatment.id};X.push(B)}if(o().length>0)return;try{const{data:R,errors:B}=await Q({variables:{prescriptions:X},refetchQueries:[],awaitRefetchQueries:!1});if(B){a(B);return}O(re,R.createPrescriptions.map(Y=>Y.id),A.patient?.value.id),_.clearSelectedPatient()}catch(R){a([R])}u(!1)}};return(()=>{const A=q(()=>document.importNode(wde,!0)),D=A.firstChild,re=D.firstChild,W=re.firstChild,z=W.nextSibling;z.nextSibling;const Q=D.nextSibling,H=t;return typeof H=="function"?de(H,A):t=A,D.addEventListener("photon-dialog-confirmed",()=>{g(!1),k(h(),v(),!0)}),D.addEventListener("photon-dialog-canceled",()=>{g(!1)}),D._$owner=P(),E(re,()=>h()?.treatment?.value?.name,z),Q.addEventListener("photon-dialog-confirmed",()=>{w(!1),k(h(),v(),!0)}),Q.addEventListener("photon-dialog-canceled",()=>{w(!1),k(h(),v(),!1)}),Q._$owner=P(),E(A,U(_S,{closeTitle:"Lose unsaved prescriptions?",closeBody:"You will not be able to recover unsaved prescriptions.",onClosed:()=>{S(),_.clearSelectedPatient(),e.open=!1},checkShouldWarn:()=>Ede(h),title:"New Prescriptions",titleIconName:"prescription",get headerRight(){return(()=>{const X=q(()=>document.importNode(_de,!0)),R=X.firstChild,B=R.nextSibling;return R.addEventListener("photon-clicked",()=>w(!0)),R._$owner=P(),B.addEventListener("photon-clicked",()=>h()?.treatment?.value?.name?g(!0):k(h(),v(),!0)),B._$owner=P(),K(Y=>{const ae=!r()||!s(),fe=l()&&!d(),I=!r()||!s(),Re=l()&&d(),V=l()&&d();return ae!==Y._v$3&&(R.disabled=Y._v$3=ae),fe!==Y._v$4&&(R.loading=Y._v$4=fe),I!==Y._v$5&&(B.disabled=Y._v$5=I),Re!==Y._v$6&&(B.loading=Y._v$6=Re),V!==Y._v$7&&(B.loading=Y._v$7=V),Y},{_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0}),X})()},get form(){return(()=>{const X=q(()=>document.importNode(xde,!0)),R=X.firstChild,B=R.firstChild;return E(X,U(ue,{get when(){return o().length>0},get children(){return U(I0,{get each(){return o()},children:Y=>(()=>{const ae=q(()=>document.importNode(Sde,!0)),fe=ae.firstChild,I=fe.firstChild,Re=I.firstChild,V=Re.nextSibling;return fe._$owner=P(),Re._$owner=P(),E(V,()=>Y.message),ae})()})}}),R),B.addEventListener("photon-form-validate",Y=>{i(Y.detail.canSubmit),m(Y.detail.actions),p(Y.detail.form)}),B._$owner=P(),K(Y=>{const ae=e.hideTemplates,fe=l(),I=e.patientId,Re=e.templateIds;return ae!==Y._v$8&&(B.hideTemplates=Y._v$8=ae),fe!==Y._v$9&&(B.loading=Y._v$9=fe),I!==Y._v$10&&(B.patientId=Y._v$10=I),Re!==Y._v$11&&(B.templateIds=Y._v$11=Re),Y},{_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0}),X})()}}),null),K(X=>{const R=y(),B=b();return R!==X._v$&&(D.open=X._v$=R),B!==X._v$2&&(Q.open=X._v$2=B),X},{_v$:void 0,_v$2:void 0}),A})()});const Ode=T("<div></div>",2);De("photon-audit",{},()=>(()=>{const e=Ode.cloneNode(!0);return E(e,U(EB,{uP:Et})),e})());
|
package/dist/index.mjs
CHANGED
|
@@ -43555,13 +43555,21 @@ De("photon-med-search-dialog", {
|
|
|
43555
43555
|
return typeof v == "function" ? de(v, f) : n = f, f.addEventListener("photon-form-updated", (m) => {
|
|
43556
43556
|
i(m.detail.medication), a(m.detail.addToCatalog), c(m.detail.catalogId);
|
|
43557
43557
|
}), h.addEventListener("photon-dialog-confirmed", async () => {
|
|
43558
|
-
u(!0), o()
|
|
43559
|
-
|
|
43560
|
-
|
|
43561
|
-
|
|
43562
|
-
|
|
43563
|
-
|
|
43564
|
-
|
|
43558
|
+
if (u(!0), o()) {
|
|
43559
|
+
const m = t.getSDK().clinical.catalog.addToCatalog({});
|
|
43560
|
+
try {
|
|
43561
|
+
await m({
|
|
43562
|
+
variables: {
|
|
43563
|
+
catalogId: s(),
|
|
43564
|
+
treatmentId: r()?.id
|
|
43565
|
+
},
|
|
43566
|
+
awaitRefetchQueries: !1
|
|
43567
|
+
});
|
|
43568
|
+
} catch (y) {
|
|
43569
|
+
console.log("Error adding to catalog: ", y?.message);
|
|
43570
|
+
}
|
|
43571
|
+
}
|
|
43572
|
+
d(), u(!1), e.open = !1;
|
|
43565
43573
|
}), h.addEventListener("photon-dialog-canceled", () => {
|
|
43566
43574
|
e.open = !1;
|
|
43567
43575
|
}), h._$owner = P(), p._$owner = P(), K((m) => {
|