PageSourceSearch

https://web.drfirst.com/2147.2a76edf0ca3855c6.js

js drfirst.com collected 2026-10-03 19:19:40 UTC 110,591 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwapp_rcopia4ui=self.webpackChunkwapp_rcopia4ui||[]).push([[2147],{12147:(X,I,r)=>{function S(a){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(s){return typeof s;}:function(s){return s&&"function"==typeof Symbol&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s;})(a);}function V(a,s){for(var t=0;t<s.length;t++){var n=s[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,q(n.key),n);}}function q(a){var s=function W(a,s){if("object"!=S(a)||!a)return a;var t=a[Symbol.toPrimitive];if(void 0!==t){var n=t.call(a,s||"default");if("object"!=S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===s?String:Number)(a);}(a,"string");return"symbol"==S(s)?s:s+"";}r.r(I),r.d(I,{default:()=>Et}),r(62010),r(52675),r(89463),r(2259),r(45700),r(23792),r(89572),r(2892),r(26099),r(47764),r(62953);const Q={bindings:{$transition$:"<"},controller:function(a){var s=function(){return function J(a,s,t){return s&&V(a.prototype,s),t&&V(a,t),Object.defineProperty(a,"prototype",{writable:!1}),a;}(function t(n,i){(function H(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function");})(this,t),this.$state=n,this.SessionUtils=i,this.widgetId=this.SessionUtils.generateWidgetId("utilities");},[{key:"$onInit",value:function(){var i=this;this.patientPharmacySearchButtonClickEvent=this.SessionUtils.subscribeEvent({widgetId:this.widgetId,eventName:"patientPharmacySearchButton.click",callback:function(){i.$state.go("pharmacy-search");}});}},{key:"$onDestroy",value:function(){this.patientPharmacySearchButtonClickEvent&&this.SessionUtils.unsubscribeEvent(this.patientPharmacySearchButtonClickEvent.eventSubscriptionId);}}]);}();return s.$inject=["$state","SessionUtils"],s;}(),template:r(30217).A};var ee=r(46289),e=r(31957),y=function(a){return a.SEARCH="Search",a.PATH_DETAILS="Path Details",a;}(y||{});let E=(()=>{class a{constructor(){this.switchPathwayManagementTabEvent=new e.bkB(),this.switchPathwayManagementTabEventEdit=new e.bkB();}editPathwaysManagementDetails(t){this.switchPathwayManagementTabEventEdit.emit(t);}openPathwaysManagementDetails(){this.switchPathwayManagementTabEvent.emit(y.PATH_DETAILS);}openPathwaysManagementTable(){this.switchPathwayManagementTabEvent.emit(y.SEARCH);}static#_=this.ɵfac=function(n){return new(n||a)();};static#_2=this.ɵprov=e.jDH({token:a,factory:a.ɵfac,providedIn:"root"});}return a;})(),te=(()=>{class a{static#_=this.ɵfac=function(n){return new(n||a)();};static#_2=this.ɵprov=e.jDH({token:a,factory:a.ɵfac,providedIn:"root"});}return a;})();var c=r(43320),w=r(70720),R=r(95013),p=r(83131),P=r(40952);function ne(a,s){if(1&a&&e.nrm(0,"ag-grid-angular",9),2&a){const t=e.XpG();e.Y8G("rowData",t.rowData)("columnDefs",t.colDefs)("gridOptions",t.gridOptions)("suppressRowClickSelection",!0)("enableFilter",!0)("floatingFilter",!0)("pagination",!0)("paginationPageSizeSelector",!1)("paginationPageSize",10);}}let ae=(()=>{class a{constructor(t,n,i,o){this.changeDetectorRef=t,this.activeModal=n,this.pathwaysService=i,this.notifierService=o,this.selectedLocation={},this.rowData=[],this.colDefs=[],this.pagination=!0,this.gridOptions={},this.isPathwayRowSelected=!1;}ngOnInit(){this.rowData=this.selectedLocation?.pathways||[],this.setColumnDef(),this.setGridOption(),this.detectChanges();}setColumnDef(){this.colDefs=[{headerName:"Applied Pathways",field:"name",filter:"agTextColumnFilter",floatingFilter:!0,checkboxSelection:!0,headerCheckboxSelection:!0,flex:5}];}setGridOption(){const t=this;this.gridOptions={sortingOrder:["asc","desc"],suppressMenuHide:!1,suppressMovableColumns:!0,rowSelection:"multiple",overlayNoRowsTemplate:'<span">No records found</span>',onGridReady(n){n&&n.api&&(t.gridApi=n.api,t.gridApi.showLoadingOverlay(),t.gridApi.selectAll(),t.gridApi.hideOverlay());},onSelectionChanged(){const n=t.gridApi?.getSelectedNodes()||[],i=t.rowData.length;t.isPathwayRowSelected=n?.length<i,t.detectChanges();}};}getSelectedRowsData(){return this.gridApi?.getSelectedRows();}getPayloadEditPathway(){const t=this.getSelectedRowsData();return{pathwayIdList:this.selectedLocation?.pathways?.filter(i=>!t?.some(o=>o?.pathwayId?.simpleId===i?.pathwayId?.simpleId)).map(i=>i.pathwayId)||[],locationIdList:this.selectedLocation?.locationId?[this.selectedLocation.locationId]:[]};}updateData(){const t=this.getPayloadEditPathway();this.pathwaysService.removePathways(t).subscribe({next:()=>{this.showNotificationMessage("success","Pathways removed. User will view all changes on next login"),this.activeModal.close(!0),this.detectChanges();},error:n=>{this.showNotificationMessage("error","Pathways Action Failed. Please try again"),console.log(n);}});}showNotificationMessage(t,n){this.notifierService.show({type:t,message:n}),this.detectChanges();}closeModal(t){this.activeModal.close(t);}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(e.gRc),e.rXU(c.Lw),e.rXU(R.R),e.rXU(w.iJ));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathway-assigment-modal"]],inputs:{selectedLocation:"selectedLocation"},standalone:!0,features:[e.aNF],decls:17,vars:3,consts:[["a-id","df-f-pathway-edit-modal",1,"bootstrap5"],["a-id","df-e-pathway-edit-header",1,"modal-header"],[1,"modal-title"],["a-id","df-e-pathway-edit-body",1,"modal-body"],["a-id","df-t-pathway-edit","class","ag-theme-balham pathway-assignment-table",3,"rowData","columnDefs","gridOptions","suppressRowClickSelection","enableFilter","floatingFilter","pagination","paginationPageSizeSelector","paginationPageSize",4,"ngIf"],["a-id","df-e-pathway-edit-footer",1,"modal-footer"],[1,"footer-btn"],["a-id","df-b-update-pathway","type","button",1,"btn","btn-primary",3,"disabled","click"],["a-id","df-b-pathway-close-modal","type","button",1,"btn","btn-default",3,"click"],["a-id","df-t-pathway-edit",1,"ag-theme-balham","pathway-assignment-table",3,"rowData","columnDefs","gridOptions","suppressRowClickSelection","enableFilter","floatingFilter","pagination","paginationPageSizeSelector","paginationPageSize"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"h4",2),e.EFF(3,"Manage Assignments"),e.k0s()(),e.j41(4,"div",3)(5,"p"),e.EFF(6," Items assigned to "),e.j41(7,"b"),e.EFF(8),e.k0s(),e.EFF(9," location. "),e.k0s(),e.DNE(10,ne,1,9,"ag-grid-angular",4),e.k0s(),e.j41(11,"div",5)(12,"div",6)(13,"button",7),e.bIt("click",function(){return i.updateData();}),e.EFF(14," Update "),e.k0s(),e.j41(15,"button",8),e.bIt("click",function(){return i.closeModal();}),e.EFF(16," Close "),e.k0s()()()()),2&n&&(e.R7$(8),e.JRh(i.selectedLocation.name),e.R7$(2),e.Y8G("ngIf",i.gridOptions&&i.colDefs.length),e.R7$(3),e.Y8G("disabled",!i.isPathwayRowSelected));},dependencies:[p.MD,p.bT,c.UN,P.$V,P.xs],styles:[".pathway-assignment-table[_ngcontent-%COMP%]{height:380px;width:100%}.footer-btn[_ngcontent-%COMP%]{float:left}"],changeDetection:0});}return a;})(),ie=(()=>{class a{constructor(t,n){this.changeDetectorRef=t,this.modalService=n,this.isPathwayExist=!0,this.selectedLocationData={};}agInit(t){this.params=t,this.selectedLocationData=t.data,this.isPathwayExist=t?.data?.pathways?.length>0||!1,this.detectChanges();}refresh(){return!1;}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}openModal(){const t=this.modalService.open(ae,{size:"md",centered:!0,backdrop:!0});t&&(t.componentInstance.selectedLocation=this.selectedLocationData),t&&t.result.then(n=>
1{n&&(this.params?.context?.componentParentPathwayAssignment?.getAssignmentTableData(),this.detectChanges());});}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(e.gRc),e.rXU(c.Bq));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-edit-pathway-renderer"]],standalone:!0,features:[e.aNF],decls:5,vars:1,consts:[[1,"df-f-edit-pathway"],["a-id","df-b-pathway-edit","type","button",1,"btn","btn-default","btn-sm",3,"disabled","click"],[1,"svg","pencil-alt-solid"],["href","#pencil-alt-solid"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"button",1),e.bIt("click",function(){return i.openModal();}),e.qSk(),e.j41(2,"svg",2),e.nrm(3,"use",3),e.k0s(),e.EFF(4," \xa0Edit "),e.k0s()()),2&n&&(e.R7$(1),e.Y8G("disabled",!i.isPathwayExist));},dependencies:[p.MD,c.UN],styles:[".edit-btn[_ngcontent-%COMP%]{display:flex;justify-content:center}"],changeDetection:0});}return a;})();function oe(a,s){if(1&a&&(e.j41(0,"li")(1,"strong",9),e.EFF(2),e.k0s()()),2&a){const t=s.$implicit;e.R7$(2),e.JRh(t);}}let se=(()=>{class a{constructor(t,n){this.changeDetectorRef=t,this.activeModal=n,this.locationNames=[],this.maxPathwayAssignment=5;}ngOnInit(){this.detectChanges();}closeModal(){this.activeModal.close();}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(e.gRc),e.rXU(c.Lw));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathways-max-assign-modal"]],inputs:{locationNames:"locationNames",maxPathwayAssignment:"maxPathwayAssignment"},standalone:!0,features:[e.aNF],decls:20,vars:2,consts:[["a-id","df-f-pathway-max-assign-modal",1,"bootstrap5"],["a-id","df-e-pathway-max-assign-header",1,"modal-header"],[1,"modal-title"],["a-id","df-e-pathway-max-assign-body",1,"modal-body"],[4,"ngFor","ngForOf"],["a-id","df-e-pathway-max-assign-number"],["a-id","df-e-pathway-max-assign-footer",1,"modal-footer"],[1,"footer-btn"],["a-id","df-b-pathway-max-assign-close-btn","type","button",1,"btn","btn-default",3,"click"],["a-id","df-e-pathway-max-assign-location-name"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"h4",2),e.EFF(3,"Cannot Apply Pathway"),e.k0s()(),e.j41(4,"div",3)(5,"p"),e.EFF(6,"The selected Pathway cannot be assigned to"),e.k0s(),e.j41(7,"ul"),e.DNE(8,oe,3,1,"li",4),e.k0s(),e.j41(9,"p"),e.EFF(10," Currently the system supports "),e.j41(11,"strong",5),e.EFF(12),e.k0s(),e.EFF(13," pathways per location. "),e.k0s(),e.j41(14,"p"),e.EFF(15,"Please update your selections and try again."),e.k0s()(),e.j41(16,"div",6)(17,"div",7)(18,"button",8),e.bIt("click",function(){return i.closeModal();}),e.EFF(19," Close "),e.k0s()()()()),2&n&&(e.R7$(8),e.Y8G("ngForOf",i.locationNames),e.R7$(4),e.JRh(i.maxPathwayAssignment));},dependencies:[c.UN,p.Sq],styles:[".footer-btn[_ngcontent-%COMP%]{float:left}"],changeDetection:0});}return a;})();var b=r(36158),x=r(86079);function le(a,s){1&a&&(e.j41(0,"span"),e.EFF(1,","),e.k0s());}function re(a,s){if(1&a&&(e.j41(0,"span",1),e.EFF(1),e.DNE(2,le,2,0,"span",2),e.k0s()),2&a){const t=s.$implicit,n=s.last,i=e.XpG();e.FS9("title",t.name),e.Y8G("ngClass",i.checkNameColor(t)),e.R7$(1),e.SpI(" ",t.name,""),e.R7$(1),e.Y8G("ngIf",!n);}}let de=(()=>{class a{constructor(t){this.pathwaysService=t,this.pathways=[],this.pathwayRules=this.pathwaysService.getListOfPathwayRuleTypes();}agInit(t){this.refresh(t),t.data.pathways.sort((n,i)=>n.name.localeCompare(i.name));}refresh(t){return this.pathways=t.data.pathways,!0;}checkNameColor(t){return this.pathwayRules&&this.pathwayRules.length>0?this.pathwayRules.find(i=>i===t.rule)?"pathway-assigned":"pathway-not-rule-preference":"pathway-assigned";}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(b.RC));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathway-names-renderer"]],standalone:!0,features:[e.aNF],decls:1,vars:1,consts:[[3,"ngClass","title",4,"ngFor","ngForOf"],[3,"ngClass","title"],[4,"ngIf"]],template:function(n,i){1&n&&e.DNE(0,re,3,4,"span",0),2&n&&e.Y8G("ngForOf",i.pathways);},dependencies:[p.MD,p.YU,p.Sq,p.bT,c.UN],styles:[".pathway-not-rule-preference[_ngcontent-%COMP%]{color:#ef5423}"]});}return a;})();var d=r(74712),j=r(28468);function ce(a,s){if(1&a&&e.nrm(0,"ag-grid-angular",11),2&a){const t=e.XpG();e.Y8G("rowData",t.rowData)("columnDefs",t.colDefs)("gridOptions",t.gridOptions)("animateSort",!0)("pagination",!0)("suppressRowClickSelection",!0)("paginationPageSize",10)("enableFilter",!0)("floatingFilter",!0)("rowSelection",t.rowSelection)("paginationPageSize",t.defaultPageSize)("paginationPageSizeSelector",t.paginationPageSizeSelector);}}let pe=(()=>{class a{constructor(t,n,i,o,l){this.changeDetectorRef=t,this.pathwaysService=n,this.notifierService=i,this.modalService=o,this.logger=l,this.pathways=[],this.placeholderVisible=!0,this.isDropdownOpen=!1,this.isAnyRowSelected=!1,this.selectedApplyPathways={},this.defaultPageSize=10,this.paginationPageSizeSelector=[10,20,50,100],this.rowSelection="multiple",this.rowData=[],this.colDefs=[],this.gridOptions={},this.maxPathwayAssignments=this.pathwaysService.DEFAULT_MAX_PATHWAY_ASSIGNMENTS;}ngOnInit(){this.initialization(),this.getPathwaysData(),this.setColumnDef(),this.setGridOption(),this.detectChanges(),this.setMaxPathwayAssignment();}isSelectedPathwayEmpty(){return 0==Object.keys(this.selectedApplyPathways).length;}onDropdownOpen(){this.isDropdownOpen=!0;}onDropdownClose(){this.isDropdownOpen=!1;}initialization(){this.rowData=[];}setColumnDef(){this.colDefs=[{headerName:"Location",field:"name",filter:"agTextColumnFilter",floatingFilter:!0,flex:2,checkboxSelection:!0,headerCheckboxSelection:!0,sort:"asc",sortingOrder:["asc","desc"],tooltipField:"name",comparator:(t,n)=>t.toLowerCase().localeCompare(n.toLowerCase())},{headerName:"City",field:"city",filter:"agTextColumnFilter",floatingFilter:!0,flex:1,tooltipField:"city"}
1,{headerName:"State",field:"state",filter:"agTextColumnFilter",floatingFilter:!0,flex:1,tooltipField:"state"},{headerName:"Applied Pathways",field:"pathways",filter:"agTextColumnFilter",floatingFilter:!0,flex:5,valueGetter:t=>Array.isArray(t.data.pathways)?t.data.pathways.map(n=>n.name).join(" "):"",cellRenderer:de},{headerName:"Actions",field:"actions",autoHeight:!0,width:100,cellRenderer:ie}];}setGridOption(){const t=this;this.gridOptions={sortingOrder:["asc","desc"],suppressMenuHide:!1,suppressMovableColumns:!0,rowSelection:"multiple",overlayNoRowsTemplate:'<span">No records found</span>',context:{componentParentPathwayAssignment:this},tooltipShowDelay:500,onGridReady(n){n&&n.api&&(t.gridApi=n.api,t.gridApi.showLoadingOverlay(),t.getAssignmentTableData());},onSelectionChanged(){const n=t.gridApi?.getSelectedNodes();t.isAnyRowSelected=!!n?.length,t.detectChanges();}};}getAssignmentTableData(){this.pathwaysService.getPathwayAssignmentData().subscribe(t=>{this.rowData=t.results,this.detectChanges();},t=>{this.showNotificationMessage("error","Unable to load pathway assignment data. Please try again."),this.logger.$log.error("@Pathway Assignment: Failed to load pathway assignment data",t),this.gridApi?.showNoRowsOverlay();});}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}setMaxPathwayAssignment(){this.maxPathwayAssignments=this.pathwaysService.getPathwaysMaximumAssignments();}getPathwaysData(){this.pathwaysService.fetchPathways().subscribe(t=>{const n=t?.results.map(i=>({name:i.name,pathwayId:i.pathwayId}));this.pathways=n,this.detectChanges();});}getPayloadData(){return{locationIdList:this.gridApi?.getSelectedRows()?.map(i=>i.locationId)};}showNotificationMessage(t,n){this.notifierService.show({type:t,message:n}),this.selectedApplyPathways={},this.detectChanges();}onApplyBtn(){const t=this.checkMaxPathwaysRule();if(t.length>0)this.openMaxExceededModal(t,this.maxPathwayAssignments);else{const n=this.getPayloadData();n.pathwayId=this.selectedApplyPathways,this.pathwaysService.applyPathways(n).subscribe({next:()=>{this.showNotificationMessage("success","Pathways updated. User will view all changes on next login"),this.getAssignmentTableData();},error:i=>{this.logger.$log.error("@Pathway Assignment: Failed to call pathwayService.applyPathways",i),i?.failures?.length?this.handlePathwayAssignFailures(i):this.showNotificationMessage("error","Unable to assign Pathway. Please try again"),this.getAssignmentTableData();}});}}onRemovePathwayBtn(){const t=this.modalService.open(x.o,{size:"md",centered:!0,backdrop:!0});if(t){const n=this.pathways.find(i=>i.pathwayId.simpleId==this.selectedApplyPathways.simpleId)?.name||"";t.componentInstance.modalOptions={title:`Delete ${n}`,description:`Are you sure you want to delete <strong>${n}</strong>? This action cannot be undone.`,confirmBtn:!0};}t.result.then(n=>{n&&this.onRemoveBtn();});}onRemoveBtn(){const t=this.getPayloadData();t.pathwayIdList=[this.selectedApplyPathways],this.pathwaysService.removePathways(t).subscribe({next:()=>{this.showNotificationMessage("success","Pathways removed. User will view all changes on next login"),this.getAssignmentTableData();},error:n=>{this.logger.$log.error("@Pathway Assignment: Failed to call pathwayService.removePathways",n),this.showNotificationMessage("error","Pathways Action Failed. Please try again");}});}checkMaxPathwaysRule(){const t=this.gridApi?.getSelectedRows(),n=[];return t?.forEach(i=>{i.pathways.length>=this.maxPathwayAssignments&&n.push(i.name);}),n;}openMaxExceededModal(t,n){const i=this.modalService.open(se,{size:"md",centered:!0,backdrop:!0});i&&(i.componentInstance.locationNames=t,i.componentInstance.maxPathwayAssignment=n),i&&i.result.then(o=>{console.log(o,"Max Assign data");});}handlePathwayAssignFailures(t){if(t.failures?.length){const n=this.checkForMaxExceededFailure(t.failures);n&&this.openMaxExceededModal(n.maxExceededLocationNames,n.maxValue),this.showNotificationMessage("error","Unable to assign one or more selected Pathway(s). Please try again.");}}checkForMaxExceededFailure(t){const n="pathway_location_maximum_assignment value",i=this.gridApi?.getSelectedRows(),o=[];let l="";return i&&t.forEach(g=>{g.result.includes(n)&&(l=l||g.result.split(n)[1]?.trim()||"",l&&i.forEac
1h(h=>{g.locationId?.simpleId===h.locationId?.simpleId&&o.push(h.name);}));}),{maxValue:Number.isNaN(parseInt(l))?this.maxPathwayAssignments:parseInt(l),maxExceededLocationNames:o};}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(e.gRc),e.rXU(R.R),e.rXU(w.iJ),e.rXU(c.Bq),e.rXU(b.Kc));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathways-assignment"]],decls:15,vars:8,consts:[["a-id","df-f-pathway-assignment-container",1,"px-2"],["a-id","df-t-pathway-assignment"],["class","ag-theme-balham pathway-assignment-table",3,"rowData","columnDefs","gridOptions","animateSort","pagination","suppressRowClickSelection","paginationPageSize","enableFilter","floatingFilter","rowSelection","paginationPageSizeSelector",4,"ngIf"],["a-id","df-e-pathway-assignment-footer",1,"row","pt-2","pb-2"],[1,"col-md-4","pathway_select"],[1,"dropdown_box"],["a-id","df-d-pathway-assignment","bindLabel","name","bindValue","pathwayId","shadow-none","",1,"custom",3,"clearable","clearSearchOnAdd","items","placeholder","ngModel","open","close","ngModelChange"],[1,"pl-2"],["a-id","df-b-pathway-apply","type","button",1,"btn","btn-primary",3,"disabled","click"],[1,"pl-1"],["a-id","df-b-pathway-remove","type","button",1,"btn","btn",3,"disabled","click"],[1,"ag-theme-balham","pathway-assignment-table",3,"rowData","columnDefs","gridOptions","animateSort","pagination","suppressRowClickSelection","paginationPageSize","enableFilter","floatingFilter","rowSelection","paginationPageSizeSelector"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"p"),e.EFF(2,"Filter and select the locations you wish to modify, then you may apply a Pathway"),e.k0s(),e.j41(3,"div",1),e.DNE(4,ce,1,12,"ag-grid-angular",2),e.k0s(),e.j41(5,"div",3)(6,"div",4)(7,"div",5)(8,"ng-select",6),e.bIt("open",function(){return i.onDropdownOpen();})("close",function(){return i.onDropdownClose();})("ngModelChange",function(l){return i.selectedApplyPathways=l;}),e.k0s()(),e.j41(9,"div",7)(10,"button",8),e.bIt("click",function(){return i.onApplyBtn();}),e.EFF(11," Apply "),e.k0s()(),e.j41(12,"div",9)(13,"button",10),e.bIt("click",function(){return i.onRemovePathwayBtn();}),e.EFF(14," Remove "),e.k0s()()()()()),2&n&&(e.R7$(4),e.Y8G("ngIf",i.gridOptions&&i.colDefs.length),e.R7$(4),e.Y8G("clearable",!1)("clearSearchOnAdd",!0)("items",i.pathways)("placeholder",i.isDropdownOpen?"":"--Select--")("ngModel",i.selectedApplyPathways),e.R7$(2),e.Y8G("disabled",!i.isAnyRowSelected||i.isSelectedPathwayEmpty()),e.R7$(3),e.Y8G("disabled",!i.isAnyRowSelected||i.isSelectedPathwayEmpty()));},dependencies:[p.bT,d.BC,d.vS,j.vr,P.xs],styles:[".ng-select.ng-select-opened[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]{background:#fff;border-color:#b3b3b3 #ccc #d9d9d9}.ng-select.ng-select-opened[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]:hover{box-shadow:none}.ng-select.ng-select-opened[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]   .ng-arrow[_ngcontent-%COMP%]{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.ng-select.ng-select-opened[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]   .ng-arrow[_ngcontent-%COMP%]:hover{border-color:transparent transparent #333}.ng-select.ng-select-opened.ng-select-top[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]{border-top-right-radius:0;border-top-left-radius:0}.ng-select.ng-select-opened.ng-select-right[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.ng-select.ng-select-opened.ng-select-bottom[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]{border-bottom-right-radius:0;border-bottom-left-radius:0}.ng-select.ng-select-opened.ng-select-left[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.ng-select.ng-select-focused[_ngcontent-%COMP%]:not(.ng-select-opened) > .ng-select-container[_ngcontent-%COMP%]{border-color:#007eff;box-shadow:inset 0 1px 1px #00000013,0 0 0 3px #007eff1a}.ng-select.ng-select-disabled[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]{background-color:#f9f9f9}.ng-select[_ngcontent-%COMP%]   .ng-has-value[_ngcontent-%COMP%]   .ng-placeholder[_ngcontent-%COMP%]{display:none}.ng-select[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]{color:#333;background-color:#fff;border-radius:4px;border:1px solid #ccc;min-height:36px;align-items:center}.ng-select[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]:hover{box-shadow:0 1px #0000000f}.ng-select[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]{align-items:center;padding-left:10px}[dir=rtl][_ngcontent-%COMP%]   .ng-select[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]{padding-right:10px;padding-left:0}.ng-select[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-placeholder[_ngcontent-%COMP%]{color:#999}.ng-select.ng-select-single[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]{height:36px}.ng-select.ng-select-single[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-input[_ngcontent-%COMP%]{top:5px;left:0;padding-left:10px;padding-right:50px}[dir=rtl][_ngcontent-%COMP%]   .ng-select.ng-select-single[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-input[_ngcontent-%COMP%]{padding-right:10px;padding-left:50px}.ng-select.ng-select-multiple.ng-select-disabled[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]{background-color:#f9f9f9;border:1px solid #e6e6e6}.ng-select.ng-select-multiple.ng-select-disabled[_ngcontent-%COMP%] > .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]   .ng-value-label[_ngcontent-%COMP%]{padding:0 5px}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]{padding-top:5px;padding-left:7px}[dir=rtl][_ngcontent-%COMP%]   .ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]{padding-right:7px;padding-left:0}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]{font-size:.9em;margin-bottom:5px;color:#333;background-color:#ebf5ff;border-radius:2px;margin-right:5px}[dir=rtl][_ngcontent-%COMP%]   .ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]{margin-right:0;margin-left:5px}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value.ng-value-disabled[_ngcontent-%COMP%]{background-color:#f9f9f9}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value.ng-value-disabled[_ngcontent-%COMP%]   .ng-value-label[_ngcontent-%COMP%]{padding-left:5px}[dir=rtl][_ngcontent-%COMP%]   .ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value.ng-value-disabled[_ngcontent-%COMP%]   .ng-value-label[_ngcontent-%COMP%]{padding-left:0;padding-right:5px}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]   .ng-value-label[_ngcontent-%COMP%], .ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]   .ng-value-icon[_ngcontent-%COMP%]{display:inline-block;padding:1px 5px}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]   .ng-value-icon[_ngcontent-%COMP%]:hover{background-color:#d1e8ff}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]   .ng-value-icon.left[_ngcontent-%COMP%]{border-right:1px solid #b8dbff}[dir=rtl][_ngcontent-%COMP%]   .ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]   .ng-value-icon.left[_ngcontent-%COMP%]{border-left:1px solid #b8dbff;border-right:none}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]   .ng-value-icon.right[_ngcontent-%COMP%]{border-left:1px solid #b8dbff}[dir=rtl][_ngcontent-%COMP%]   .ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-value[_ngcontent-%COMP%]   .ng-value-icon.right[_ngcontent-%COMP%]{border-left:0;border-right:1px solid #b8dbff}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-input[_ngcontent-%COMP%]{padding:0 0 3px 3px}[dir=rtl][_ngcontent-%COMP%]   .ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-input[_ngcontent-%COMP%]{padding:0 3px 3px 0}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-input[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{color:#000}.ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-placeholder[_ngcontent-%COMP%]{top:5px;padding-bottom:5px;padding-left:3px}[dir=rtl][_ngcontent-%COMP%]   .ng-select.ng-select-multiple[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]   .ng-placeholder[_ngcontent-%COMP%]{padding-right:3px;padding-left:0}.ng-select[_ngcontent-%COMP%]   .ng-clear-wrapper[_ngcontent-%COMP%]{color:#999}.ng-select[_ngcontent-%COMP%]   .ng-clear-wrapper[_ngcontent-%COMP%]:hover   .ng-clear[_ngcontent-%COMP%]{color:#d0021b}.ng-select[_ngcontent-%COMP%]   .ng-clear-wrapper[_ngcontent-%COMP%]:focus   .ng-clear[_ngcontent-%COMP%]{color:#d0021b}.ng-select[_ngcontent-%COMP%]   .ng-clear-wrapper[_ngcontent-%COMP%]:focus{outline:none}.ng-select[_ngcontent-%COMP%]   .ng-spinner-zone[_ngcontent-%COMP%]{padding:5px 5px 0 0}[dir=rtl][_ngcontent-%COMP%]   .ng-select[_ngcontent-%COMP%]   .ng-spinner-zone[_ngcontent-%COMP%]{padding:5px 0 0 5px}.ng-select[_ngcontent-%COMP%]   .ng-arrow-wrapper[_ngcontent-%COMP%]{width:25px;padding-right:5px}[dir=rtl][_ngcontent-%COMP%]   .ng-select[_ngcontent-%COMP%]   .ng-arrow-wrapper[_ngcontent-%COMP%]{padding-left:5px;padding-right:0}.ng-select[_ngcontent-%COMP%]   .ng-arrow-wrapper[_ngcontent-%COMP%]:hover   .ng-arrow[_ngcontent-%COMP%]{border-top-color:#666}.ng-select[_ngcontent-%COMP%]   .ng-arrow-wrapper[_ngcontent-%COMP%]   .ng-arrow[_ngcontent-%COMP%]{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px}.ng-dropdown-panel[_ngcontent-%COMP%]{background-color:#fff;border:1px solid #ccc;box-shadow:0 1px #0000000f;left:0}.ng-dropdown-panel.ng-select-top[_ngcontent-%COMP%]{bottom:100%;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-color:#e6e6e6;margin-bottom:-1px}.ng-dropdown-panel.ng-select-top[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option[_ngcontent-%COMP%]:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.ng-dropdown-panel.ng-select-right[_ngcontent-%COMP%]{left:100%;top:0;border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-bottom-color:#e6e6e6;margin-bottom:-1px}.ng-dropdown-panel.ng-select-right[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option[_ngcontent-%COMP%]:first-child{border-top-right-radius:4px}.ng-dropdown-panel.ng-select-bottom[_ngcontent-%COMP%]{top:100%;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top-color:#e6e6e6;margin-top:-1px}.ng-dropdown-panel.ng-select-bottom[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option[_ngcontent-%COMP%]:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.ng-dropdown-panel.ng-select-left[_ngcontent-%COMP%]{left:-100%;top:0;border-top-left-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-bottom-color:#e6e6e6;margin-bottom:-1px}.ng-dropdown-panel.ng-select-left[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option[_ngcontent-%COMP%]:first-child{border-top-left-radius:4px}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-header[_ngcontent-%COMP%]{border-bottom:1px solid #ccc;padding:5px 7px}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-footer[_ngcontent-%COMP%]{border-top:1px solid #ccc;padding:5px 7px}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-optgroup[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;padding:8px 10px;font-weight:500;color:#0000008a;cursor:pointer}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-optgroup.ng-option-disabled[_ngcontent-%COMP%]{cursor:default}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-optgroup.ng-option-marked[_ngcontent-%COMP%]{background-color:#f5faff}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-optgroup.ng-option-selected[_ngcontent-%COMP%], .ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-optgroup.ng-option-selected.ng-option-marked[_ngcontent-%COMP%]{color:#0000008a;background-color:#ebf5ff;font-weight:600}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option[_ngcontent-%COMP%]{background-color:#fff;color:#000000de;padding:8px 10px}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option.ng-option-selected[_ngcontent-%COMP%], .ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option.ng-option-selected.ng-option-marked[_ngcontent-%COMP%]{color:#333;background-color:#ebf5ff}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option.ng-option-selected[_ngcontent-%COMP%]   .ng-option-label[_ngcontent-%COMP%], .ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option.ng-option-selected.ng-option-marked[_ngcontent-%COMP%]   .ng-option-label[_ngcontent-%COMP%]{font-weight:600}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option.ng-option-marked[_ngcontent-%COMP%]{background-color:#f5faff;color:#333}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option.ng-option-disabled[_ngcontent-%COMP%]{color:#ccc}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option.ng-option-child[_ngcontent-%COMP%]{padding-left:22px}[dir=rtl][_ngcontent-%COMP%]   .ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option.ng-option-child[_ngcontent-%COMP%]{padding-right:22px;padding-left:0}.ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option[_ngcontent-%COMP%]   .ng-tag-label[_ngcontent-%COMP%]{font-size:80%;font-weight:400;padding-right:5px}[dir=rtl][_ngcontent-%COMP%]   .ng-dropdown-panel[_ngcontent-%COMP%]   .ng-dropdown-panel-items[_ngcontent-%COMP%]   .ng-option[_ngcontent-%COMP%]   .ng-tag-label[_ngcontent-%COMP%]{padding-left:5px;padding-right:0}[dir=rtl][_ngcontent-%COMP%]   .ng-dropdown-panel[_ngcontent-%COMP%]{direction:rtl;text-align:right}.ng-select.custom[_ngcontent-%COMP%]{border:0px;min-height:0px;border-radi
1us:0}.ng-select.custom[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]{min-height:0px;border-radius:0}.ng-select.custom[_ngcontent-%COMP%]   .ng-select-container[_ngcontent-%COMP%]   .ng-value-container[_ngcontent-%COMP%]{display:flex;align-items:center!important}.ng-select.custom[_ngcontent-%COMP%]     .ng-select-container{min-height:0px;max-height:30px;border-radius:6px;line-height:normal}.ng-select.custom[_ngcontent-%COMP%]     .ng-has-value .ng-value-container .ng-placeholder{display:none}.ng-select.custom[_ngcontent-%COMP%]     .ng-has-value .ng-value-container{border:0}.ng-select.open[_ngcontent-%COMP%]   .ng-placeholder[_ngcontent-%COMP%]{display:none}.pathway_select[_ngcontent-%COMP%]{display:flex}.pathway_select[_ngcontent-%COMP%]   .dropdown_box[_ngcontent-%COMP%]{width:70%}.pathway-assignment-table[_ngcontent-%COMP%]{height:410px;width:100%}"],changeDetection:0});}return a;})();var k=function(a){return a.IN="in",a.NOT_IN="notin",a;}(k||{}),C=r(13618),B=r(94583),ge=r(62701),Y=r(63346),u=r(30802),he=r(50026),U=r(71776),_=r(96481),me=r(85793),F=function(a){return a.Medication="medication",a.TherapeuticClass="therapeuticClass",a;}(F||{}),f=function(a){return a[a.CREATE=0]="CREATE",a[a.EDIT=1]="EDIT",a;}(f||{}),fe=r(53676);let N=(()=>{class a{constructor(t,n,i){this.httpClient=t,this.appConfig=n,this.sessionService=i,this.medListDetailEvent=new U.BehaviorSubject({}),this.medListDetailEvent$=this.medListDetailEvent.asObservable();}saveMedList(t){const n=this.sessionService.session.getPracticeId();if(!n)return(0,U.throwError)(new Error("practiceId is required"));const i=this.buildAddMedListPayload(t,n);return this.httpClient.post(`${this.appConfig.apiUrl}/medlist/add`,i).pipe((0,_.T)(l=>{if((0,u.CN)(l.status.code))throw new Error(l.status.message);return l.medListId;}));}updateMedList(t){delete t.practiceId;const n=this.getMedListDetails(t.medListDetails),i={medList:{...t,...(void 0!==n&&{medListDetails:n})}};return this.httpClient.post(`${this.appConfig.apiUrl}/medlist/update`,i).pipe((0,_.T)(l=>{if((0,u.CN)(l.status.code))throw new Error(l.status.message);return l.medList;}));}buildAddMedListPayload(t,n){const i=this.getMedListDetails(t.medListDetails);return{medList:{name:t.name,...(void 0!==t.description&&{description:t.description}),...(void 0!==i&&{medListDetails:i}),practiceId:n}};}getMedListDetails(t){if(t)return t.reduce((n,i)=>(i.type===F.Medication?n.drugIds?.push(i.drugId):n.etcIds?.push(i.etcId),n),{drugIds:[],etcIds:[]});}getPracticeId(){return{practiceId:this.sessionService.session.getPracticeId()};}searchByPractice(){const t={practiceId:this.sessionService.session.getPracticeId(),omitMedListDetails:!0};return this.getMedListSearch(t);}getMedListByMedListId(t){return this.getMedListSearch({medListId:t,omitMedListDetails:!1}).pipe((0,_.T)(i=>i.medListFetchResults?.[0]));}getMedListSearch(t){return this.httpClient.post(`${this.appConfig.apiUrl}/medlist/search`,t).pipe((0,_.T)(n=>{if((0,u.CN)(n.status.code))throw new Error(n.status.message);return n;}));}deleteMedList(t){return this.httpClient.post(`${this.appConfig.apiUrl}/medlist/delete`,t).pipe((0,_.T)(i=>{if(this.hasPathwaysAssociated(i))return{hasPathwaysAssociated:!0,usedByPathwayCount:this.getUsedbyPathwayCount(i)};if((0,u.CN)(i?.status?.code))throw new Error(i.status.message);return{hasPathwaysAssociated:!1};}));}hasPathwaysAssociated(t){const n=t?.status?.code;return(0,u.CN)(n)&&n===u.V7.PATHWAYS_MEDLIST_ASSOCIATED;}getUsedbyPathwayCount(t){const n=t.status.message.match(/UsedByPathwayCount = (\d+)/);return n?Number(n[1]):0;}previewUploadFile(t){const n=new FormData();return n.append("file",t),this.httpClient.post(`${this.appConfig.apiUrl}/medlist/upload/preview`,n).pipe((0,_.T)(o=>
1{if(this.isMaximumFileItemsExceeded(o.status.code))return o.exceedLimit=!0,o;if(this.isFileTemplateInvalid(o.status.code))return o.invalidTemplate=!0,o;if((0,u.CN)(o.status.code))throw new Error(o.status.message);return o;}));}isMaximumFileItemsExceeded(t){return t===u.V7.MEDLIST_UPLOAD_PREVIEW_MAXIMUM_RECORDS;}isFileTemplateInvalid(t){return t===u.V7.MEDLIST_UPLOAD_INVALID_TEMPLATE;}createMedListDetail(t){this.medListDetailEvent.next({action:f.CREATE,maximumRecordsInMedList:t});}editMedListDetails(t,n){this.medListDetailEvent.next({action:f.EDIT,medList:t,maximumRecordsInMedList:n});}deleteMedListDrug(t){return this.httpClient.post(`${this.appConfig.apiUrl}/medlist/drug/delete`,t).pipe((0,_.T)(i=>{if((0,u.CN)(i?.status?.code))throw new Error(i.status.message);return i;}));}downloadTemplate(){return this.httpClient.get(`${this.appConfig.apiUrl}/drug/download/template`,{responseType:"text"}).pipe((0,_.T)(t=>this.handleCsvFileResponse(t)));}downloadMedList(t){const n=this.sessionService.session.idToString(t);return this.httpClient.get(`${this.appConfig.apiUrl}/drug/download/${n}`,{responseType:"text"}).pipe((0,_.T)(i=>this.handleCsvFileResponse(i)));}handleCsvFileResponse(t){const n=this.tryToParseOrcaResponse(t);return n&&this.handleOrcaResponse(n),new Blob([t],{type:"text/csv"});}tryToParseOrcaResponse(t){let n;try{n=JSON.parse(t);}catch{return;}return n;}handleOrcaResponse(t){throw(0,u.CN)(t?.status?.code)?new Error(t.status.message):new Error("Invalid response from server");}static#_=this.ɵfac=function(n){return new(n||a)(e.KVO(fe.Qq),e.KVO(he.o),e.KVO(me.Q));};static#_2=this.ɵprov=e.jDH({token:a,factory:a.ɵfac,providedIn:"root"});}return a;})();var z=r(19263),ye=r(23400);function we(a,s){1&a&&(e.j41(0,"div",56),e.EFF(1," Please correct all errors on this form. "),e.k0s());}function be(a,s){1&a&&(e.j41(0,"div",57),e.EFF(1," Please provide a pathway name. "),e.k0s());}function Ce(a,s){1&a&&(e.j41(0,"div",57),e.EFF(1," Pathway name cannot exceed 100 characters. "),e.k0s());}function _e(a,s){1&a&&(e.j41(0,"div",57),e.EFF(1," Pathway name can only contain letters, numbers, spaces, as well as special characters: '&', '#', '%','.', ',', '+', '/', '(', ')', '-'. "),e.k0s());}const ve=function(a){return{"text-muted":a};};function Pe(a,s){if(1&a&&(e.j41(0,"ng-option",60)(1,"span",61),e.EFF(2),e.k0s()()),2&a){const t=s.$implicit;e.Y8G("value",t.value)("disabled",!t.enabled),e.R7$(1),e.Y8G("ngClass",e.eq3(4,ve,!t.enabled)),e.R7$(1),e.JRh(t.display);}}const M=function(a){return{error:a};};function Me(a,s){if(1&a&&(e.j41(0,"ng-select",58),e.DNE(1,Pe,3,6,"ng-option",59),e.k0s()),2&a){const t=e.XpG(2);e.Y8G("ngClass",e.eq3(3,M,(null==t.pathwayForm.controls.rule?null:t.pathwayForm.controls.rule.invalid)&&((null==t.pathwayForm.controls.rule||null==t.pathwayForm.controls.rule.errors?null:t.pathwayForm.controls.rule.errors.ruleTypeInvalid)||(null==t.pathwayForm.controls.rule?null:t.pathwayForm.controls.rule.dirty)||(null==t.pathwayForm.controls.rule?null:t.pathwayForm.controls.rule.touched))))("clearable",!1),e.R7$(1),e.Y8G("ngForOf",t.ruleOptions);}}function Oe(a,s){1&a&&(e.j41(0,"div",62),e.EFF(1," Please select an action type. "),e.k0s());}function Fe(a,s){1&a&&(e.j41(0,"div",63),e.EFF(1," Action type not enabled. Please update to enable Pathway. "),e.k0s());}function De(a,s){1&a&&(e.j41(0,"div",64),e.EFF(1," Please provide a selection. "),e.k0s());}function Te(a,s){1&a&&(e.j41(0,"div",65),e.EFF(1," A medication list selection is required. "),e.k0s());}function Se(a,s){if(1&a&&(e.j41(0,"ng-option",66),e.nrm(1,"df-pathways-icon",67),e.EFF(2),e.j41(3,"span",68),e.EFF(4),e.k0s()()),2&a){const t=s.$implicit,n=e.XpG(2);let i;e.Y8G("value",t),e.R7$(1),e.Y8G("iconName",t)("color",null==(i=n.pathwayForm.get("toolTipDisplay.color"))?null:i.value),e.R7$(1),e.SpI(" - ",t," "),e.R7$(2),e.JRh(n.colorPickerSelection);}}function Le(a,s){1&a&&(e.j41(0,"div",69),e.EFF(1," Please select an icon. "),e.k0s());}function Ie(a,s){1&a&&(e.j41(0,"div",70),e.EFF(1," Please select an icon color. "),e.k0s());}function Ee(a,s){1&a&&(e.j41(0,"div",71),e.EFF(1," Please enter a tooltip title. "),e.k0s());}function Re(a,s){1&a&&(e.j41(0,"div",72),e.EFF(1," Tooltip Title c
1annot exceed 100 characters. "),e.k0s());}function xe(a,s){1&a&&(e.j41(0,"div",73),e.EFF(1," Tooltip Text cannot exceed 300 characters. "),e.k0s());}const ke=function(){return[];};function Ne(a,s){if(1&a){const t=e.RV6();e.j41(0,"form",1),e.bIt("ngSubmit",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.save());}),e.j41(1,"div",2)(2,"div",3)(3,"a",4),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.cancel());}),e.EFF(4,"Search"),e.k0s(),e.EFF(5," / Pathway Details "),e.k0s(),e.j41(6,"div",5)(7,"ul")(8,"li"),e.EFF(9,"Set your Pathway rules, and select a Medication list"),e.k0s(),e.j41(10,"li"),e.EFF(11,"Once saved, Pathways can be applied to Practices and/or Locations"),e.k0s()()()(),e.nrm(12,"hr"),e.j41(13,"div",6),e.DNE(14,we,2,0,"div",7),e.k0s(),e.j41(15,"div",8)(16,"div",9)(17,"fieldset",10)(18,"legend"),e.EFF(19,"Pathway Details"),e.k0s(),e.j41(20,"div",11)(21,"label",12),e.EFF(22,"Pathway Name"),e.k0s(),e.nrm(23,"input",13),e.DNE(24,be,2,0,"div",14),e.DNE(25,Ce,2,0,"div",14),e.DNE(26,_e,2,0,"div",14),e.k0s(),e.j41(27,"div",15)(28,"label",16),e.EFF(29,"Type"),e.k0s(),e.DNE(30,Me,2,5,"ng-select",17),e.DNE(31,Oe,2,0,"div",18),e.DNE(32,Fe,2,0,"div",19),e.k0s(),e.j41(33,"div",20)(34,"div",9)(35,"div",21)(36,"label",22),e.EFF(37,"When medication"),e.k0s(),e.nrm(38,"ng-select",23),e.DNE(39,De,2,0,"div",24),e.k0s()(),e.j41(40,"div",25)(41,"div",26)(42,"label",27),e.EFF(43,"Medication List"),e.k0s(),e.nrm(44,"ng-select",28),e.DNE(45,Te,2,0,"div",29),e.k0s()()()()(),e.j41(46,"div",9)(47,"fieldset",30)(48,"legend"),e.EFF(49,"Tooltip Icon"),e.k0s(),e.j41(50,"div",31)(51,"label",12),e.EFF(52,"Icon"),e.k0s(),e.j41(53,"div",32)(54,"ng-select",33),e.DNE(55,Se,5,5,"ng-option",34),e.k0s()(),e.DNE(56,Le,2,0,"div",35),e.k0s(),e.j41(57,"div",36)(58,"label",16),e.EFF(59,"Icon Color"),e.k0s(),e.j41(60,"input",37),e.bIt("colorPickerChange",function(i){e.eBV(t);const o=e.XpG();return e.Njj(o.colorPickerSelection=i);})("colorPickerChange",function(){e.eBV(t);const i=e.XpG();let o;return e.Njj(null==(o=i.pathwayForm.get("toolTipDisplay.color"))?null:o.setValue(i.colorPickerSelection));}),e.k0s(),e.DNE(61,Ie,2,0,"div",38),e.k0s()()(),e.j41(62,"div",9)(63,"fieldset",39)(64,"legend"),e.EFF(65,"Tooltip Display"),e.k0s(),e.j41(66,"div",40)(67,"label",12),e.EFF(68,"Tooltip Title"),e.k0s(),e.nrm(69,"input",41),e.j41(70,"div",42),e.EFF(71),e.k0s(),e.DNE(72,Ee,2,0,"div",43),e.DNE(73,Re,2,0,"div",44),e.k0s(),e.j41(74,"div",45)(75,"label",46),e.EFF(76,"Tooltip Text"),e.k0s(),e.nrm(77,"textarea",47),e.j41(78,"div",48),e.EFF(79),e.k0s(),e.DNE(80,xe,2,0,"div",49),e.k0s()()()(),e.nrm(81,"hr"),e.j41(82,"div",50)(83,"div",51)(84,"button",52),e.EFF(85,"Save"),e.k0s(),e.j41(86,"button",53),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.cancel());}),e.EFF(87," Cancel "),e.k0s()()(),e.j41(88,"footer",54)(89,"div",8)(90,"div",51)(91,"p",55)(92,"strong"),e.EFF(93,"*"),e.k0s(),e.EFF(94," You are responsible for ensuring the validity, accuracy, safety, and propriety of any user-generated decision support. DrFirst shall have no liability to you, your organization, or third-parties, arising out of or related to your use or creation of user-generated decision support. "),e.k0s()()()()();}if(2&a){const t=e.XpG();let n,i,o,l,g,h,m,v,T,O;e.Y8G("formGroup",t.pathwayForm),e.R7$(14),e.Y8G("ngIf",t.pathwayForm.invalid&&t.submitted),e.R7$(9),e.Y8G("ngClass",e.eq3(34,M,(null==t.pathwayForm.controls.name?null:t.pathwayForm.controls.name.invalid)&&((null==t.pathwayForm.controls.name?null:t.pathwayForm.controls.name.dirty)||(null==t.pathwayForm.controls.name?null:t.pathwayForm.controls.name.touched)||t.submitted))),e.R7$(1),e.Y8G("ngIf",(null==t.pathwayForm.controls.name||null==t.pathwayForm.controls.name.errors?null:t.pathwayForm.controls.name.errors.required)&&((null==t.pathwayForm.controls.name?null:t.pathwayForm.controls.name.dirty)||(null==t.pathwayForm.controls.name?null:t.pathwayForm.controls.name.touched))
1),e.R7$(1),e.Y8G("ngIf",(null==t.pathwayForm.controls.name||null==t.pathwayForm.controls.name.errors?null:t.pathwayForm.controls.name.errors.maxlength)&&((null==t.pathwayForm.controls.name?null:t.pathwayForm.controls.name.dirty)||(null==t.pathwayForm.controls.name?null:t.pathwayForm.controls.name.touched))),e.R7$(1),e.Y8G("ngIf",null==t.pathwayForm.controls.name||null==t.pathwayForm.controls.name.errors?null:t.pathwayForm.controls.name.errors.patternInvalid),e.R7$(4),e.Y8G("ngIf",t.ruleOptions),e.R7$(1),e.Y8G("ngIf",(null==t.pathwayForm.controls.rule||null==t.pathwayForm.controls.rule.errors?null:t.pathwayForm.controls.rule.errors.required)&&((null==t.pathwayForm.controls.rule?null:t.pathwayForm.controls.rule.dirty)||(null==t.pathwayForm.controls.rule?null:t.pathwayForm.controls.rule.touched))),e.R7$(1),e.Y8G("ngIf",null==t.pathwayForm.controls.rule||null==t.pathwayForm.controls.rule.errors?null:t.pathwayForm.controls.rule.errors.ruleTypeInvalid),e.R7$(6),e.Y8G("items",t.operatorOptions)("ngClass",e.eq3(36,M,(null==t.pathwayForm.controls.operator?null:t.pathwayForm.controls.operator.invalid)&&((null==t.pathwayForm.controls.operator?null:t.pathwayForm.controls.operator.dirty)||(null==t.pathwayForm.controls.operator?null:t.pathwayForm.controls.operator.touched))
1))("clearable",!1),e.R7$(1),e.Y8G("ngIf",(null==t.pathwayForm.controls.operator||null==t.pathwayForm.controls.operator.errors?null:t.pathwayForm.controls.operator.errors.required)&&((null==t.pathwayForm.controls.operator?null:t.pathwayForm.controls.operator.dirty)||(null==t.pathwayForm.controls.operator?null:t.pathwayForm.controls.operator.touched))),e.R7$(5),e.Y8G("items",t.medListOptions||e.lJ4(38,ke))("compareWith",t.compareMedListIds)("ngClass",e.eq3(39,M,(null==t.pathwayForm.controls.medListId?null:t.pathwayForm.controls.medListId.invalid)&&((null==t.pathwayForm.controls.medListId?null:t.pathwayForm.controls.medListId.dirty)||(null==t.pathwayForm.controls.medListId?null:t.pathwayForm.controls.medListId.touched))))("clearable",!1),e.R7$(1),e.Y8G("ngIf",(null==t.pathwayForm.controls.medListId||null==t.pathwayForm.controls.medListId.errors?null:t.pathwayForm.controls.medListId.errors.required)&&((null==t.pathwayForm.controls.medListId?null:t.pathwayForm.controls.medListId.dirty)||(null==t.pathwayForm.controls.medListId?null:t.pathwayForm.controls.medListId.touched))),e.R7$(9),e.Y8G("ngClass",e.eq3(41,M,(null==(n=t.pathwayForm.get("toolTipDisplay.icon"))?null:n.invalid)&&((null==(n=t.pathwayForm.get("toolTipDisplay.icon"))?null:n.dirty)||(null==(n=t.pathwayForm.get("toolTipDisplay.icon"))?null:n.touched))))("clearable",!1),e.R7$(1),e.Y8G("ngForOf",t.iconOptions),e.R7$(1),e.Y8G("ngIf",(null==(i=t.pathwayForm.get("toolTipDisplay.icon"))||null==i.errors?null:i.errors.required)&&((null==(i=t.pathwayForm.get("toolTipDisplay.icon"))?null:i.dirty)||(null==(i=t.pathwayForm.get("toolTipDisplay.icon"))?null:i.touched))),e.R7$(4),e.xc7("background",null==(o=t.pathwayForm.get("toolTipDisplay.color"))?null:o.value),e.Y8G("colorPicker",t.colorPickerSelection)("ngClass",e.eq3(43,M,(null==(l=t.pathwayForm.get("toolTipDisplay.color"))?null:l.invalid)&&((null==(l=t.pathwayForm.get("toolTipDisplay.color"))?null:l.dirty)||(null==(l=t.pathwayForm.get("toolTipDisplay.color"))?null:l.touched)))),e.R7$(1),e.Y8G("ngIf",(null==(g=t.pathwayForm.get("toolTipDisplay.color"))||null==g.errors?null:g.errors.required)&&((null==(g=t.pathwayForm.get("toolTipDisplay.color"))?null:g.dirty)||(null==(g=t.pathwayForm.get("toolTipDisplay.color"))?null:g.touched))
1),e.R7$(8),e.Y8G("ngClass",e.eq3(45,M,(null==(h=t.pathwayForm.get("toolTipDisplay.title"))?null:h.invalid)&&((null==(h=t.pathwayForm.get("toolTipDisplay.title"))?null:h.dirty)||(null==(h=t.pathwayForm.get("toolTipDisplay.title"))?null:h.touched)))),e.R7$(2),e.SpI(" ",t.getTooltipTitleLength()," / 50 "),e.R7$(1),e.Y8G("ngIf",(null==(m=t.pathwayForm.get("toolTipDisplay.title"))||null==m.errors?null:m.errors.required)&&((null==(m=t.pathwayForm.get("toolTipDisplay.title"))?null:m.dirty)||(null==(m=t.pathwayForm.get("toolTipDisplay.title"))?null:m.touched))),e.R7$(1),e.Y8G("ngIf",(null==(v=t.pathwayForm.get("toolTipDisplay.title"))||null==v.errors?null:v.errors.maxlength)&&((null==(v=t.pathwayForm.get("toolTipDisplay.title"))?null:v.dirty)||(null==(v=t.pathwayForm.get("toolTipDisplay.title"))?null:v.touched)||t.submitted)),e.R7$(4),e.Y8G("ngClass",e.eq3(47,M,(null==(T=t.pathwayForm.get("toolTipDisplay.text"))?null:T.invalid)&&((null==(T=t.pathwayForm.get("toolTipDisplay.text"))?null:T.dirty)||(null==(T=t.pathwayForm.get("toolTipDisplay.text"))?null:T.touched)))),e.R7$(2),e.SpI(" ",t.getTooltipTextLength()," / 300 "),e.R7$(1),e.Y8G("ngIf",(null==(O=t.pathwayForm.get("toolTipDisplay.text"))||null==O.errors?null:O.errors.maxlength)&&((null==(O=t.pathwayForm.get("toolTipDisplay.text"))?null:O.dirty)||(null==(O=t.pathwayForm.get("toolTipDisplay.text"))?null:O.touched)||t.submitted));}}let Ae=(()=>{class a{constructor(t,n,i){this.pathwaysService=t,this.medListService=n,this.notifierService=i,this.pathway=null,this.doClose=new e.bkB(),this.submitted=!1,this.initialized=!1,this.colorPickerSelection="",this.IPathwayIconName=B.U,this.faInfoCircle=ge.iW_,this.operatorOptions=[{value:k.IN,display:"Is in"},{value:k.NOT_IN,display:"Is NOT in"}],this.VALID_NAME_PATTERN=/^[a-zA-Z0-9\n&#%.,+\\/()\- ]*$/,this.iconOptions=Object.keys(B.U).filter(o=>isNaN(Number(o))).map(o=>o).sort(),this.pathwayForm=new d.gE({name:new d.MJ("",[d.k0.required,this.charValidator(this.VALID_NAME_PATTERN)]),rule:new d.MJ("",[d.k0.required,this.ruleTypeValidator()]),operator:new d.MJ(k.IN,d.k0.required),medListId:new d.MJ("",d.k0.required),toolTipDisplay:new d.gE({text:new d.MJ(""),color:new d.MJ("",d.k0.required),icon:new d.MJ("",d.k0.required),title:new d.MJ("",d.k0.required)})}),this.ruleOptions=this.getRuleOptions();}ngOnInit(){this.setMedListOptions().pipe((0,Y.M)(()=>{this.pathway&&this.pathwayForm.patchValue(this.pathway);})).subscribe(()=>{this.initialized=!0;});}ngOnChanges(t){t.pathway&&this.pathwayForm.patchValue(t.pathway.currentValue);}save(){if(this.submitted=!0,this.pathwayForm?.valid){const t=this.pathwayForm.value;this.pathway?.pathwayId&&(t.pathwayId=this.pathway.pathwayId),(this.pathway?.pathwayId?this.pathwaysService.updatePathway(t):this.pathwaysService.savePathway(t)).subscribe(i=>{i?.status?.code===u.V7.SUCCESS?(this.showNotificationMessage("success",`Pathway ${t.name} saved successfully.`),this.doClose.emit()):this.showNotificationMessage("error","Failed to save pathway. Please try again.");});}else this.pathwayForm.markAllAsTouched();}cancel(){this.doClose.emit();}compareMedListIds(t,n){return t.value?.simpleId===n?.simpleId;}getTooltipTitleLength(){return this.pathwayForm.get("toolTipDisplay.title")?.value.length||0;}getTooltipTextLength(){return this.pathwayForm.get("toolTipDisplay.text")?.value.length||0;}charValidator(t){return n=>t.test(n.value)?null:{patternInvalid:{value:n.value}};}ruleTypeValidator(){return t=>{const n=t.value,i=this.ruleOptions?.find(o=>o.value===n);return!i||i?.enabled?null:{ruleTypeInvalid:{value:n}};};}getRuleOptions(){return[{value:C.V.TOOLTIP,display:(0,C.Z)(C.V.TOOLTIP),enabled:this.pathwaysService.canSelectTooltipRule(
1)},{value:C.V.BLOCK_PRESCRIBING,display:(0,C.Z)(C.V.BLOCK_PRESCRIBING),enabled:this.pathwaysService.canSelectBlockPrescribingRule()}];}setMedListOptions(){return this.medListService.searchByPractice().pipe((0,Y.M)(t=>{const n=t.medListFetchResults||[];this.medListOptions=n.length?n.reduce((i,o)=>(o.medListId&&i.push({value:o.medListId,display:o.name}),i),[]).sort((i,o)=>i.display.localeCompare(o.display)):[];}));}showNotificationMessage(t,n){this.notifierService.show({type:t,message:n});}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(R.R),e.rXU(N),e.rXU(w.iJ));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathway-details"]],inputs:{pathway:"pathway"},outputs:{doClose:"doClose"},features:[e.OA$],decls:1,vars:1,consts:[["a-id","df-f-pathway-details-form","class","path-details-form form","novalidate","",3,"formGroup","ngSubmit",4,"ngIf"],["a-id","df-f-pathway-details-form","novalidate","",1,"path-details-form","form",3,"formGroup","ngSubmit"],[1,"row","ml-3","mt-3"],[1,"col-md-2"],["href","javascript: void(0);
1","a-id","df-a-pathway-details-menu",3,"click"],[1,"col-md-10"],["a-id","df-e-pathways-form-validations",1,"row","m-3","validations"],["class","error col-md-12",4,"ngIf"],[1,"row","m-3"],[1,"col-md-4"],["a-id","df-e-pathway-details-fields"],["a-id","df-e-pathway-name",1,"mb-3"],["for","name",1,"form-label","required"],["type","text","id","name","a-id","df-i-pathway-name-field","formControlName","name","maxlength","100","autocomplete","off","required","",1,"form-control",3,"ngClass"],["class","error",4,"ngIf"],["a-id","df-e-pathway-type",1,"mb-3"],["for","type",1,"form-label","required"],["id","type","a-id","df-d-pathway-rule-field","formControlName","rule","bindValue","value","bindLabel","display","required","",3,"ngClass","clearable",4,"ngIf"],["class","error invalid-feedback","a-id","df-e-pathway-rule-required-error",4,"ngIf"],["class","error invalid-feedback","a-id","df-e-pathway-rule-type-invalid-error",4,"ngIf"],[1,"row","subrow"],["a-id","df-e-pathway-operator",1,"mb-3"],["for","operator",1,"form-label","required"],["id","operator","a-id","df-d-pathway-operator-field","formControlName","operator","bindValue","value","bindLabel","display","required","",3,"items","ngClass","clearable"],["class","error invalid-feedback","a-id","df-e-pathway-operator-required-error",4,"ngIf"],[1,"col-md-8","med-list-section"],["a-id","df-e-med-list",1,"mb-3"],["for","med-list",1,"form-label","required"],["id","med-list","a-id","df-d-med-list-field","formControlName","medListId","bindValue","value","bindLabel","display","required","",3,"items","compareWith","ngClass","clearable"],["class","error invalid-feedback","a-id","df-e-med-list-required-error",4,"ngIf"],["a-id","df-e-pathway-icon-fields","formGroupName","toolTipDisplay"],["a-id","df-e-pathway-icon",1,"mb-3"],[1,"icon-container"],["id","icon","a-id","df-d-pathway-icon-field","formControlName","icon","required","",3,"ngClass","clearable"],[3,"value",4,"ngFor","ngForOf"],["class","error invalid-feedback","a-id","df-e-pathway-icon-required-error",4,"ngIf"],["a-id","df-l-pathway-icon-color",1,"mb-3"],["a-id","df-i-pathway-icon-color-field","formControlName","color","autocomplete","off","required","","readonly","",1,"form-control","icon-color-field",3,"colorPicker","ngClass","colorPickerChange"],["class","error invalid-feedback","a-id","df-e-pathway-icon-color-required-error",4,"ngIf"],["a-id","df-e-pathway-tooltip-fields","formGroupName","toolTipDisplay"],["a-id","df-e-pathway-tooltip-title",1,"mb-3"],["type","text","id","tooltipTitle","a-id","df-i-pathway-tooltip-title-field","formControlName","title","maxlength","50","autocomplete","off","required","",1,"form-control",3,"ngClass"],["a-id","df-e-pathway-tooltip-title-count",1,"error","word-count"],["class","error invalid-feedback","a-id","df-e-pathway-tooltip-title-required-error",4,"ngIf"],["class","error invalid-feedback","a-id","df-e-pathway-tooltip-title-max-length-error",4,"ngIf"],["a-id","df-e-pathway-tooltip-text",1,"mb-3"],["for","name",1,"form-label"],["id","tooltipText","a-id","df-e-pathway-tooltip-text-field","rows","5","maxlength","300","formControlName","text",1,"form-control",3,"ngClass"],["a-id","df-e-pathway-tooltip-text-count",1,"error","word-count"],["class","error invalid-feedback","a-id","df-e-pathway-tooltip-text-max-length-error",4,"ngIf"],["a-id","df-b-pathway-buttons","id","button-bar",1,"row","ml-3","pb-1"],[1,"col-md-12"],["type","submit","a-id","df-b-pathway-save-button",1,"btn","btn-primary"],["type","button","a-id","df-b-pathway-cancel-button",1,"btn",3,"click"],["a-id","df-e-pathway-detail
1s-footer"],["a-id","df-e-pathway-disclaimer"],[1,"error","col-md-12"],[1,"error"],["id","type","a-id","df-d-pathway-rule-field","formControlName","rule","bindValue","value","bindLabel","display","required","",3,"ngClass","clearable"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"value","disabled"],[3,"ngClass"],["a-id","df-e-pathway-rule-required-error",1,"error","invalid-feedback"],["a-id","df-e-pathway-rule-type-invalid-error",1,"error","invalid-feedback"],["a-id","df-e-pathway-operator-required-error",1,"error","invalid-feedback"],["a-id","df-e-med-list-required-error",1,"error","invalid-feedback"],[3,"value"],[3,"iconName","color"],[2,"display","none"],["a-id","df-e-pathway-icon-required-error",1,"error","invalid-feedback"],["a-id","df-e-pathway-icon-color-required-error",1,"error","invalid-feedback"],["a-id","df-e-pathway-tooltip-title-required-error",1,"error","invalid-feedback"],["a-id","df-e-pathway-tooltip-title-max-length-error",1,"error","invalid-feedback"],["a-id","df-e-pathway-tooltip-text-max-length-error",1,"error","invalid-feedback"]],template:function(n,i){1&n&&e.DNE(0,Ne,95,49,"form",0),2&n&&e.Y8G("ngIf",i.pathwayForm&&i.initialized);},dependencies:[p.YU,p.Sq,p.bT,d.qT,d.me,d.BC,d.cb,d.YS,d.tU,j.vr,j.xt,d.j4,d.JD,d.$R,z.y,ye.bk],styles:[".rcopia[_ngcontent-%COMP%]   .widget[_ngcontent-%COMP%]   .minifiedWidget[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{border:1px solid var(--rcopia-widget-body-contrast-10, #e6e6e6)}.path-details-form[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]{margin:0}.path-details-form[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .subrow[_ngcontent-%COMP%]{margin-left:-15px}.path-details-form[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .subrow[_ngcontent-%COMP%]   .med-list-section[_ngcontent-%COMP%]{padding-right:0}.path-details-form[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .icon-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:left}.path-details-form[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]   .icon-container[_ngcontent-%COMP%]   ng-select[_ngcontent-%COMP%]{width:90%;margin-right:5px}.path-details-form[_ngcontent-%COMP%]   legend[_ngcontent-%COMP%]{color:var(--rcopia-widget-text-color, #333333);font-size:13px;font-weight:600;margin-bottom:1rem;border-bottom:0}.path-details-form[_ngcontent-%COMP%]   legend[_ngcontent-%COMP%]   .info-icon[_ngcontent-%COMP%]{color:#0081c9}.path-details-form[_ngcontent-%COMP%]   hr[_ngcontent-%COMP%]{border-width:1px}.path-details-form[_ngcontent-%COMP%]   .icon-color-field[_ngcontent-%COMP%]{width:75px;background-color:var(--rcopia-input-background-color, #ffffff);color:var(--rcopia-widget-text-color, #333333)}"]});}return a;})(),je=(()=>{class a{constructor(t,n,i,o,l){this.pathwaysManagementService=t,this.pathwaysService=n,this.notifierService=i,this.changeDetectorRef=o,this.modalService=l,this.pathwayName="";}agInit(t){this.params=t,this.pathwayName=t?.data?.name||"",this.pathwayId=t?.data?.pathwayId,this.detectChanges();}refresh(){return!1;}onEditClick(){const t=this.params?.data;this.pathwaysManagementService.editPathwaysManagementDetails(t);}onDeleteClick(){this.openModal(`Delete ${this.pathwayName}`,`Are you sure you want to delete the <strong>${this.pathwayName}</strong>? This action cannot be undone`,!1).then(t=>{t&&this.deleteSelectedPathway();});}deleteSelectedPathway(){this.pathwaysService.deletePathway({pathwayId:this.pathwayId}).subscribe({next:()=>{this.notifierService.show({type:"success",message:`${this.pathwayName} Pathway is Deleted Successfully`}),this.params?.context?.componentParent?.getPathwayTableData(),this.detectChanges();},error:n=>{n.message.includes("is currently assigned")?this.openDeleteFailureModal(n):this.notifierService.show({type:"error",message:"Unable to  Delete pathway "}),console.log(n);}});}openDeleteFailureModal(t){const n=t.message.substring(t.message.indexOf("to ")+3,t.message.indexOf("locations")-1);this.openModal(`Cannot Delete ${this.pathwayName}`,`<strong>${this.pathwayName}</strong> cannot be deleted at this time as it is currently assigned to <strong>${n}</strong> locations.\n        Modify Pathways Assignments to remove it. Note: It may be associated with locations you can't see due to access restrictions.`,!0);}openModal(t,n,i){const o=this.modalService.open(x.o,{size:"md",centered:!0,backdrop:!1});return o&&(o.componentInstance.modalOptions={title:t,description:n,confirmBtn:!i,closeBtn:!!i}
1),o.result;}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(E),e.rXU(b.RC),e.rXU(w.iJ),e.rXU(e.gRc),e.rXU(c.Bq));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-actions-pathway-table-renderer"]],standalone:!0,features:[e.aNF],decls:10,vars:0,consts:[["a-id","df-b-pathway-edit-pathway-table","type","button",1,"btn","btn-default","btn-sm",3,"click"],[1,"svg","pencil-alt-solid"],["href","#pencil-alt-solid"],["a-id","df-b-pathway-delete-pathway-table","type","button",1,"btn","btn-default","btn-sm",3,"click"],[1,"svg","trash-alt-regular"],["href","#trash-alt-regular"]],template:function(n,i){1&n&&(e.j41(0,"button",0),e.bIt("click",function(){return i.onEditClick();}),e.qSk(),e.j41(1,"svg",1),e.nrm(2,"use",2),e.k0s(),e.joV(),e.j41(3,"span"),e.EFF(4,"Edit"),e.k0s()(),e.j41(5,"button",3),e.bIt("click",function(){return i.onDeleteClick();}),e.qSk(),e.j41(6,"svg",4),e.nrm(7,"use",5),e.k0s(),e.joV(),e.j41(8,"span"),e.EFF(9,"Delete"),e.k0s()());},dependencies:[p.MD],changeDetection:0});}return a;})();function Ue(a,s){if(1&a&&e.nrm(0,"df-pathways-icon",2),2&a){const t=e.XpG();e.Y8G("iconName",t.iconName)("color",t.color);}}let Ge=(()=>{class a{agInit(t){this.iconName=t.data?.toolTipDisplay?.icon,this.color=t.data?.toolTipDisplay?.color;}refresh(){return!1;}static#_=this.ɵfac=function(n){return new(n||a)();};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-icon-pathway-table-renderer"]],decls:2,vars:1,consts:[["a-id","df-e-pathways-icon",1,"badge","pathway-badge"],[3,"iconName","color",4,"ngIf"],[3,"iconName","color"]],template:function(n,i){1&n&&(e.j41(0,"i",0),e.DNE(1,Ue,1,2,"df-pathways-icon",1),e.k0s()),2&n&&(e.R7$(1),e.Y8G("ngIf",i.iconName));},dependencies:[p.bT,z.y],styles:[".rcopia.light-theme[_ngcontent-%COMP%]   .df-danger[_ngcontent-%COMP%]{background-color:#e77502;color:#fff}.rcopia.dark-theme[_ngcontent-%COMP%]   .df-danger[_ngcontent-%COMP%]{background-color:#fd9630;color:#fff}i.badge.pathway-badge[_ngcontent-%COMP%]{background:white;border:1px solid;border-radius:10px;border:1px solid rgba(0,0,0,.2);color:#4d4d4d;margin-right:6px}"]});}return a;})(),$e=(()=>{class a{agInit(t){this.rule=(0,C.Z)(t.data?.rule);}refresh(){return!1;}static#_=this.ɵfac=function(n){return new(n||a)();};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-rule-pathway-table-renderer"]],decls:2,vars:1,consts:[["a-id","df-e-pathway-table-rule"]],template:function(n,i){1&n&&(e.j41(0,"span",0),e.EFF(1),e.k0s()),2&n&&(e.R7$(1),e.JRh(i.rule));}});}return a;})();function Ve(a,s){if(1&a&&(e.j41(0,"span",1),e.EFF(1),e.k0s()),2&a){const t=e.XpG();e.Y8G("ngClass",t.checkNameColor(t.pathway)),e.R7$(1),e.SpI(" ",t.pathway.name," ");}}let Be=(()=>{class a{constructor(t){this.pathwaysService=t,this.pathwayRules=this.pathwaysService.getListOfPathwayRuleTypes();}agInit(t){this.refresh(t);}refresh(t){return this.pathway=t.data,!0;}checkNameColor(t){return this.pathwayRules&&this.pathwayRules.length>0?this.pathwayRules.find(i=>i===t.rule)?"pathway-access-rule":"pathway-not-access-rule":"pathway-access-rule";}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(b.RC));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathway-table-name-renderer"]],standalone:!0,features:[e.aNF],decls:1,vars:1,consts:[[3,"ngClass",4,"ngIf"],[3,"ngClass"]],template:function(n,i){1&n&&e.DNE(0,Ve,2,2,"span",0),2&n&&e.Y8G("ngIf",i.pathway);},dependencies:[p.MD,p.YU,p.bT,c.UN],styles:[".pathway-not-access-rule[_ngcontent-%COMP%]{color:#ef5423}"]});}return a;})();function Ye(a,s){if(1&a&&e.nrm(0,"ag-grid-angular",5),2&a){const t=e.XpG();e.Y8G("rowData",t.pathwayRows)("columnDefs",t.colDefs)("gridOptions",t.gridOptions)("pagination",!0)("suppressRowClickSelection",!0)("paginationPageSize",10)("paginationPageSize",t.defaultPageSize)("paginationPageSizeSelector",t.paginationPageSizeSelector);}}let ze=(()=>{class a{constructor(t,n,i,o,l){this.pathwaysManagementService=t,this.pathwaysService=n,this.changeDetectorRef=i,this.notifierService=o,this.logger=l,this.pathwayRows=[],this.pathwayRows=[],this.gridOptions={},this.colDefs=[],this.defaultPageSize=10,this.paginationPageSizeSelector=[10,20,50,100],this.rowSelection="multiple";}ngOnInit(){this.setColumnDef(),this.setGridOption();}setColumnDef(){this.colDefs=[{headerName:"Pathway Name",field:"name",filter:"agTextColumnFilter",floatingFilter:!0,tooltipField:"name",flex:1,cellRenderer:Be},{headerName:"Pathway Trigger",field:"medListName",filter:"agTextColumnFilter",floatingFilter:!0,width:300,tooltipField:"medListName",cellRenderer:t=>`<span>In medlist: ${t.data.medListName}</span>`},{headerName:"Rule",field:"rule",filter:"agTextColumnFilter",filterParams:{textMatcher:t=>{const n=t.filterText=t.filterText||"",i=(0,C.Z)(t.data?.rule);return i&&i.toLowerCase().indexOf(n.toLowerCase())>=0;}},floatingFilter:!0,tooltipValueGetter:t=>(0,C.Z)(t.data?.rule),cellRenderer:$e},{headerName:"Icon",field:"toolTipDisplay.icon",width:100,filter:"agTextColumnFilter",floatingFilter:!0,tooltipField:"icon",cellRenderer:Ge},{headerName:"Tooltip",filter:"agTextColumnFilter",floatingFilter:!0,flex:1,tooltipValueGetter:t=>this.getTooltipValue(t.data?.toolTipDisplay),valueGetter:t=>this.getTooltipValue(t.data?.toolTipDisplay)},{headerName:"Actions",field:"actions",autoHeight:!0,width:170,cellRenderer:je}];}setGridOption(){const t=this;this.gridOptions={sortingOrder:["asc","desc"],suppressMenuHide:!1,suppressMovableColumns:!0,rowSelection:"multiple",overlayNoRowsTemplate:'<span">
1No records found</span>',context:{componentParent:this},tooltipShowDelay:500,onGridReady(n){n&&n.api&&(t.gridApi=n.api,t.gridApi.showLoadingOverlay(),t.getPathwayTableData());}};}getTooltipValue(t){return`${t?.title}: ${t?.text}`;}getPathwayTableData(){return this.pathwaysService.fetchPathways().subscribe(t=>{this.pathwayRows=t?.results,this.detectChanges();},t=>{this.notifierService.show({type:"error",message:"Unable to load pathways data. Please try again."}),this.logger.$log.error("@Pathways: Failed to load pathways data",t),this.gridApi?.showNoRowsOverlay();});}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}createPathway(){this.pathwaysManagementService.openPathwaysManagementDetails();}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(E),e.rXU(R.R),e.rXU(e.gRc),e.rXU(w.iJ),e.rXU(b.Kc));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathways-management-table"]],decls:8,vars:1,consts:[[1,"content"],[1,"row"],[1,"col"],["a-id","df-t-pathway-management","class","ag-theme-balham pathway-management-table",3,"rowData","columnDefs","gridOptions","pagination","suppressRowClickSelection","paginationPageSize","paginationPageSizeSelector",4,"ngIf"],["a-id","df-b-create-pathway-management",1,"btn","btn-primary","mt-2",3,"click"],["a-id","df-t-pathway-management",1,"ag-theme-balham","pathway-management-table",3,"rowData","columnDefs","gridOptions","pagination","suppressRowClickSelection","paginationPageSize","paginationPageSizeSelector"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.DNE(3,Ye,1,8,"ag-grid-angular",3),e.k0s()(),e.j41(4,"div",1)(5,"div",2)(6,"button",4),e.bIt("click",function(){return i.createPathway();}),e.EFF(7," Create Pathway "),e.k0s()()()()),2&n&&(e.R7$(3),e.Y8G("ngIf",i.gridOptions&&i.colDefs.length));},dependencies:[p.bT,P.xs],styles:[".pathway-management-table[_ngcontent-%COMP%]{height:410px}"],changeDetection:0});}return a;})();function Xe(a,s){1&a&&(e.j41(0,"section",5),e.nrm(1,"df-pathways-management-table"),e.k0s());}function He(a,s){if(1&a){const t=e.RV6();
1e.j41(0,"section",6)(1,"df-pathway-details",7),e.bIt("doClose",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onClosePathDetails());}),e.k0s()();}if(2&a){const t=e.XpG();e.R7$(1),e.Y8G("pathway",t.selectedPathway);}}let Je=(()=>{class a{constructor(t){this.pathwaysManagementService=t,this.selectedPathway=null,this.IPathwayTabView=y,this.activeView=y.SEARCH;}ngOnInit(){this.pathwaysManagementService.switchPathwayManagementTabEvent.subscribe(t=>{this.activeView=t;}),this.pathwaysManagementService.switchPathwayManagementTabEventEdit.subscribe(t=>{this.editPathway(t);});}showPathDetailsForm(t){this.selectedPathway=t,this.activeView=y.PATH_DETAILS;}showSearch(){this.selectedPathway=null,this.activeView=y.SEARCH;}editPathway(t){this.showPathDetailsForm(t);}onClosePathDetails(){this.selectedPathway=null,this.showSearch();}isDetailsView(){return this.activeView===y.PATH_DETAILS;}isTableView(){return this.activeView===y.SEARCH;}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(E));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathways-tab"]],decls:5,vars:2,consts:[["a-id","df-f-pathway-management-tab",1,"content"],[1,"row"],[1,"col"],["a-id","df-t-pathways-management-table","class","px-2 pathways-management-table",4,"ngIf"],["a-id","df-f-pathways-management-details","class","content pathways-management-details",4,"ngIf"],["a-id","df-t-pathways-management-table",1,"px-2","pathways-management-table"],["a-id","df-f-pathways-management-details",1,"content","pathways-management-details"],[3,"pathway","doClose"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.DNE(3,Xe,2,0,"section",3),e.DNE(4,He,2,1,"section",4),e.k0s()()()),2&n&&(e.R7$(3),e.Y8G("ngIf",i.isTableView()),e.R7$(1),e.Y8G("ngIf",i.isDetailsView()));},dependencies:[p.bT,Ae,ze]});}return a;})();var D=function(a){return a.SEARCH="Search",a.MED_LIST_DETAILS="Med List Details",a;}(D||{});let A=(()=>{class a{constructor(){this.switchMedListsTabViewEvent=new e.bkB();}openMedListDetails(){this.switchMedListsTabViewEvent.emit(D.MED_LIST_DETAILS);}openMedListSearch(){this.switchMedListsTabViewEvent.emit(D.SEARCH);}static#_=this.ɵfac=function(n){return new(n||a)();};static#_2=this.ɵprov=e.jDH({token:a,factory:a.ɵfac,providedIn:"root"});}return a;})();var qe=r(32040),We=r(69421);let Ke=(()=>{class a{constructor(t,n){this.modalService=t,this.changeDetectorRef=n;}agInit(t){this.params=t,this.selectedMedListDetail=t?.data,this.detectChanges();}refresh(){return!1;}deleteSelectedMedListDetail(){const t=this.modalService.open(x.o,{size:"md",centered:!0,backdrop:!1});if(t){const n=this.selectedMedListDetail?.type===F.Medication?this.selectedMedListDetail?.brandName:this.selectedMedListDetail?.description;t.componentInstance.modalOptions={title:`Delete ${n}`,description:`Are you sure you want to delete ${n}? This action cannot be undone.`,confirmBtn:!0};}t.result.then(n=>{n&&this.params?.context?.componentParent?.onDeleteMedListDetail(this.selectedMedListDetail);});}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(c.Bq),e.rXU(e.gRc));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-actions-med-list-details-renderer"]],standalone:!0,features:[e.aNF],decls:5,vars:0,consts:[["a-id","df-b-medlist-details-delete","type","button",1,"btn","btn-default","btn-sm",3,"click"],[1,"svg","trash-alt-regular"],["href","#trash-alt-regular"]],template:function(n,i){1&n&&(e.j41(0,"button",0),e.bIt("click",function(){return i.deleteSelectedMedListDetail();}),e.qSk(),e.j41(1,"svg",1),e.nrm(2,"use",2),e.k0s(),e.joV(),e.j41(3,"span"),e.EFF(4,"Delete"),e.k0s()());},dependencies:[p.MD],changeDetection:0});}return a;})();function Ze(a,s){if(1&a&&e.nrm(0,"ag-grid-angular",8),2&a){const t=e.XpG();e.Y8G("rowData",t.medListUploadFailures)("columnDefs",t.colDefs)("gridOptions",t.gridOptions)("suppressRowClickSelection",!0)("pagination",!0)("paginationPageSize",t.defaultPageSize)("paginationPageSizeSelector",t.paginationPageSizeSelector);}}let Qe=(()=>{class a{constructor(t){this.activeModal=t,this.gridOptions={},this.colDefs=[],this.activeModal=t,this.defaultPageSize=10,this.paginationPageSizeSelector=[10,20,50,100],this.medListUploadFailures=[];}ngOnInit(){this.setColumnDef(),this.setGridOption();}setColumnDef(){this.colDefs=[{headerName:"Failed rows",field:"line",filter:"agTextColumnFilter",floatingFilter:!0,width:130},{headerName:"Reason",field:"message",filter:"agTextColumnFilter",floatingFilter:!0,flex:2}];}setGridOption(){const t=this;this.gridOptions={sortingOrder:["asc","desc"],suppressMenuHide:!1,suppressMovableColumns:!0,rowSelection:"multiple",overlayNoRowsTemplate:'<span">
1No records found</span>',onGridReady(n){n&&n.api&&(t.gridApi=n.api);}};}closeModal(){this.activeModal.close();}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(c.Lw));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-upload-failure-modal"]],inputs:{medListUploadFailures:"medListUploadFailures"},standalone:!0,features:[e.aNF],decls:12,vars:1,consts:[["a-id","df-e-pathway-upload-failure-modal",1,"modal-lg","bootstrap5","pathway-upload-failure-modal"],["a-id","df-e-pathway-upload-failure-header",1,"modal-header"],[1,"modal-title"],["a-id","df-e-pathway-upload-failure-body",1,"modal-body"],["a-id","df-t-pathway-upload-failure","class","ag-theme-balham pathway-upload-failure-table",3,"rowData","columnDefs","gridOptions","suppressRowClickSelection","pagination","paginationPageSize","paginationPageSizeSelector",4,"ngIf"],["a-id","df-e-pathway-upload-failure-footer",1,"modal-footer"],[1,"footer-btn"],["a-id","df-b-pathway-upload-failure-close-modal","type","button",1,"btn","btn-default",3,"click"],["a-id","df-t-pathway-upload-failure",1,"ag-theme-balham","pathway-upload-failure-table",3,"rowData","columnDefs","gridOptions","suppressRowClickSelection","pagination","paginationPageSize","paginationPageSizeSelector"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"h4",2),e.EFF(3,"Upload failed"),e.k0s()(),e.j41(4,"div",3)(5,"p"),e.EFF(6," We cannot import your medication list due to the following record errors. Please remove or correct these items and try again. "),e.k0s(),e.DNE(7,Ze,1,7,"ag-grid-angular",4),e.k0s(),e.j41(8,"div",5)(9,"div",6)(10,"button",7),e.bIt("click",function(){return i.closeModal();}),e.EFF(11," Close "),e.k0s()()()()),2&n&&(e.R7$(7),e.Y8G("ngIf",i.gridOptions&&i.colDefs.length));},dependencies:[p.MD,p.bT,c.UN,P.$V,P.xs],styles:[".pathway-upload-failure-modal[_ngcontent-%COMP%]   .pathway-upload-failure-table[_ngcontent-%COMP%]{height:410px}"]});}return a;})(),et=(()=>{class a{constructor(t){this.sessionService=t;}startDisableTimerFor(t,n,i){const o=new Date().getTime()+n;localStorage.setItem(this.getStorageKey(t,i),o.toString());}isDisabledTimerRunning(t,n){const i=localStorage.getItem(this.getStorageKey(t,n));return!!i&&new Date().getTime()<Number(i);}getStorageKey(t,n){const i=this.sessionService.session.getUserSimpleId()||"defaul_user_id";return n?`${i}_${t}_${n}_ButtonDisabledUntil_`:`${i}_${t}_ButtonDisabledUntil_`;}static#_=this.ɵfac=function(n){return new(n||a)(e.KVO(b.Qo));};static#_2=this.ɵprov=e.jDH({token:a,factory:a.ɵfac,providedIn:"root"});}return a;})();var L=function(a){return a.LIST_TEMPLATE="listTemplate",a.CURRENT_MED_LIST="currentMedList",a;}(L||{}),tt=r(77641),nt=r(30927),at=r(7625);let it=(()=>{class a{constructor(t){this.overlay=t,this.overlayRef=null,this.spinnersCount=0;}showSpinner(){this.spinnersCount++,1===this.spinnersCount&&this.createSpinner();}hideSpinner(){this.spinnersCount--,0===this.spinnersCount&&this.overlayRef&&(this.overlayRef.detach(),this.overlayRef=null);}createSpinner(){if(!this.overlayRef){this.overlayRef=this.overlay.create({hasBackdrop:!0,positionStrategy:this.overlay.position().global().centerHorizontally().centerVertically()});const t=new tt.A8(nt.t);this.overlayRef.attach(t);}}static#_=this.ɵfac=function(n){return new(n||a)(e.KVO(at.hJ));};static#_2=this.ɵprov=e.jDH({token:a,factory:a.ɵfac,providedIn:"root"});}return a;})();const ot=["fileUpload"];function st(a,s){1&a&&(e.j41(0,"div",35),e.EFF(1," Please provide a valid Medication List Name. "),e.k0s());}function lt(a,s){1&a&&(e.j41(0,"div",35),e.EFF(1," Pathway Name can only contain letters, numbers, spaces, as well as special characters: '&', '#', '%','.', ',', '+', '/', '(', ')', '-'. "),e.k0s());}function rt(a,s){1&a&&e.nrm(0,"i",39);}function dt(a,s){1&a&&e.nrm(0,"i",40);}function ct(a,s){if(1&a){const t=e.RV6();e.j41(0,"button",36),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDownloadListTemplate());}),e.DNE(1,rt,1,0,"i",37),e.DNE(2,dt,1,0,"i",38),e.EFF(3,"Download Medication List Template "),e.k0s();}if(2&a){const t=e.XpG();e.Y8G("disabled",t.getListTemplateButtonProperties().isDisabled)("ngbPopover",t.getListTemplateButtonProperties().popOverContent),e.R7$(1),e.Y8G("ngIf",t.downloadTemplateInProgress),e.R7$(1),e.Y8G("ngIf",!t.downloadTemplateInProgress);}}function pt(a,s){if(1&a&&(e.j41(0,"div",41)(1,"ul")(2,"li"),e.EFF(3," Mark the first column with M or T for each Medication or Therapeutic Group to include in the list "),e.k0s(),e.j41(4,"li"),e.EFF(5),e.j41(6,"strong"),e.EFF(7,"whether added in bulk by group, or individually"),e.k0s()(),e.j41(8,"li"),e.EFF(9,"Upload your saved file to replace the displayed list"),e.k0s()()()),2&a){const t=e.XpG();e.R7$(5),e.SpI(" Lists can contain up to ",t.maximumRecordsInMedList," medications - ");}}function gt(a,s){1&a&&e.nrm(0,"i",39);}function ht(a,s){1&a&&e.nrm(0,"i",40);}function mt(a,s){if(1&a){const t=e.RV6();e.j41(0,"button",42),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.onDownloadCurrentMedList());}),e.DNE(1,gt,1,0,"i",37),e.DNE(2,ht,1,0,"i",38),e.EFF(3,"Current Med List "),e.k0s();}if(2&a){const t=e.XpG();e.Y8G("disabled",t.getCurrentMedListButtonProperties().isDisabled)("ngbPopover",t.getCurrentMedListButtonProperties().popOverContent),e.R7$(1),e.Y8G("ngIf",t.downloadMedListInProgress),e.R7$(1),e.Y8G("ngIf",!t.downloadMedListInProgress);}}function ut(a,s){if(1&a&&(e.nrm(0,"ag-grid-angular",43),e.nI1(1,"async")),2&a){const t=e.XpG();let n;e.Y8G("rowData",null==(n=e.bMT(1,9,t.medList))?null:n.medListDetails)("columnDefs",t.colDefs)("gridOptions",t.gridOptions)("pagination",!0)("suppressRowClickSelection",!0)("paginationPageSize",t.defaultPageSize)("paginationPageSizeSelector",t.paginationPageSizeSelector)("suppressNoRowsOverlay",!0)("suppressLoadingOverlay",!0);}}const ft=function(a){return{error:a};};let yt=(()=>{class a{constructor(t,n,i,o,l,g,h,m,v){this.appConfig=t,this.medListService=n,this.medListsTabService=i,this.medListDetailsService=o,this.changeDetectorRef=l,this.modalService=g,this.notifierService=h,this.logger=m,this.spinnerService=v,this.VALID_NAME_PATTERN=/^[a-zA-Z0-9&#%.,+\\/()\- ]*$/,this.EMPTY_FILE_ERROR_MESSAGE="No Medications or TherapeuticClasse
1s selected.",this.UPLOAD_ERROR_MESSAGE="Failed to upload file. Please try again later or contact support.",this.DOWNLOAD_TEMPLATE_ERROR_MESSAGE="Failed to download template. Please try again later or contact support.",this.DOWNLOAD_MEDLIST_ERROR_MESSAGE="Failed to download current med list. Please try again later or contact support.",this.INVALID_TEMPLATE_ERROR_MESSAGE="Invalid format. Do not modify the original format. Validate format in medication list template.",this.CURRENT_MEDLIST_FILE_NAME="current_medlist_confidential_and_privileged_do_not_distribute",this.LIST_TEMPLATE_FILE_NAME="medlist_template_confidential_and_privileged_do_not_distribute",this.listTemplateDisableButtonInterval=6e5,this.currentMedListDisableButtonInterval=6e5,this.medList=new U.BehaviorSubject({name:"",medListDetails:[]}),this.isListTemplateButtonVisible=!0,this.isCurrentMedListButtonVisible=!0,this.gridOptions={},this.colDefs=[],this.defaultPageSize=10,this.paginationPageSizeSelector=[10,20,50,100],this.rowSelection="multiple",this.medsAmount=0,this.medListForm=new d.gE({name:new d.MJ(null,[d.k0.required,d.k0.pattern(this.VALID_NAME_PATTERN)]),description:new d.MJ(null)}),this.isSaveButtonDisabled=!1,this.downloadTemplateInProgress=!1,this.downloadMedListInProgress=!1,this.fileName="";}ngOnInit(){this.setColumnDef(),this.setGridOption(),this.subscribeToMedListDetailEvent(),this.setProperties();}setColumnDef(){this.colDefs=[{colId:"type",headerName:"Type",valueGetter:t=>t.data?.type===F.Medication?"Medication":"Therapeutic Group",field:"type",filter:"agTextColumnFilter",filterParams:{caseSensitive:!1},floatingFilter:!0,flex:1,tooltipField:"type"},{colId:"name",headerName:"Name",valueGetter:this.getNameValue,filter:"agTextColumnFilter",filterParams:{caseSensitive:!1},floatingFilter:!0,flex:1,sort:"asc",comparator(t,n,i,o){const l=i.data?.brandName||i.data?.description||"",g=o.data?.brandName||o.data?.description||"";return l?.toLowerCase().localeCompare(g?.toLowerCase());},tooltipValueGetter:this.getNameValue},{colId:"form",headerName:"Form",field:"form",filter:"agTextColumnFilter",filterParams:{caseSensitive:!1},floatingFilter:!0,flex:1,tooltipField:"form"},{colId:"route",headerName:"Route",field:"route",filter:"agTextColumnFilter",filterParams:{caseSensitive:!1},floatingFilter:!0,flex:1,tooltipField:"route"},{colId:"strength",headerName:"Strength",field:"strength",filter:"agTextColumnFilter",filterParams:{caseSensitive:!1},floatingFilter:!0,flex:1,tooltipField:"strength"},{colId:"actions",headerName:"Actions",field:"actions",autoHeight:!0,width:170,cellRenderer:Ke,cellRendererParams:{medlistId:this.medList.value?.medListId??{}}}];}getNameValue(t){return(t.data?.type===F.Medication?t.data?.brandName:`(${t.data?.medCountInTherapeuticClass}) ${t.data?.description}`)||"";}setGridOption(){const t=this;this.gridOptions={sortingOrder:["asc","desc"],suppressMenuHide:!1,suppressMovableColumns:!0,rowSelection:"multiple",overlayNoRowsTemplate:'<span">No records found</span>',context:{componentParent:this},onGridReady(n){n&&n.api&&(t.gridApi=n.api,t.actionType===f.CREATE&&t.gridApi.showNoRowsOverlay(),t.actionType===f.EDIT&&t.gridApi.showLoadingOverlay());}};}subscribeToMedListDetailEvent(){this.medListService.medListDetailEvent$.pipe((0,qe.s)(1)).subscribe(t=>{this.handleMedListDetailEvent(t);});}handleMedListDetailEvent(t){if(this.actionType=t.action,this.maximumRecordsInMedList=t.maximumRecordsInMedList,t.action!==f.EDIT||!t.medList)return t.action===f.CREATE?(this.medList.next({name:"",medListDetails:[]}),void this.medListForm.reset()):void 0;this.updateMedListWithDetails(t.medList);}setProperties(){if(this.appConfig.pathwaysProperties){const{listTemplateDisableButtonInterval:t,currentMedListDisableButtonInterval:n,isListTemplateButtonVisible:i,isCurrentMedListButtonVisible:o}=this.appConfig.pathwaysProperties.medListDetails;this.listTemplateDisableButtonInterval=t,this.currentMedListDisableButtonInterval=n,this.isListTemplateButtonVisible=i,this.isCurrentMedListButtonVisible=o;}else this.logger.warn("@ MedListDetailsComponent.setProperties: pathwaysProperties not found");}
1onSaveMedList(){if(this.medListForm.invalid)return void this.medListForm.markAllAsTouched();let t;return this.medList.next({...this.medList.value,name:this.medListForm.value.name,description:this.medListForm.value.description}),this.actionType===f.CREATE&&(t=this.medListService.saveMedList(this.medList.value)),this.actionType===f.EDIT&&(t=this.medListService.updateMedList(this.medList.value)),t?.subscribe(()=>{this.medListsTabService.openMedListSearch(),this.notifierService.notify("success",`Medication list ${this.actionType===f.CREATE?"created":"updated"} successfully`);},n=>{const i=this.actionType===f.CREATE?"create":"update";this.notifierService.notify("error",`Failed to ${i} medication list. Please try again.`),this.logger.$log.error(`Failed to ${i} medication list`,n);});}onCancel(){this.medListsTabService.openMedListSearch();}onDownloadCurrentMedList(){this.medList.value.medListId?(this.medListDetailsService.startDisableTimerFor(L.CURRENT_MED_LIST,this.currentMedListDisableButtonInterval,this.medList.value.medListId?.simpleId),this.downloadMedListInProgress=!0,this.medListService.downloadMedList(this.medList.value.medListId).subscribe(t=>{this.handleCsvFileDownload(this.CURRENT_MEDLIST_FILE_NAME,t);},t=>{this.logger.$log.error("@ MedListDetailsComponent.onDownloadCurrentMedList: Failed to download current med list",t),this.notifierService.notify("error",this.DOWNLOAD_MEDLIST_ERROR_MESSAGE);},()=>{this.downloadMedListInProgress=!1;})):this.logger.$log.error("@ MedListDetailsComponent.onDownloadCurrentMedList: medListId is required");}onDownloadListTemplate(){this.medListDetailsService.startDisableTimerFor(L.LIST_TEMPLATE,this.listTemplateDisableButtonInterval),this.downloadTemplateInProgress=!0,this.medListService.downloadTemplate().subscribe(t=>{this.handleCsvFileDownload(this.LIST_TEMPLATE_FILE_NAME,t);},t=>{this.logger.$log.error("@ MedListDetailsComponent.onDownloadListTemplate: Failed to download list template",t),this.notifierService.notify("error",this.DOWNLOAD_TEMPLATE_ERROR_MESSAGE);},()=>{this.downloadTemplateInProgress=!1;});}handleCsvFileDownload(t,n){const i=window.URL.createObjectURL(n);this.createAnchorHtmlElement(`${t}.csv`,i).click(),window.URL.revokeObjectURL(i);}createAnchorHtmlElement(t,n){const i=document.createElement("a");return i.href=n,i.download=t,document.body.appendChild(i),i;}getListTemplateButtonProperties(){const t=this.medListDetailsService.isDisabledTimerRunning(L.LIST_TEMPLATE);return{isDisabled:t,popOverContent:t?`Download in process or recently completed. Try again in ${this.listTemplateDisableButtonInterval/6e4} minutes.`:""};}getCurrentMedListButtonProperties(){const t=this.medListDetailsService.isDisabledTimerRunning(L.CURRENT_MED_LIST,this.medList.value?.medListId?.simpleId);return{isDisabled:t||this.actionType===f.CREATE,popOverContent:t?`Download in process or recently completed. Try again in ${this.currentMedListDisableButtonInterval/6e4} minutes.`:""};}onFileUpload(t){this.spinnerService.showSpinner();const n=this.getFile(t);if(this.fileName=n?.name||"",!n)return this.logger.$log.warn("@ MedListDetailsComponent.onFileUpload: Failed to get file from event"),void this.spinnerService.hide
1Spinner();this.medListService.previewUploadFile(n).pipe((0,We.j)(()=>{this.fileUpload.nativeElement.value="",this.spinnerService.hideSpinner();})).subscribe({next:i=>{i?this.handleFileUploadResponse(i):this.logger.$log.warn("@ MedListDetailsComponent.onFileUpload: No response from preview upload file service");},error:i=>{this.isSaveButtonDisabled=!0,this.logger.$log.error("@ MedListDetailsComponent.onFileUpload: Failed to call medListService.previewUploadFile",i),this.notifierService.notify("error",this.UPLOAD_ERROR_MESSAGE);}});}getFile(t){const i=t.target.files;return i&&i.length>0?i[0]:null;}handleFileUploadResponse(t){if(this.isSaveButtonDisabled=!0,0!==t.medListDetails?.length)return t.medListDetails?.length?(this.isSaveButtonDisabled=!1,this.medList.next({...this.medList.value,medListDetails:t.medListDetails||[]}),this.updateMedListTypeAmounts(),void this.medListForm.markAsTouched()):void(t.failures?.length?this.openUploadFailureModal(t.failures):this.notifierService.notify("error",t.exceedLimit?`Uploaded file contains more than ${this.getMedicationsUploadedAmount(t)} medications. Please reduce the total number of medications to be below ${this.maximumRecordsInMedList}.`:t.invalidTemplate?this.INVALID_TEMPLATE_ERROR_MESSAGE:this.UPLOAD_ERROR_MESSAGE));this.notifierService.notify("error",this.EMPTY_FILE_ERROR_MESSAGE);}updateMedListTypeAmounts(){this.medsAmount=0;let t=0;(this.medList.value?.medListDetails||[]).forEach(n=>{t=n.type===F.TherapeuticClass?n.medCountInTherapeuticClass||0:1,this.medsAmount+=t;});}openUploadFailureModal(t){const n=this.modalService.open(Qe,{size:"lg",centered:!0,backdrop:!1});n&&(n.componentInstance.medListUploadFailures=t);}getMedicationsUploadedAmount(t){const i=t.status.message.match(/Uploaded records \((\d+)\)/);return i?Number(i[1]):"";}onDeleteMedListDetail(t){this.medList.next({...this.medList.value,medListDetails:this.medList.value.medListDetails?.filter(n=>n!==t)}),this.detectChanges(),this.updateMedListTypeAmounts(),this.medListForm.markAsTouched();}refreshGrid(t){this.medList.next({...this.medList.value,medListDetails:this.medList.value.medListDetails?.filter(n=>n.drugId?.simpleId!==t?.simpleId)}),this.detectChanges();}updateMedListWithDetails(t){t.medListId&&this.medListService.getMedListByMedListId(t.medListId).subscribe(n=>{n&&(this.medList.next(n),this.medListForm.patchValue({name:this.medList.value.name,description:this.medList.value.description}),this.updateMedListTypeAmounts()),this.detectChanges();});}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(b.oO),e.rXU(N),e.rXU(A),e.rXU(et),e.rXU(e.gRc),e.rXU(c.Bq),e.rXU(w.iJ),e.rXU(b.Kc),e.rXU(it));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-med-list-details"]],viewQuery:function(n,i){if(1&n&&e.GBs(ot,5),2&n){let o;e.mGM(o=e.lsd())&&(i.fileUpload=o.first);}},decls:58,vars:16,consts:[["a-id","df-w-pathway-medlist-details",1,"content","med-list-details"],[1,"row"],[1,"col-md-2"],["href","javascript: void(0);","a-id","df-a-medlist-details-menu",3,"click"],["a-id","df-e-medlist-details-info",1,"col-md-10"],["a-id","df-e-medlist-details-info-1"],[1,"col-lg-3"],["novalidate","",1,"med-list-form",3,"formGroup","ngSubmit"],["a-id","df-e-medlist-details-fields"],[1,"mb-3"],["for","med-list-name",1,"form-label","required"],["formControlName","name","type","text","id","med-list-name","a-id","df-i-medlist-details-name","maxlength","100","autocomplete","off",1,"form-control",3,"ngClass"],["class","error",4,"ngIf"],["for","med-list-description"],["formControlName","description","type","text","id","med-list-description","a-id","df-i-medlist-details-description","autocomplete","off","maxlength","2500",1,"form-control"],["a-id","df-e-medlist-file-upload",1,"mb-3"],["for","med-list-file-upload"],[1,"fileupload-wrapper"],["type","button","a-id","df-b-medlist-details-fileupload",1,"btn","btn-default",3,"click"],["type","text","id","med-list-file-upload","disabled","","a-id","df-i-medlist-details-fileupload",1,"form-control",3,"value"],["type","file","accept",".csv","id","med-list-hidden-file-upload","a-id","df-i-medlist-details-hidden-fileupload","aria-describedby","file-upload-help",1,"hidden-file-upload",3,"change"],["fileUpload",""],["id","df-e-medlist-details-fileupload-help",1,"form-text","fileupload-info"],["a-id","df-b-medlist-download-template"],["a-id","df-b-medlist-details-list-template","class","btn btn-default","type","button","triggers","hover","placement","auto",3,"disabled","ngbPopover","click",4,"ngIf"],["a-id","df-e-medlist-template-info","class","med-list-template-info",4,"ngIf"],["a-id","df-b-medlist-details-save","type","submit",1,"btn","btn-primary",3,"disabled"],["a-id","df-b-medlist-details-cancel","type","button",1,"btn",3,"click"],[1,"col-9","col-lg-9"],[1,"row","mb-2"],[1,"col-6","col-lg-6"],[1,"col-md-6","download-actions"],["a-id","df-b-medlist-details-download-current","class","btn btn-default","type","button","triggers","hover","placement","auto",3,"disabled","ngbPopover","click",4,"ngIf"],[1,"col"],["a-id","df-t-medlist-details-meds","class","ag-theme-balham med-list-table",3,"rowData","columnDefs","gridOptions","pagination","suppressRowClickSelection","paginationPageSize","paginationPageSizeSelector","suppressNoRowsOverlay","suppressLoadingOverlay",4,"ngIf"],[1,"error"],["a-id","df-b-medlist-details-list-template","type","button","triggers","hover","placement","auto",1,"btn","btn-default",3,"disabled","ngbPopover","click"],["class","fa fa-spin fa-spinner mr-1","aria-hidden","true",4,"ngIf"],["class","fa fa-download mr-1","aria-hidden","true",4,"ngIf"],["aria-hidden","true",1,"fa","fa-spin","fa-spinner","mr-1"],["aria-hidden","true",1,"fa","fa-download","mr-1"],["a-id","df-e-medlist-template-info",1,"med-list-template-info"],["a-id","df-b-medlist-details-download-current","type","button","triggers","hover","placement","auto",1,"btn","btn-default",3,"disabled","ngbPopover","click"],["a-id","df-t-medlist-details-meds",1,"ag-theme-balham","med-list-table",3,"rowData","columnDefs","gridOptions","pagination","suppressRowClickSelection","paginationPageSize","paginationPageSizeSelector","suppressNoRowsOverlay","suppressLoadingOverlay"]],template:function(n,i){if
1(1&n){const o=e.RV6();e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"a",3),e.bIt("click",function(){return i.onCancel();}),e.EFF(4,"Search"),e.k0s(),e.EFF(5," / Med List Details "),e.k0s(),e.j41(6,"div",4)(7,"ul")(8,"li",5),e.EFF(9),e.k0s()()()(),e.nrm(10,"hr"),e.j41(11,"div",1)(12,"div",6)(13,"form",7),e.bIt("ngSubmit",function(){return i.onSaveMedList();}),e.j41(14,"fieldset",8)(15,"legend"),e.EFF(16,"Medication List Details"),e.k0s(),e.j41(17,"div",9)(18,"label",10),e.EFF(19,"Medication List Name"),e.k0s(),e.nrm(20,"input",11),e.DNE(21,st,2,0,"div",12),e.DNE(22,lt,2,0,"div",12),e.k0s(),e.j41(23,"div",9)(24,"label",13),e.EFF(25,"Medication List Description"),e.k0s(),e.nrm(26,"input",14),e.k0s(),e.j41(27,"div",15)(28,"label",16),e.EFF(29,"File Selection"),e.k0s(),e.j41(30,"div",17)(31,"button",18),e.bIt("click",function(){e.eBV(o);const g=e.sdS(35);return e.Njj(g.click());}),e.EFF(32," Choose File "),e.k0s(),e.nrm(33,"input",19),e.k0s(),e.j41(34,"input",20,21),e.bIt("change",function(g){return i.onFileUpload(g);}),e.k0s(),e.j41(36,"div",22),e.EFF(37," Supported format: CSV - File Upload will replace current list "),e.k0s()()(),e.j41(38,"div",23),e.DNE(39,ct,4,4,"button",24),e.DNE(40,pt,10,1,"div",25),e.k0s(),e.j41(41,"button",26),e.nI1(42,"async"),e.EFF(43," Save "),e.k0s(),e.j41(44,"button",27),e.bIt("click",function(){return i.onCancel();}),e.EFF(45," Cancel "),e.k0s(),e.j41(46,"p"),e.EFF(47,' * Drug product information in the Medication List Template (the "Template") is licensed by DrFirst from First DataBank. The Template may only be used for the sole purpose of creating medication lists within DrFirst\'s electronic prescribing application. You are responsible for and shall ensure that the Template is not shared with or accessed by any third parties, and/or accessed, used, or disclosed for any other purpose. '),e.k0s()()(),e.j41(48,"div",28)(49,"div",29)(50,"div",30)(51,"p"),e.EFF(52),e.k0s()(),e.j41(53,"div",31),e.DNE(54,mt,4,4,"button",32),e.k0s()(),e.j41(55,"div",1)(56,"div",33),e.DNE(57,ut,2,11,"ag-grid-angular",34),e.k0s()()()()();}if(2&n){const o=e.sdS(35);let l,g,h,m;e.R7$(9),e.SpI(" Add up to ",i.maximumRecordsInMedList," medications. After saving, you can apply your list to a Pathway. "),e.R7$(4),e.Y8G("formGroup",i.medListForm),e.R7$(7),e.Y8G("ngClass",e.eq3(14,ft,(null==(l=i.medListForm.get("name"))?null:l.invalid)&&((null==(l=i.medListForm.get("name"))?null:l.dirty)||(null==(l=i.medListForm.get("name"))?null:l.touched)))),e.R7$(1),e.Y8G("ngIf",(null==(g=i.medListForm.get("name"))?null:g.invalid)&&((null==(g=i.medListForm.get("name"))?null:g.dirty)||(null==(g=i.medListForm.get("name"))?null:g.touched))
1),e.R7$(1),e.Y8G("ngIf",null==(h=i.medListForm.get("name"))||null==h.errors?null:h.errors.pattern),e.R7$(11),e.Y8G("value",(null==o.files||null==o.files[0]?null:o.files[0].name)||i.fileName),e.R7$(6),e.Y8G("ngIf",i.isListTemplateButtonVisible),e.R7$(1),e.Y8G("ngIf",i.isListTemplateButtonVisible),e.R7$(1),e.Y8G("disabled",i.isSaveButtonDisabled||!((i.medListForm.dirty||i.medListForm.touched)&&0!==(null==(m=e.bMT(42,12,i.medList))||null==m.medListDetails?null:m.medListDetails.length))),e.R7$(11),e.SpI("Included in List: ",i.medsAmount," Medications"),e.R7$(2),e.Y8G("ngIf",i.isCurrentMedListButtonVisible),e.R7$(3),e.Y8G("ngIf",i.gridOptions&&i.colDefs.length);}},dependencies:[p.YU,p.bT,d.qT,d.me,d.BC,d.cb,d.tU,P.xs,d.j4,d.JD,c.ZM,p.Jj],styles:[".rcopia[_ngcontent-%COMP%]   .widget[_ngcontent-%COMP%]   .minifiedWidget[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{border:1px solid var(--rcopia-widget-body-contrast-10, #e6e6e6)}.med-list-details[_ngcontent-%COMP%]   .med-list-form[_ngcontent-%COMP%]   fieldset[_ngcontent-%COMP%]   legend[_ngcontent-%COMP%], .med-list-details[_ngcontent-%COMP%]   .med-list-form[_ngcontent-%COMP%]   legend[_ngcontent-%COMP%]{color:var(--rcopia-widget-text-color, #333333);font-size:13px;font-weight:600;margin-bottom:1rem;border-bottom:0}.med-list-details[_ngcontent-%COMP%]   .med-list-table[_ngcontent-%COMP%]{height:450px;width:100%}.med-list-details[_ngcontent-%COMP%]   .download-actions[_ngcontent-%COMP%]{display:flex;justify-content:end}.med-list-details[_ngcontent-%COMP%]   .fileupload-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1px;flex-wrap:wrap;row-gap:3px}.med-list-details[_ngcontent-%COMP%]   .fileupload-info[_ngcontent-%COMP%]{font-size:11px}.med-list-details[_ngcontent-%COMP%]   .hidden-file-upload[_ngcontent-%COMP%]{display:none}.med-list-details[_ngcontent-%COMP%]   .med-list-template-info[_ngcontent-%COMP%]{padding-top:5px}"]});}return a;})(),wt=(()=>{class a{constructor(t,n,i,o,l){this.medListsTabService=t,this.medListService=n,this.notifierService=i,this.changeDetectorRef=o,this.modalService=l,this.medListName="";}agInit(t){this.params=t,this.medListName=t?.data?.name||"",this.medListId=t?.data?.medListId,this.detectChanges();}refresh(){return!1;}onEditClick(){const t=this.params?.data,n=this.params?.context?.componentParent?.maximumRecordsInMedList;this.medListService.editMedListDetails(t,n),this.medListsTabService.openMedListDetails();}onDeleteClick(){this.openModal(`Delete ${this.medListName}`,`Are you sure you want to delete the <strong>${this.medListName}</strong>? This action cannot be undone.`,!1).then(t=>{t&&this.deleteSelectedMedList();});}deleteSelectedMedList(){this.medListService.deleteMedList({medListId:this.medListId}).subscribe({next:n=>{this.handleDeleteResponse(n),this.detectChanges();},error:n=>{this.notifierService.show({type:"error",message:"Unable to  Delete Medlist "}),console.log(n);}});}handleDeleteResponse(t){t.hasPathwaysAssociated?this.openModal(`Cannot delete ${this.medListName}`,`<strong>${this.medListName}</strong> cannot be deleted at this time as it is currently used in <strong>${t.usedByPathwayCount}</strong> \n         Pathways. Please confirm this message.`,!0):(this.notifierService.show({type:"success",message:`${this.medListName} Medlist is Deleted Successfully`}),this.params?.context?.componentParent?.getMedListData());}openModal(t,n,i){const o=this.modalService.open(x.o,{size:"md",centered:!0,backdrop:!1});return o&&(o.componentInstance.modalOptions={title:t,description:n,confirmBtn:!i,closeBtn:!!i}
1),o.result;}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(A),e.rXU(N),e.rXU(w.iJ),e.rXU(e.gRc),e.rXU(c.Bq));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-actions-med-list-renderer"]],standalone:!0,features:[e.aNF],decls:10,vars:0,consts:[["a-id","df-b-pathway-edit-medlist","type","button",1,"btn","btn-default","btn-sm",3,"click"],[1,"svg","pencil-alt-solid"],["href","#pencil-alt-solid"],["a-id","df-b-pathway-delete-medlist","type","button",1,"btn","btn-default","btn-sm",3,"click"],[1,"svg","trash-alt-regular"],["href","#trash-alt-regular"]],template:function(n,i){1&n&&(e.j41(0,"button",0),e.bIt("click",function(){return i.onEditClick();}),e.qSk(),e.j41(1,"svg",1),e.nrm(2,"use",2),e.k0s(),e.joV(),e.j41(3,"span"),e.EFF(4,"Edit"),e.k0s()(),e.j41(5,"button",3),e.bIt("click",function(){return i.onDeleteClick();}),e.qSk(),e.j41(6,"svg",4),e.nrm(7,"use",5),e.k0s(),e.joV(),e.j41(8,"span"),e.EFF(9,"Delete"),e.k0s()());},dependencies:[p.MD],changeDetection:0});}return a;})();function bt(a,s){if(1&a&&e.nrm(0,"ag-grid-angular",5),2&a){const t=e.XpG();e.Y8G("rowData",t.medLists)("columnDefs",t.colDefs)("gridOptions",t.gridOptions)("pagination",!0)("suppressRowClickSelection",!0)("paginationPageSize",10)("paginationPageSize",t.defaultPageSize)("paginationPageSizeSelector",t.paginationPageSizeSelector);}}let Ct=(()=>{class a{constructor(t,n,i,o,l){this.medListsTabService=t,this.medListService=n,this.notifierService=i,this.changeDetectorRef=o,this.logger=l,this.medLists=[],this.gridOptions={},this.colDefs=[],this.defaultPageSize=10,this.paginationPageSizeSelector=[10,20,50,100],this.rowSelection="multiple";}ngOnInit(){this.setColumnDef(),this.setGridOption();}setColumnDef(){this.colDefs=[{headerName:"Medication List Name",field:"name",filter:"agTextColumnFilter",floatingFilter:!0,flex:1,tooltipField:"name",sort:"asc",sortingOrder:["asc","desc"],comparator:(t,n)=>t.toLowerCase().localeCompare(n.toLowerCase())},{headerName:"Description",field:"description",filter:"agTextColumnFilter",floatingFilter:!0,flex:2,tooltipField:"description"},{headerName:"Actions",field:"actions",autoHeight:!0,width:170,cellRenderer:wt}];}setGridOption(){const t=this;this.gridOptions={sortingOrder:["asc","desc"],suppressMenuHide:!1,suppressMovableColumns:!0,rowSelection:"multiple",tooltipShowDelay:500,overlayNoRowsTemplate:'<span">No records found</span>',context:{componentParent:this},onGridReady(n){n&&n.api&&(t.gridApi=n.api,t.gridApi.showLoadingOverlay(),t.getMedListData());}};}getMedListData(){this.medListService.searchByPractice().subscribe(t=>{this.maximumRecordsInMedList=t.maximumRecordsInMedList,this.medLists=t.medListFetchResults||[],this.detectChanges();},t=>{this.notifierService.show({type:"error",message:"Unable to load med list data. Please try again."}),this.logger.$log.error("@Med List: Failed to load med list data",t),this.gridApi?.showNoRowsOverlay();});}detectChanges(){try{this.changeDetectorRef.detectChanges();}catch(t){console.log(t);}}onCreateMedList(){this.medListsTabService.openMedListDetails(),this.medListService.createMedListDetail(this.maximumRecordsInMedList);}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(A),e.rXU(N),e.rXU(w.iJ),e.rXU(e.gRc),e.rXU(b.Kc));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-med-lists"]],decls:8,vars:1,consts:[["a-id","df-w-pathways-medlists",1,"content"],[1,"row"],[1,"col"],["a-id","df-t-medlists","class","ag-theme-balham med-lists-table",3,"rowData","columnDefs","gridOptions","pagination","suppressRowClickSelection","paginationPageSize","paginationPageSizeSelector",4,"ngIf"],["a-id","df-b-medlists-create",1,"btn","btn-primary","mt-2",3,"click"],["a-id","df-t-medlists",1,"ag-theme-balham","med-lists-table",3,"rowData","columnDefs","gridOptions","pagination","suppressRowClickSelection","paginationPageSize","paginationPageSizeSelector"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.DNE(3,bt,1,8,"ag-grid-angular",3),e.k0s()(),e.j41(4,"div",1)(5,"div",2)(6,"button",4),e.bIt("click",function(){return i.onCreateMedList();}
1),e.EFF(7," Create Med List "),e.k0s()()()()),2&n&&(e.R7$(3),e.Y8G("ngIf",i.gridOptions&&i.colDefs.length));},dependencies:[p.bT,P.xs],styles:[".med-lists-table[_ngcontent-%COMP%]{height:410px}"],changeDetection:0});}return a;})();function _t(a,s){1&a&&(e.j41(0,"section",5),e.nrm(1,"df-med-lists"),e.k0s());}function vt(a,s){1&a&&(e.j41(0,"section",6),e.nrm(1,"df-med-list-details"),e.k0s());}let Pt=(()=>{class a{constructor(t){this.medListsTabService=t,this.activeView=D.SEARCH;}ngOnInit(){this.medListsTabService.switchMedListsTabViewEvent.subscribe(t=>{this.activeView=t;});}isDetailsView(){return this.activeView===D.MED_LIST_DETAILS;}isSearchView(){return this.activeView===D.SEARCH;}onSwitchMedListTabView(t){this.activeView=t;}static#_=this.ɵfac=function(n){return new(n||a)(e.rXU(A));};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-med-lists-tab"]],decls:5,vars:2,consts:[["a-id","df-w-pathways-medlists-tab",1,"content"],[1,"row"],[1,"col"],["a-id","df-e-medlists-tab-search-results","class","px-2 medication-lists-search-results",4,"ngIf"],["a-id","df-e-medlists-tab-lists-details","class","content medication-lists-create-edit",4,"ngIf"],["a-id","df-e-medlists-tab-search-results",1,"px-2","medication-lists-search-results"],["a-id","df-e-medlists-tab-lists-details",1,"content","medication-lists-create-edit"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.DNE(3,_t,2,0,"section",3),e.DNE(4,vt,2,0,"section",4),e.k0s()()()),2&n&&(e.R7$(3),e.Y8G("ngIf",i.isSearchView()),e.R7$(1),e.Y8G("ngIf",i.isDetailsView()));},dependencies:[p.bT,yt,Ct]});}return a;})();function Mt(a,s){1&a&&e.nrm(0,"df-pathways-tab",8);}function Ot(a,s){1&a&&e.nrm(0,"df-med-lists-tab",8);}let Ft=(()=>{class a{constructor(){this.active=1;}static#_=this.ɵfac=function(n){return new(n||a)();};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathways-management"]],decls:12,vars:4,consts:[["a-id","df-f-pathways-management"],["ngbNav","","a-id","df-l-pathway-management-tab-set",1,"nav-tabs","bootstrap5","pt-1",3,"activeId","activeIdChange"],["nav","ngbNav"],[3,"ngbNavItem"],["ngbNavLink","","a-id","df-b-pathway-management-tab-pathways"],["ngbNavContent",""],["ngbNavLink","","a-id","df-b-pathway-management-tab-med-list"],[3,"ngbNavOutlet"],[1,"pathway-nav"]],template:function(n,i){if(1&n&&(e.j41(0,"section",0)(1,"ul",1,2),e.bIt("activeIdChange",function(l){return i.active=l;}),e.j41(3,"li",3)(4,"button",4),e.EFF(5,"Pathways"),e.k0s(),e.DNE(6,Mt,1,0,"ng-template",5),e.k0s(),e.j41(7,"li",3)(8,"button",6),e.EFF(9,"Medication Lists"),e.k0s(),e.DNE(10,Ot,1,0,"ng-template",5),e.k0s()(),e.nrm(11,"div",7),e.k0s()),2&n){const o=e.sdS(2);e.R7$(1),e.Y8G("activeId",i.active),e.R7$(2),e.Y8G("ngbNavItem",1),e.R7$(4),e.Y8G("ngbNavItem",2),e.R7$(4),e.Y8G("ngbNavOutlet",o);}},dependencies:[c.Um,c.X9,c.sy,c.Gx,c.RI,c.WA,c.m_,Je,Pt],styles:[".nav-tabs.nav-justified[_ngcontent-%COMP%]{padding-top:6px;background-color:#d9d9d9}.nav-tabs.nav-justified[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .nav-tabs.nav-justified[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .nav-tabs.nav-justified[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{background-color:#008ddc57}.nav-tabs[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center}"]});}return a;})();function Dt(a,s){1&a&&e.nrm(0,"df-pathways-assignment",12);}function Tt(a,s){1&a&&e.nrm(0,"df-pathways-management",12);}let St=(()=>{class a{constructor(){this.active=1;}static#_=this.ɵfac=function(n){return new(n||a)();};static#_2=this.ɵcmp=e.VBU({type:a,selectors:[["df-pathways-utility"]],features:[e.Jv_([E,te])],decls:18,vars:4,consts:[["a-id","df-w-pathway-utility",1,"widget","standalone","df-widget-utilities-pathways"],["a-id","df-e-pathway-utility-title",1,"widget-header-standalone"],[1,"df-widget-body"],["widget-loader","showWidgetLoader"],["a-id","df-e-pathways-utility-notifier"],["ngbNav","",1,"nav-tabs","pt-2",3,"activeId","activeIdChange"],["nav","ngbNav"],[3,"ngbNavItem"],["ngbNavLink","","a-id","df-b-pathway-assignment"],["ngbNavContent",""],["ngbNavLink","","a-id","df-b-pathway-management"],[3,"ngbNavOutlet"],[1,"pathway-nav"]],template:function(n,i){if
1(1&n&&(e.j41(0,"section",0)(1,"div",1)(2,"span"),e.EFF(3,"Pathways"),e.k0s()(),e.j41(4,"div",2),e.nrm(5,"div",3)(6,"notifier-container",4),e.j41(7,"ul",5,6),e.bIt("activeIdChange",function(l){return i.active=l;}),e.j41(9,"li",7)(10,"button",8),e.EFF(11,"Pathway Assignment"),e.k0s(),e.DNE(12,Dt,1,0,"ng-template",9),e.k0s(),e.j41(13,"li",7)(14,"button",10),e.EFF(15,"Pathway Management"),e.k0s(),e.DNE(16,Tt,1,0,"ng-template",9),e.k0s()(),e.nrm(17,"div",11),e.k0s()()),2&n){const o=e.sdS(8);e.R7$(7),e.Y8G("activeId",i.active),e.R7$(2),e.Y8G("ngbNavItem",1),e.R7$(4),e.Y8G("ngbNavItem",2),e.R7$(4),e.Y8G("ngbNavOutlet",o);}},dependencies:[c.Um,c.X9,c.sy,c.Gx,c.RI,c.WA,c.m_,w.Lp,pe,Ft],styles:[".rcopia[_ngcontent-%COMP%]   .widget[_ngcontent-%COMP%]   .minifiedWidget[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{border:1px solid var(--rcopia-widget-body-contrast-10, #e6e6e6)}.nav-tabs[_ngcontent-%COMP%]{background-color:var(--rcopia-widget-body-contrast-15, #d9d9d9)}.nav-tabs[_ngcontent-%COMP%]   .nav-link.active[_ngcontent-%COMP%]{background-color:#f2f2f2}"]});}return a;})();var Lt=r(55047).default;const Et=angular.module("utilities.state",[Lt.name]).component("utilitiesState",Q).directive("dfPathwaysUtility",(0,ee.PW)({component:St}));},30217:(X,I,r)=>{r.d(I,{A:()=>$});const $='<section a-id="utilities.page" id="utilities.state"> <div ui-view> <df-w-utilities widget-id="{{$ctrl.widgetId}}"></df-w-utilities> </div> </section> ';}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.