PageSourceSearch

https://hpnhm.com/424.02bbc77b2680e861.js

js hpnhm.com collected 2026-10-02 01:32:09 UTC 47,482 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdemo1=self.webpackChunkdemo1||[]).push([[424],{4995:(E,D,l)=>{l.d(D,{n:()=>S});var q=l(520),s=l(2340),w=l(5e3);let S=(()=>{class Z{constructor(N){this.apiUrl=`${s.N.apiUrl}/containers/storage/download`,this.http=new q.eN(N)}downloadFileWithContainer(N){return this.http.get(`${this.apiUrl}/${N}`,{responseType:"blob"})}}return Z.\u0275fac=function(N){return new(N||Z)(w.LFG(q.jN))},Z.\u0275prov=w.Yz7({token:Z,factory:Z.\u0275fac,providedIn:"root"}),Z})()},4424:(E,D,l)=>{l.r(D),l.d(D,{ChemistModule:()=>Qe});var q=l(7621),s=l(3075),w=l(7442),S=l(9826),Z=l(4107),g=l(6856),N=l(7531),k=l(7423),Y=l(508),T=l(9808),u=l(8279),R=l(5245),J=l(6087),F=l(5899),U=l(4847),M=l(727),B=l(5226),I=l.n(B),$=l(5439),x=l.n($),t=l(5e3),j=l(4995),L=l(89),W=l(6115),G=l(7665),O=l(8761),V=l(1225),b=l(7322);function H(e,r){if(1&e&&(t.TgZ(0,"mat-option",23),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.Q6J("value",i.id),t.xp6(1),t.hij(" ",i.districtName," ")}}function z(e,r){1&e&&(t.TgZ(0,"mat-error"),t._uU(1,"District is required!!!"),t.qZA())}function K(e,r){if(1&e&&(t.TgZ(0,"mat-option",23),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.Q6J("value",i.id),t.xp6(1),t.hij(" ",i.blockName," ")}}function X(e,r){1&e&&t._UZ(0,"mat-error")}function tt(e,r){if(1&e&&(t.TgZ(0,"th",32),t._uU(1),t.qZA()),2&e){const i=t.oxw().$implicit;t.xp6(1),t.hij(" ",i.header," ")}}function et(e,r){if(1&e){const i=t.EpF();t.TgZ(0,"div",36)(1,"a",37),t.NdJ("click",function(){t.CHM(i);const n=t.oxw().$implicit,a=t.oxw(3);return t.KtG(a.getDistrictTable(n))}),t._uU(2),t.qZA()()}if(2&e){const i=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(2),t.Oqu(o.cell(i))}}function it(e,r){if(1&e&&t._uU(0),2&e){const i=t.oxw().$implicit,o=t.oxw().$implicit;t.Oqu(o.cell(i))}}function ot(e,r){if(1&e&&(t.TgZ(0,"td",33),t.YNc(1,et,3,1,"div",34),t.YNc(2,it,1,1,"ng-template",null,35,t.W1O),t.qZA()),2&e){const i=t.MAs(3),o=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",o.isActionField)("ngIfElse",i)}}function rt(e,r){1&e&&(t.ynx(0,29),t.YNc(1,tt,2,1,"th",30),t.YNc(2,ot,4,2,"td",31),t.BQk()),2&e&&t.Q6J("matColumnDef",r.$implicit.columnDef)}function nt(e,r){1&e&&t._UZ(0,"tr",38)}function at(e,r){1&e&&t._UZ(0,"tr",39)}function st(e,r){if(1&e&&(t.TgZ(0,"div",24)(1,"table",25),t.YNc(2,rt,3,1,"ng-container",26),t.YNc(3,nt,1,0,"tr",27),t.YNc(4,at,1,0,"tr",28),t.qZA()()),2&e){const i=t.oxw();t.xp6(1),t.Q6J("dataSource",i.statedataSource),t.xp6(1),t.Q6J("ngForOf",i.columns),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumnsStateWise),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumnsStateWise)}}function lt(e,r){if(1&e&&(t.TgZ(0,"th",32),t._uU(1),t.qZA()),2&e){const i=t.oxw().$implicit;t.xp6(1),t.hij(" ",i.header," ")}}function mt(e,r){if(1&e){const i=t.EpF();t.TgZ(0,"div",36)(1,"a",37),t.NdJ("click",function(){t.CHM(i);const n=t.oxw().$implicit,a=t.oxw(3);return t.KtG(a.getBlockTable(n))}),t._uU(2),t.qZA()()}if(2&e){const i=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(2),t.Oqu(o.cell(i))}}function ct(e,r){if(1&e&&t._uU(0),2&e){const i=t.oxw().$implicit,o=t.oxw().$implicit;t.Oqu(o.cell(i))}}function dt(e,r){if(1&e&&(t.TgZ(0,"td",33),t.YNc(1,mt,3,1,"div",34),t.YNc(2,ct,1,1,"ng-template",null,35,t.W1O),t.qZA()),2&e){const i=t.MAs(3),o=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",o.isActionField)("ngIfElse",i)}}function ut(e,r){1&e&&(t.ynx(0,29),t.YNc(1,lt,2,1,"th",30),t.YNc(2,dt,4,2,"td",31),t.BQk()),2&e&&t.Q6J("matColumnDef",r.$implicit.columnDef)}function pt(e,r){1&e&&t._UZ(0,"tr",38)}function ht(e,r){1&e&&t._UZ(0,"tr",39)}function ft(e,r){if(1&e&&(t.TgZ(0,"div",40)(1,"table",25),t.YNc(2,ut,3,1,"ng-container",26),t.YNc(3,pt,1,0,"tr",27),t.YNc(4,ht,1,0,"tr",28),t.qZA()()),2&e){const i=t.oxw();t.Q6J("hidden",i.showDistrictTable),t.xp6(1),t.Q6J("dataSource",i.districtdataSource),t.xp6(1),t.Q6J("ngForOf",i.columns),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumnsDistrictWise),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumnsDistrictWise)}}function _t(e,r){if(1&e&&(t.TgZ(0,"th",32),t._uU(1),t.qZA()),2&e){const i=t.oxw().$implicit;t.xp6(1),t.hij(" ",i.header," ")}}function gt(e,r){if(1&e){const i=t.EpF();t.TgZ(0,"div",36)(1,"a",37),t.NdJ("click",function(){t.CHM(i);const n=t.oxw().$implicit,a=t.oxw(3);return t.KtG(a.getChemistTable(n))}),t._uU(2),t.qZA()()}if(2&e){const i=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(2),t.Oqu(o.cell(i))}}function vt(e,r){if(1&e&&t._uU(0),2&e){const i=t.oxw().$implicit,o=t.oxw().$implicit;t.Oqu(o.cell(i))}}function Ct(e,r){if(1&e&&(t.TgZ(0,"td",33),t.YNc(1,gt,3,1,"div",34),t.YNc(2,vt,1,1,"ng-template",null,35,t.W1O),t.qZA()),2&e){const i=t.MAs(3),o=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",o.isActionField)("ngIfElse",i)}}function Zt(e,r){1&e&&(t.ynx(0,29),t.YNc(1,_t,2,1,"th",30),t.YNc(2,Ct,4,2,"td",31),t.BQk()),2&e&&t.Q6J("matColumnDef",r.$implicit.columnDef)}function bt(e,r){1&e&&t._UZ(0,"tr",38)}function Nt(e,r){1&e&&t._UZ(0,"tr",39)}function Tt(e,r){if(1&e&&(t.TgZ(0,"div",40)(1,"table",25),t.YNc(2,Zt,3,1,"ng-container",26),t.YNc(3,bt,1,0,"tr",27),t.YNc(4,Nt,1,0,"tr",28),t.qZA()()),2&e){const i=t.oxw();t.Q6J("hidden",i.showBlockTable),t.xp6(1),t.Q6J("dataSource",i.blockdataSource),t.xp6(1),t.Q6J("ngForOf",i.columns),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumnBLockWise),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumnBLockWise)}}function At(e,r){if(1&e&&(t.TgZ(0,"th",32),t._uU(1),t.qZA()),2&e){const i=t.oxw().$implicit;t.xp6(1),t.hij(" ",i.header," ")}}function yt(e,r){if(1&e&&(t.TgZ(0,"div",36)(1,"a",41),t._uU(2),t.qZA()()),2&e){const i=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(2),t.Oqu(o.cell(i))}}function It(e,r){if(1&e&&t._uU(0),2&e){const i=t.oxw().$implicit,o=t.oxw().$implicit;t.Oqu(o.cell(i))}}function Ut(e,r){if(1&e&&(t.TgZ(0,"td",33),t.YNc(1,yt,3,1,"div",34),t.YNc(2,It,1,1,"ng-template",null,35,t.W1O),t.qZA()),2&e){const i=t.MAs(3),o=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",o.isActionField)("ngIfElse",i)}}function xt(e,r){1&e&&(t.ynx(0,29),t.YNc(1,At,2,1,"th",30),t.YNc(2,Ut,4,2,"td",31),t.BQk()),2&e&&t.Q6J("matColumnDef",r.$implicit.columnDef)}function Dt(e,r){1&e&&t._UZ(0,"tr",38)}function qt(e,r){1&e&&t._UZ(0,"tr",39)}function wt(e,r){if(1&e&&(t.TgZ(0,"div",40)(1,"table",25),t.YNc(2,xt,3,1,"ng-container",26),t.YNc(3,Dt,1,0,"tr",27),t.YNc(4,qt,1,0,"tr",28),t.qZA()()),2&e){const i=t.oxw();t.Q6J("hidden",i.showChemistTable),t.xp6(1),t.Q6J("dataSource",i.chemistdataSource),t.xp6(1),t.Q6J("ngForOf",i.columns),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumnUser),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumnUser)}}let kt=(()=>{class e{constructor(i,o,n,a,m,d,p){this.fb=i,this.fileLibraryServices=o,this._auth=n,this.districtService=a,this.blockService=m,this.chemistreportingService=d,this.PhiService=p,this.subscription=new M.w0,this.disableBlock=!1,this.disableDistrict=!1,this.showDistrictTable=!0,this.showBlockTable=!0,this.showChemistTable=!0,this.displayedheaders=["district","block","patientId","patientName","patientAddress","patientMobile","drName","drAddress","submissionDate","productName","companyId","coughSyrupName","medicineType"],this.columns=[{
1columnDef:"state",header:"State",cell:c=>`${c.state}`,isActionField:!0},{columnDef:"district",header:"Districts",cell:c=>`${c.district}`,isActionField:!0},{columnDef:"block",header:"Blocks",cell:c=>`${c.block}`,isActionField:!0},{columnDef:"chemist",header:"Chemist",cell:c=>`${c.chemist}`,isActionField:!0},{columnDef:"patientCount",header:"No Of Patient",cell:c=>`${c.patientCount}`}],this.displayedColumns=this.columns.map(c=>c.columnDef),this.currentUser=this._auth.currentUserValue}ngOnInit(){var i,o,n,a,m,d,p,c,h,f;!(null===(i=this.currentUser)||void 0===i)&&i.stateId&&(this.districts$=this.districtService.getDistricts({stateId:null===(o=this.currentUser)||void 0===o?void 0:o.stateId})),((null===(n=this.currentUser)||void 0===n?void 0:n.districtId)||(null===(a=this.currentUser)||void 0===a?void 0:a.blockId)||(null===(m=this.currentUser)||void 0===m?void 0:m.phiId))&&(this.getBlocks(null,null===(d=this.currentUser)||void 0===d?void 0:d.districtId),this.getPhis(null,null===(p=this.currentUser)||void 0===p?void 0:p.districtId,null===(c=this.currentUser)||void 0===c?void 0:c.blockId),this.disableDistrict=!(null===(h=this.currentUser)||void 0===h||!h.districtId),this.disableBlock=!(null===(f=this.currentUser)||void 0===f||!f.blockId)),this.form=this.createForm(),x()().month()+1>3?(this.fromDate=x()().month(3).startOf("month").format("YYYY-MM-DD"),this.toDate=x()().month(2).endOf("month").add(1,"years").format("YYYY-MM-DD")):(this.fromDate=x()().month(3).startOf("month").subtract(1,"years").format("YYYY-MM-DD"),this.toDate=x()().month(2).endOf("month").format("YYYY-MM-DD")),"State"===this.currentUser.designation?this.getStateTable():"District"===this.currentUser.designation?(this.showDistrictTable=!1,this.getDistrictTable(this.currentUser)):"Block"===this.currentUser.designation?(this.showBlockTable=!1,this.getBlockTable(this.currentUser)):"Chemist"===this.currentUser.designation&&(this.showChemistTable=!1,this.getChemistTable(this.currentUser))}createForm(){var i,o,n;return this.fb.group({districtId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict},[s.kI.required]],blockId:[{value:null!==(o=this.currentUser)&&void 0!==o&&o.blockId?null===(n=this.currentUser)||void 0===n?void 0:n.blockId:"",disabled:this.disableBlock}],startDate:[""],endDate:[""]})}getStateTable(){const i=this.displayedColumns.filter(n=>"district"!==n&&"block"!==n&&"chemist"!=n);this.displayedColumnsStateWise=i,this.chemistreportingService.getChemistDrugCount({designation:this.currentUser.designation,fromDate:this.fromDate,toDate:this.toDate}).subscribe(n=>{this.statedataSource=new u.by(n)})}getDistrictTable(i){const o=this.displayedColumns.filter(a=>"state"!==a&&"block"!==a&&"chemist"!=a);this.displayedColumnsDistrictWise=o,this.showDistrictTable=!1,this.chemistreportingService.getChemistDrugCount({fromDate:this.fromDate,toDate:this.toDate,stateId:this.currentUser.stateId?this.currentUser.stateId:i.stateId,districtId:this.currentUser.districtId?this.currentUser.districtId:i.districtId,designation:"District"}).subscribe(a=>{this.districtdataSource=new u.by(a)})}getBlockTable(i){const o=this.displayedColumns.filter(a=>"state"!==a&&"district"!==a&&"chemist"!=a);this.showBlockTable=!1,this.displayedColumnBLockWise=o,this.chemistreportingService.getChemistDrugCount({fromDate:this.fromDate,toDate:this.toDate,stateId:this.currentUser.stateId?this.currentUser.stateId:i.stateId,districtId:i._id?i._id:i.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:i.blockId,designation:"Block"}).subscribe(a=>{this.blockdataSource=new u.by(a)})}getChemistTable(i){this.showChemistTable=!1;const o=this.displayedColumns.filter(a=>"state"!==a&&"district"!==a&&"block"!=a);this.displayedColumnUser=o,this.chemistreportingService.getChemistDrugCount({fromDate:this.fromDate,toDate:this.toDate,stateId:this.currentUser.stateId?this.currentUser.stateId:i.stateId,districtId:i._id?i._id:i.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:i.blockId,designation:"Chemist"}).subscribe(a=>{this.chemistdataSource=new u.by(a)})}getBlocks(i,o){var n,a;o=null!==(a=null===(n=null==this?void 0:this.form)||void 0===n?void 0:n.value)&&void 0!==a&&a.hasOwnProperty("districtId")?this.form.value.districtId:this.currentUser.districtId,this.blocks$=this.blockService.getBlocks({districtId:o})}getPhis(i,o,n){}generateReport(){var i,o;const n={designation:this.currentUser.designation,fromDate:null===(i=this.form.value.startDate)||void 0===i?void 0:i.toISOString(),toDate:null===(o=this.form.value.endDate)||void 0===o?void 0:o.toISOString(),stateId:this.currentUser.stateId,districtId:this.currentUser.districtId?this.currentUser.districtId:this.form.value.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:this.form.value.blockId};this.chemistreportingService.getChemistReport(n).subscribe(a=>{I().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(m=>{m.value&&this.fileLibraryServices.downloadFileWithContainer(a).subscribe(d=>{const p=new Blob([d],{type:d.type}),c=window.URL.createObjectURL(p),h=document.createElement("a");h.href=c,h.download=a,document.body.appendChild(h),h.click(),document.body.removeChild(h),window.URL.revokeObjectURL(c)})})})}getDetailTabledata(){var i,o;const n={designation:this.currentUser.designation,fromDate:null===(i=this.form.value.startDate)||void 0===i?void 0:i.toISOString(),toDate:null===(o=this.form.value.endDate)||void 0===o?void 0:o.toISOString(),districtId:this.currentUser.districtId?this.currentUser.districtId:this.form.value.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:this.form.value.blockId};this.chemistreportingService.getDetailTabledata(n).subscribe(a=>{this.detaildataSource=new u.by(a)})}}return e.\u0275fac=function(i){return new(i||e)(t.Y36(s.qu),t.Y36(j.n),t.Y36(L.e8),t.Y36(W.R),t.Y36(G.g),t.Y36(O.H),t.Y36(V.B))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-chemist-reporting"]],decls:45,vars:17,consts:[[1,"card","w-full",2,"margin-bottom","10px","margin-top","-2.5rem"],[1,"card-body"],[1,"card-title"],[1,"card-text"],[3,"formGroup"],[1,"row"],[1,"my-2","col-xs-12","col-sm-12","col-md-3"],["appearance","outline",2,"width","100%"],["placeholder","Select District","formControlName","districtId",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["placeholder","Select Block","formControlName","blockId"],[1,"flex","justify-items-center"],[1,"date-range-container"],[3,"rangePicker"],["matStartDate","","formControlName","startDate","placeholder","Start date"],["matEndDate","","formControlName","endDate","placeholder","End date"],["matIconSuffix","",3,"for"],["picker",""],["mat-raised-button","","color","primary",2,"margin-top","0.5rem",3,"disableRipple","disabled","click"],[1,"card","w-full"],["style","margin-bottom: 30px;",4,"ngIf"],["style","margin-bottom: 20px;",3,"hidden",4,"ngIf"],[3,"value"],[2,"margin-bottom","30px"],["mat-table","","matSort","",1,"shadow-xl","w-full","h-full","mx-auto","my-auto",3,"dataSource"],[3,"matColumnDef",4,"ngFor","ngForOf"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[3,"matColumnDef"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["mat-header-cell",""],["mat-cell",""],["style","cursor:pointer;",4,"ngIf","ngIfElse"],["elseBlock",""],[2,"cursor","pointer"],[1,"font-weight-bold",3,"click"],["mat-header-row",""],["mat-row",""],[2,"margin-bottom","20px",3,"hidden"],[1,"font-weight-bold"]],template:function(i,o){if(1&i&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h1",2),t._uU(3,"TB Drug Sale Report"),t.qZA(),t.TgZ(4,"p",3),t._uU(5,"Download the raw data report"),t.qZA(),t.TgZ(6,"form",4)(7,"div",5)(8,"div",6)(9,"mat-form-field",7)(10,"mat-label"),t._uU(11,"District"),t.qZA(),t.TgZ(12,"mat-select",8),t.NdJ("selectionChange",function(a){return o.getBlocks(a,"")}),t.YNc(13,H,2,2,"mat-option",9),t.ALo(14,"async"),t.qZA(),t.YNc(15,z,2,0,"mat-error",10),t.qZA()(),t.TgZ(16,"div",6)(17,"mat-form-field",7)(18,"mat-label"),t._uU(19,"Block"),t.qZA(),t.TgZ(20,"mat-select",11),t.YNc(21,K,2,2,"mat-option",9),t.ALo(22,"async"),t.qZA()()(),t.TgZ(23,"div",6)(24,"mat-form-field",7)(25,"mat-label"),t._uU(26,"Date range"),t.qZA(),t.TgZ(27,"div",12)(28,"div",13)(29,"mat-date-range-input",14),t._UZ(30,"input",15)(31,"input",16),t.qZA(),t._UZ(32,"mat-datepicker-toggle",17),t.qZA(),t._UZ(33,"mat-date-range-picker",null,18),t.qZA(),t.YNc(35,X,1,0,"mat-error",10),t.qZA()(),t.TgZ(36,"div",6)(37,"button",19),t.NdJ("click",function(){return o.generateReport()}),t._uU(38,"Download Report"),t.qZA()()()()()(),t.TgZ(39,"div",20)(40,"div",1),t.YNc(41,st,5,4,"div",21),t.YNc(42,ft,5,5,"div",22),t.YNc(43,Tt,5,5,"div",22),t.YNc(44,wt,5,5,"div",22),t.qZA()()),2&i){const n=t.MAs(34);t.xp6(6),t.Q6J("formGroup",o.form),t.xp6(7),t.Q6J("ngForOf",t.lcZ(14,13,o.districts$)),t.xp6(2),t.Q6J("ngIf",o.form.controls.districtId.invalid),t.xp6(6),t.Q6J("ngForOf",t.lcZ(22,15,o.blocks$)),t.xp6(8),t.Q6J("rangePicker",n),t.xp6(3),t.Q6J("for",n),t.xp6(3),t.Q6J("ngIf",o.form.controls.startDate.invali
1d),t.xp6(2),t.Q6J("disableRipple",!1)("disabled",o.form.invalid),t.xp6(4),t.Q6J("ngIf","State"===o.currentUser.designation),t.xp6(1),t.Q6J("ngIf","District"===o.currentUser.designation||"State"),t.xp6(1),t.Q6J("ngIf","District"===o.currentUser.designation||"State"),t.xp6(1),t.Q6J("ngIf","District"===o.currentUser.designation||"State")}},dependencies:[T.sg,T.O5,Y.ey,k.lW,g.nW,g.wx,g.zY,g.By,g._g,b.TO,b.KE,b.hX,Z.gD,U.YE,u.BZ,u.fO,u.as,u.w1,u.Dz,u.nj,u.ge,u.ev,u.XQ,u.Gk,s._Y,s.Fj,s.JJ,s.JL,s.sg,s.u,T.Ov],styles:[".mat-row:nth-child(even){background-color:#f0f5ef}  mat-footer-row,   mat-header-row,   mat-row,   td.mat-cell,   td.mat-footer-cell,   th.mat-header-cell{border:1px solid #ccc;padding:5px!important}  th.mat-header-cell{background-color:#7393b3;color:#fff;font-size:14px}  .mat-header-row,   .mat-row{height:30px!important;min-height:0px!important}  .mat-sort-header-arrow{color:#fff}.mat-datepicker-toggle[_ngcontent-%COMP%]{position:absolute;right:.5rem;top:50%;transform:translateY(-50%)}table[_ngcontent-%COMP%]{width:100%}"]}),e})();var Yt=l(9943),P=l(574),Q=l(8966);function Pt(e,r){1&e&&(t.TgZ(0,"mat-error"),t._uU(1,"Please enter the Patient Name"),t.qZA())}function St(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Patient Address"),t.qZA()())}function Jt(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Patient Mobile"),t.qZA()())}function Qt(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter a valid 10-digit mobile number"),t.qZA()())}function Rt(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Doctor Name"),t.qZA()())}function Ot(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Doctor Address"),t.qZA()())}function Et(e,r){if(1&e&&(t.TgZ(0,"mat-option",23),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.Q6J("value",i),t.xp6(1),t.hij(" ",i.name," ")}}function Ft(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please Select Company Name"),t.qZA()())}function Mt(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the TB Drug Sold(Qty)"),t.qZA()())}function Bt(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter a valid numeric value"),t.qZA()())}function $t(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Batch No"),t.qZA()())}function jt(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the expiryDate"),t.qZA()())}function Lt(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the bill No"),t.qZA()())}let Wt=(()=>{class e{constructor(i,o,n){this.dialogRef=i,this.data=o,this.fb=n,this.companylist=[]}ngOnInit(){console.log(this.data,"data coming"),this.companylist=this.data.companylist,this.chemisteditform=this.createForm(),this.chemisteditform.controls.patientNikhayId.setValue(this.data.chemistuser.patientNikhayId),this.chemisteditform.controls.patientName.setValue(this.data.chemistuser.patientName),this.chemisteditform.controls.patientAddress.setValue(this.data.chemistuser.patientAddress),this.chemisteditform.controls.patientMobile.setValue(this.data.chemistuser.patientMobile),this.chemisteditform.controls.drName.setValue(this.data.chemistuser.drName),this.chemisteditform.controls.drAddress.setValue(this.data.chemistuser.drAddress),this.chemisteditform.controls.productName.setValue(this.data.chemistuser.productName.productName),this.chemisteditform.controls.productqty.setValue(this.data.chemistuser.productName.qty),this.chemisteditform.controls.batchNo.setValue(this.data.chemistuser.batchNo),this.chemisteditform.controls.expiryDate.setValue(this.data.chemistuser.expiryDate),this.chemisteditform.controls.billNo.setValue(this.data.chemistuser.billNo)}createForm(){return this.fb.group({patientNikhayId:[""],patientName:["",s.kI.required],patientAddress:["",s.kI.required],patientMobile:["",[s.kI.required,s.kI.pattern(/^[0-9]{10}$/)]],drName:["",s.kI.required],drAddress:["",s.kI.required],productName:["",s.kI.required],productqty:["",[s.kI.required,s.kI.pattern(/^[0-9]+$/)]],batchNo:["",s.kI.required],expiryDate:["",s.kI.required],billNo:["",s.kI.required]})}view(){this.chemisteditform.valid&&(console.log(this.chemisteditform.value),this.dialogRef.close(Object.assign({},this.chemisteditform.value)))}close(){this.dialogRef.close()}}return e.\u0275fac=function(i){return new(i||e)(t.Y36(Q.so),t.Y36(Q.WI),t.Y36(s.qu))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-edit-userdialog"]],decls:83,vars:16,consts:[[1,"w-full","flex","justify-between"],[1,"w-full",3,"formGroup"],[1,"flex","justify-evenly","gap-1"],[1,"row"],[1,"col-lg-3","readonly-wrapper"],["appearance","outline",1,"readonly-block",2,"width","100%"],["matInput","","formControlName","patientNikhayId","placeholder","School Code"],["matInput","","formControlName","patientName","placeholder","patientName"],[4,"ngIf"],["matInput","","formControlName","patientAddress","placeholder","patientAddress"],["matInput","","formControlName","patientMobile","placeholder","patientMobile"],["matInput","","formControlName","drName","placeholder","drName"],["matInput","","formControlName","drAddress","placeholder","drAddress"],["placeholder","Select Company","formControlName","productName"],[3,"value",4,"ngFor","ngForOf"],["matInput","","formControlName","productqty","placeholder","productqty"],["matInput","","formControlName","batchNo","placeholder","batchNo"],["matInput","","formControlName","expiryDate","placeholder","date",3,"matDatepicker"],["matSuffix","",3,"for"],["picker",""],["matInput","","formControlName","billNo","placeholder","billNo"],[1,"d-flex","justify-content-center"],["mat-raised-button","","color","primary",3,"click"],[3,"value"]],template:function(i,o){if(1&i&&(t.TgZ(0,"h1")(1,"b"),t._uU(2,"Chemist Form"),t.qZA()(),t.TgZ(3,"div",0)(4,"form",1)(5,"div",2)(6,"div",3)(7,"div",4)(8,"mat-form-field",5)(9,"mat-label"),t._uU(10,"Patient NikshayId"),t.qZA(),t._UZ(11,"input",6),t.qZA()(),t.TgZ(12,"div",4)(13,"mat-form-field",5)(14,"mat-label"),t._uU(15,"Patient Name"),t.qZA(),t._UZ(16,"input",7),t.qZA(),t.YNc(17,Pt,2,0,"mat-error",8),t.qZA(),t.TgZ(18,"div",4)(19,"mat-form-field",5)(20,"mat-label"),t._uU(21,"Patient Address"),t.qZA(),t._UZ(22,"input",9),t.qZA(),t.YNc(23,St,3,0,"div",8),t.qZA(),t.TgZ(24,"div",4)(25,"mat-form-field",5)(26,"mat-label"),t._uU(27,"Patient Mobile"),t.qZA(),t._UZ(28,"input",10),t.qZA(),t.YNc(29,Jt,3,0,"div",8),t.YNc(30,Qt,3,0,"div",8),t.qZA()(),t.TgZ(31,"div",3)(32,"div",4)(33,"mat-form-field",5)(34,"mat-label"),t._uU(35,"Prescribing Doctor Name"),t.qZA(),t._UZ(36,"input",11),t.qZA(),t.YNc(37,Rt,3,0,"div",8),t.qZA(),t.TgZ(38,"div",4)(39,"mat-form-field",5)(40,"mat-label"),t._uU(41,"Prescribing Doctor Address"),t.qZA(),t._UZ(42,"input",12),t.qZA(),t.YNc(43,Ot,3,0,"div",8),t.qZA(),t.TgZ(44,"div",4)(45,"mat-form-field",5)(46,"mat-label"),t._uU(47,"TB Drug sold company"),t.qZA(),t.TgZ(48,"mat-select",13),t.YNc(49,
1Et,2,2,"mat-option",14),t.qZA()(),t.YNc(50,Ft,3,0,"div",8),t.qZA(),t.TgZ(51,"div",4)(52,"mat-form-field",5)(53,"mat-label"),t._uU(54,"TB Drug Sold(Qty)"),t.qZA(),t._UZ(55,"input",15),t.qZA(),t.YNc(56,Mt,3,0,"div",8),t.YNc(57,Bt,3,0,"div",8),t.qZA()(),t.TgZ(58,"div",3)(59,"div",4)(60,"mat-form-field",5)(61,"mat-label"),t._uU(62,"Batch No"),t.qZA(),t._UZ(63,"input",16),t.qZA(),t.YNc(64,$t,3,0,"div",8),t.qZA(),t.TgZ(65,"div",4)(66,"mat-form-field",5)(67,"mat-label"),t._uU(68,"Date of Expiry"),t.qZA(),t._UZ(69,"input",17)(70,"mat-datepicker-toggle",18)(71,"mat-datepicker",null,19),t.qZA(),t.YNc(73,jt,3,0,"div",8),t.qZA(),t.TgZ(74,"div",4)(75,"mat-form-field",5)(76,"mat-label"),t._uU(77,"Bill No"),t.qZA(),t._UZ(78,"input",20),t.qZA(),t.YNc(79,Lt,3,0,"div",8),t.qZA()(),t.TgZ(80,"div",21)(81,"button",22),t.NdJ("click",function(){return o.view()}),t._uU(82,"Save Data"),t.qZA()()()()()),2&i){const n=t.MAs(72);let a,m,d,p,c,h,f,v,_,C,A,y;t.xp6(4),t.Q6J("formGroup",o.chemisteditform),t.xp6(13),t.Q6J("ngIf",(null==(a=o.chemisteditform.get("patientName"))?null:a.hasError("required"))&&(null==(a=o.chemisteditform.get("patientName"))?null:a.touched)),t.xp6(6),t.Q6J("ngIf",(null==(m=o.chemisteditform.get("patientAddress"))?null:m.hasError("required"))&&(null==(m=o.chemisteditform.get("patientAddress"))?null:m.touched)),t.xp6(6),t.Q6J("ngIf",(null==(d=o.chemisteditform.get("patientMobile"))?null:d.hasError("required"))&&(null==(d=o.chemisteditform.get("patientMobile"))?null:d.touched)),t.xp6(1),t.Q6J("ngIf",(null==(p=o.chemisteditform.get("patientMobile"))?null:p.hasError("pattern"))&&(null==(p=o.chemisteditform.get("patientMobile"))?null:p.touched)),t.xp6(7),t.Q6J("ngIf",(null==(c=o.chemisteditform.get("drName"))?null:c.hasError("required"))&&(null==(c=o.chemisteditform.get("drName"))?null:c.touched)),t.xp6(6),t.Q6J("ngIf",(null==(h=o.chemisteditform.get("drAddress"))?null:h.hasError("required"))&&(null==(h=o.chemisteditform.get("drName"))?null:h.touched)),t.xp6(6),t.Q6J("ngForOf",o.companylist),t.xp6(1),t.Q6J("ngIf",(null==(f=o.chemisteditform.get("productName"))?null:f.hasError("required"))&&(null==(f=o.chemisteditform.get("productName"))?null:f.touched)),t.xp6(6),t.Q6J("ngIf",(null==(v=o.chemisteditform.get("productqty"))?null:v.hasError("required"))&&(null==(v=o.chemisteditform.get("productqty"))?null:v.touched)),t.xp6(1),t.Q6J("ngIf",(null==(_=o.chemisteditform.get("productqty"))?null:_.hasError("pattern"))&&(null==(_=o.chemisteditform.get("productqty"))?null:_.touched)),t.xp6(7),t.Q6J("ngIf",(null==(C=o.chemisteditform.get("batchNo"))?null:C.hasError("required"))&&(null==(C=o.chemisteditform.get("batchNo"))?null:C.touched)),t.xp6(5),t.Q6J("matDatepicker",n),t.xp6(1),t.Q6J("for",n),t.xp6(3),t.Q6J("ngIf",(null==(A=o.chemisteditform.get("expiryDate"))?null:A.hasError("required"))&&(null==(A=o.chemisteditform.get("expiryDate"))?null:A.touched)),t.xp6(6),t.Q6J("ngIf",(null==(y=o.chemisteditform.get("billNo"))?null:y.hasError("required"))&&(null==(y=o.chemisteditform.get("billNo"))?null:y.touched))}},dependencies:[T.sg,T.O5,Y.ey,k.lW,g.Mq,g.hl,g.nW,b.TO,b.KE,b.hX,b.R9,N.Nt,Z.gD,s._Y,s.Fj,s.JJ,s.JL,s.sg,s.u]}),e})();var Gt=l(1586),Vt=l(2340),Ht=l(520);const zt=`${Vt.N.apiUrl}/companies`;let Kt=(()=>{class e{constructor(i){this._http=i}getCompanies(i){const n=`${zt}?filter=${JSON.stringify({where:i,order:["company_name ASC"]})}`;return this._http.get(n)}}return e.\u0275fac=function(i){return new(i||e)(t.LFG(Ht.eN))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Xt=l(5714),te=l(3788);const ee=["productSelect"];function ie(e,r){1&e&&(t.TgZ(0,"mat-error"),t._uU(1," Only 8 digits are allowed. "),t.qZA())}function oe(e,r){1&e&&(t.TgZ(0,"mat-error"),t._uU(1," Name is required "),t.qZA())}function re(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Patient Address"),t.qZA()())}function ne(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Patient Mobile"),t.qZA()())}function ae(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter a valid 10-digit mobile number"),t.qZA()())}function se(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Doctor Name"),t.qZA()())}function le(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Doctor Address"),t.qZA()())}function me(e,r){if(1&e&&(t.TgZ(0,"mat-option",47),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.Q6J("value",i.id),t.xp6(1),t.hij(" ",i.company_name," ")}}function ce(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please Select Company Name"),t.qZA()())}function de(e,r){if(1&e&&(t.TgZ(0,"mat-option",47),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.Q6J("value",i),t.xp6(1),t.hij(" ",i.name," ")}}function ue(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please Select Drug sold Product Name"),t.qZA()())}function pe(e,r){if(1&e){const i=t.EpF();t.TgZ(0,"div",48)(1,"div",49)(2,"div",6)(3,"div"),t._uU(4),t.qZA()(),t.TgZ(5,"div",6)(6,"mat-form-field",50)(7,"mat-label"),t._uU(8,"Quantity"),t.qZA(),t._UZ(9,"
1input",51),t.qZA()(),t.TgZ(10,"div",52)(11,"button",53),t.NdJ("click",function(){const a=t.CHM(i).index,m=t.oxw();return t.KtG(m.removeSelectedProduct(a))}),t.TgZ(12,"mat-icon"),t._uU(13,"delete"),t.qZA()()()()()}if(2&e){const i=r.$implicit,o=r.index;let n;t.xp6(1),t.Q6J("formGroupName",o),t.xp6(3),t.Oqu(null==(n=i.get("productName"))?null:n.value.name)}}function he(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the Batch No"),t.qZA()())}function fe(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the expiryDate"),t.qZA()())}function _e(e,r){1&e&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please enter the bill No"),t.qZA()())}function ge(e,r){1&e&&(t.TgZ(0,"th",54),t._uU(1," Sr. No. "),t.qZA())}function ve(e,r){if(1&e&&(t.TgZ(0,"td",55),t._uU(1),t.qZA()),2&e){const i=r.index;t.oxw();const o=t.MAs(119);t.xp6(1),t.hij(" ",i+1+o.pageIndex*o.pageSize,"")}}function Ce(e,r){1&e&&(t.TgZ(0,"th",54),t._uU(1," Nikhshay Id "),t.qZA())}function Ze(e,r){if(1&e&&(t.TgZ(0,"td",55),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.xp6(1),t.Oqu(i.patientNikhayId)}}function be(e,r){1&e&&(t.TgZ(0,"th",54),t._uU(1,"Patient Name"),t.qZA())}function Ne(e,r){if(1&e&&(t.TgZ(0,"td",55),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.xp6(1),t.Oqu(i.patientName)}}function Te(e,r){1&e&&(t.TgZ(0,"th",54),t._uU(1,"Patient Mobile"),t.qZA())}function Ae(e,r){if(1&e&&(t.TgZ(0,"td",55),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.xp6(1),t.Oqu(i.patientMobile)}}function ye(e,r){1&e&&(t.TgZ(0,"th",54),t._uU(1,"Patient Address"),t.qZA())}function Ie(e,r){if(1&e&&(t.TgZ(0,"td",55),t._uU(1),t.qZA()),2&e){const i=r.$implicit;t.xp6(1),t.Oqu(i.patientAddress)}}function Ue(e,r){1&e&&(t.TgZ(0,"th",56),t._uU(1,"Product Details"),t.qZA())}function xe(e,r){if(1&e&&(t.TgZ(0,"tr")(1,"td",63),t._uU(2),t.qZA(),t.TgZ(3,"td",64),t._uU(4),t.qZA()()),2&e){const i=r.$implicit;t.xp6(2),t.Oqu(i.productName),t.xp6(2),t.Oqu(i.qty)}}function De(e,r){if(1&e&&(t.ynx(0),t.TgZ(1,"table",59)(2,"thead")(3,"tr")(4,"th",60),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",61),t._uU(7,"Quantity"),t.qZA()()(),t.TgZ(8,"tbody"),t.YNc(9,xe,5,2,"tr",62),t.qZA()(),t.BQk()),2&e){const i=t.oxw().$implicit;t.xp6(9),t.Q6J("ngForOf",i.productName)}}function qe(e,r){1&e&&t._uU(0,"No product details available")}function we(e,r){if(1&e&&(t.TgZ(0,"td",55),t.YNc(1,De,10,1,"ng-container",57),t.YNc(2,qe,1,0,"ng-template",null,58,t.W1O),t.qZA()),2&e){const i=r.$implicit,o=t.MAs(3);t.xp6(1),t.Q6J("ngIf",i.productName&&i.productName.length>0)("ngIfElse",o)}}function ke(e,r){1&e&&t._UZ(0,"tr",65)}function Ye(e,r){1&e&&t._UZ(0,"tr",66)}function Pe(e,r){1&e&&(t.TgZ(0,"tr",67)(1,"td",68),t._uU(2,"No data matching the filter"),t.qZA()())}const Se=function(){return[5,10,25,100]};let Je=(()=>{class e{constructor(i,o,n,a,m,d,p,c){this.fb=i,this.productService=o,this.companyService=n,this.chemistreportingService=a,this._auth=m,this.dialog=d,this.formService=p,this.renderer=c,this.displayedColumns=["sn","nikhshayId","name","mobile","patientAddress","productDetails"],this.sort=new t.n_E,this.companylist=[],this.productlist=[],this.selectedProducts=[],this.currentUser=this._auth.currentUserValue}ngOnInit(){this.chemistform=this.createForm(),this.getAllCompany(),this.getTableData(),this.getFormId()}createForm(){return this.fb.group({patientNikhayId:[""],patientName:["",[s.kI.required,s.kI.pattern("^[A-Za-z\\s]+$")]],patientAddress:["",s.kI.required],patientMobile:["",[s.kI.required,s.kI.pattern(/^[0-9]{10}$/)]],drName:["",s.kI.required],drAddress:["",s.kI.required],companyId:["",s.kI.required],productName:[""],selectedProducts:this.fb.array([]),batchNo:["",s.kI.required],expiryDate:["",s.kI.required],billNo:["",s.kI.required]})}get selectedProductsFormArray(){return this.chemistform.get("selectedProducts")}addSelectedProduct(i){this.chemistform.get("selectedProducts").push(this.fb.group({productName:i,quantity:["",s.kI.required]})),this.chemistform.updateValueAndValidity()}removeSelectedProduct(i){var o;const n=this.chemistform.get("selectedProducts"),a=null===(o=n.at(i).get("productName"))||void 0===o?void 0:o.value;n.removeAt(i),this.chemistform.removeControl(`${a}.quantity`),this.selectedProducts=this.selectedProductsFormArray.controls.map(m=>{var d;return null===(d=m.get("productName"))||void 0===d?void 0:d.value})}onSelectedProductsChange(i){const o=i.value;if(o.some(n=>"Other"===n.name))this.openProductDialog(),this.selectedProducts=o.filter(n=>"Other"!==n.name);else{this.selectedProductsFormArray.clear(),this.selectedProducts=o;for(const n of o)this.addSelectedProduct(n)}}openProductDialog(){I().fire({title:"Add Product!",html:'\n        <input id="swal-input1" class="swal2-input" placeholder="Product Name">\n        <div style="margin-top: 10px;"></div> \x3c!-- Add a div for spacing --\x3e\n        <label for="swal-input2">Product Type:</label>\n        <select id="swal-input2" class="swal2-input">\n            <option value="strip">Strip</option>\n            <option value="tab">Tab</option>\n        </select>\n        ',showCancelButton:!0,focusConfirm:!1,preConfirm:()=>{var o,n;const a=null===(o=I().getPopup())||void 0===o?void 0:o.querySelector("#swal-input1"),m=null===(n=I().getPopup())||void 0===n?void 0:n.querySelector("#swal-input2");if(a&&m){const d=a.value,p=m.value;if(d&&p)return this.productService.createProduct({name:d,status:!0,companyId:this.companyId,chemistReporting:!0,type:p,previousBalance:null,content:null,ageGroup:null}).toPromise().then(f=>{f&&(I().fire({title:"Success!",text:"Product added successfully",icon:"success",showConfirmButton:!0,confirmButtonText:"OK"}),this.productSelect.close())})}return null}})}addProductToProductList(i,o,n){this.productlist.push({name:i,type:o,companyId:n,chemistReporting:!0,previousBalance:null,content:null,ageGroup:null})}getFormId(){this.formService.getForms({formName:"Chemist Form"}).subscribe(o=>{this.formId=o[0].id})}
1updateQuantityControls(){this.selectedProductsFormArray.controls.forEach(i=>{var o;const a=`${null===(o=i.get("productName"))||void 0===o?void 0:o.value}.quantity`;this.chemistform.contains(a)||this.chemistform.addControl(a,this.fb.control("",s.kI.required))})}isProductNameDisabled(i){const n=this.chemistform.get("selectedProducts").at(i).get("productName");return!!n&&n.disabled}onCompanyChange(){var i;const o=null===(i=this.chemistform.get("companyId"))||void 0===i?void 0:i.value;this.companyId=o,this.productService.getProducts({companyId:o}).subscribe(a=>{this.productlist=a,this.productlist.push({id:"other",name:"Other"})})}getAllCompany(){this.companyService.getCompanies({}).subscribe(i=>{this.companylist=i})}view(){const i=this.chemistform.value,o=this.selectedProductsFormArray.controls.map(_=>{var C,A,y;return{productId:null===(C=_.get("productName"))||void 0===C?void 0:C.value.id,productName:null===(A=_.get("productName"))||void 0===A?void 0:A.value.name,qty:null===(y=_.get("quantity"))||void 0===y?void 0:y.value}}),v={drAddress:i.drAddress,drName:i.drName,id:i.id,patientAddress:i.patientAddress,patientMobile:i.patientMobile,patientName:i.patientName,patientNikhayId:i.patientNikhayId,companyId:i.companyId,productName:o,stateId:void 0!==this.currentUser.stateId?this.currentUser.stateId:void 0,districtId:void 0!==this.currentUser.districtId?this.currentUser.districtId:void 0,blockId:void 0!==this.currentUser.blockId?this.currentUser.blockId:void 0,createdBy:this.currentUser.id,formId:this.formId,submissionDate:Date.now()};this.chemistreportingService.createChemist(v).subscribe(_=>{_&&(this.dataSource.data=[v,...this.dataSource.data],I().fire({title:"Success!",text:"Forms added successfully",icon:"success",showConfirmButton:!0,confirmButtonText:"OK"}).then(()=>{this.resetForm()}))})}getFinancialYearDates(){const i=new Date,o=i.getFullYear();let a,m;return i.getMonth()>=3?(a=new Date(o,3,1),m=new Date(o+1,2,31,23,59,59)):(a=new Date(o-1,3,1),m=new Date(o,2,31,23,59,59)),{fromDate:a.getTime(),toDate:m.getTime()}}getTableData(){const{fromDate:i,toDate:o}=this.getFinancialYearDates();this.chemistreportingService.getChemist({where:{createdBy:this.currentUser.id,submissionDate:{between:[i,o]}}}).subscribe(a=>{this.dataSource=new u.by(a),this.dataSource.paginator=this.paginatorList.toArray()[0],this.dataSource.sort=this.sort.toArray()[0]})}generateReport(){let o=this.dataSource.data.map(m=>{let d="";return m.productName&&Array.isArray(m.productName)&&(d=m.productName.map(p=>`${p.productName} (${p.qty})`).join(", ")),{"Nikhshay Id":m.patientNikhayId,"Patient Name":m.patientName,"Patient Mobile":m.patientMobile,"Patient Address":m.patientAddress,"Product Details":d}});const n=P.P6.book_new();let a=P.P6.json_to_sheet(o);P.P6.book_append_sheet(n,a,"Chemist_Report"),P.NC(n,"Chemist_Report.xlsx")}editUser(i){this.dialog.open(Wt,{height:"80%",width:"70%",panelClass:"custom-dialog-container",data:{chemistuser:i,companylist:this.companylist}}).afterClosed().subscribe(n=>{})}resetForm(){this.chemistform.reset(),this.selectedProductsFormArray.clear(),this.selectedProducts=[],this.chemistform.markAsUntouched(),this.chemistform.markAsPristine(),this.chemistform.updateValueAndValidity(),Object.keys(this.chemistform.controls).forEach(i=>{const o=this.chemistform.get(i);o&&(o.setErrors(null),o.markAsPristine(),o.markAsUntouched(),o.updateValueAndValidity())})}getPatientMobileErrorMessage(){const i=this.chemistform.controls.patientMobile;return i.hasError("required")?"Patient Mobile is required!":i.hasError("pattern")?"Please enter a valid 10-digit mobile number":""}}return e.\u0275fac=function(i){return new(i||e)(t.Y36(s.qu),t.Y36(Gt.M),t.Y36(Kt),t.Y36(O.H),t.Y36(Xt.e),t.Y36(Q.uw),t.Y36(te.o),t.Y36(t.Qsj))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-chemistform"]],viewQuery:function(i,o){if(1&i&&(t.Gf(ee,5),t.Gf(J.NW,5),t.Gf(U.YE,5)),2&i){let n;t.iGM(n=t.CRH())&&(o.productSelect=n.first),t.iGM(n=t.CRH())&&(o.paginatorList=n),t.iGM(n=t.CRH())&&(o.sort=n)}},decls:120,vars:26,consts:[[1,"container"],[1,"card","w-full",2,"margin-bottom","10px"],[1,"card-body"],[1,"w-full",3,"formGroup"],[1,"flex","justify-evenly","gap-1"],[1,"row"],[1,"col-lg-3","readonly-wrapper"],["appearance","outline",1,"readonly-block",2,"width","100%"],["matInput","","formControlName","patientNikhayId","placeholder","School Code","type","text","maxlength","10","pattern","^\\d{1,10}$","inputmode","numeric","oninput","this.value = this.value.replace(/[^0-9]/g, '').slice(0, 10)"],[4,"ngIf"],["matInput","","formControlName","patientName","placeholder","Patient Name","type","text"],["matInput","","formControlName","patientAddress","placeholder","patientAddress"],["matInput","","formControlName","patientMobile","placeholder","patientMobile"],["matInput","","formControlName","drName","placeholder","drName"],["matInput","","formControlName","drAddress","placeholder","drAddress"],["placeholder","Select Company","formControlName","companyId",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],["placeholder","Select Product","multiple","",3,"value","selectionChange"],["productSelect",""],["formArrayName","selectedProducts",4,"ngFor","ngForOf"],["matInput","","formControlName","batchNo","placeholder","batchNo"],["matInput","","formControlName","expiryDate","placeholder","date",3,"matDatepicker"],["matSuffix","",3,"for"],["picker",""],["matInput","","formControlName","billNo","placeholder","billNo"],[1,"d-flex","justify-content-center"],["mat-raised-button","","color","primary",3,"disableRipple","disabled","click"],[1,"card","w-full"],[1,"card-header","d-flex","justify-content-end","align-items-center"],[1,"col-md-9"],[1,"col-md-3","d-flex","justify-content-end"],["mat-raised-button","","mat-small","","color","primary",1,"custom-download-button",3,"click"],["mat-table","","matSort","",1,"shadow-xl","w-full","h-full",3,"dataSource"],["matColumnDef","sn"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nikhshayId"],["matColumnDef","name"],["matColumnDef","mobile"],["matColumnDef","patientAddress"],["matColumnDef","productDetails"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],["showFirstLastButtons","",3,"pageSizeOptions"],["paginator",""],[3,"value"],["formArrayName","selectedProducts"],[1,"row",3,"formGroupName"],["appearance","outline",2,"width","100%"],["matInput","","formControlName","quantity","placeholder","Quantity"],[1,"col-lg-3"],["mat-icon-button","","color","warn",3,"click"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],[4,"ngIf","ngIfElse"],["noProductDetails",""],[1,"product-table"],[1,"product-name-header"],[1,"product-quantity-header"],[4,"ngFor","ngForOf"],[1,"product-name"],[1,"product-quantity"],["mat-header-row",""],["mat-row",""],[1,"mat-row"],["colspan","4",1,"mat-cell"]],template:function(i,o){if(1&i&&(t.TgZ(0,"div",0)(1,"h1")(2,"b"),t._uU(3,"Chemist Form"),t.qZA()(),t.TgZ(4,"div",1)(5,"div",2)(6,"form",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"mat-form-field",7)(11,"mat-label"),t._uU(12,"Patient NikshayId"),t.qZA(),t._UZ(13,"input",8),t.YNc(14,ie,2,0,"mat-error",9),t.qZA()(),t.TgZ(15,"div",6)(16,"mat-form-field",7)(17,"mat-label"),t._uU(18,"Patient Name"),t.qZA(),t._UZ(19,"input",10),t.YNc(20,oe,2,0,"mat-error",9),t.qZA()(),t.TgZ(21,"div",6)(22,"mat-form-field",7)(23,"mat-label"),t._uU(24,"Patient Address"),t.qZA(),t._UZ(25,"input",11),t.qZA(),t.YNc(26,re,3,0,"div",9),t.qZA(),t.TgZ(27,"div",6)(28,"mat-form-field",7)(29,"mat-label"),t._uU(30,"Patient Mobile"),t.qZA(),t._UZ(31,"input",12),t.qZA(),t.YNc(32,ne,3,0,"div",9),t.YNc(33,ae,3,0,"div",9),t.qZA()(),t.TgZ(34,"div",5)(35,"div",6)(36,"mat-form-field",7)(37,"mat-label"),t._uU(38,"Prescribing Doctor Name"),t.qZA(),t._UZ(39,"input",13),t.qZA(),t.YNc(40,se,3,0,"div",9),t.qZA(),t.TgZ(41,"div",6)(42,"mat-form-field",7)(43,"mat-label"),t._uU(44,"Prescribing Doctor Address"),t.qZA(),t._UZ(45,"input",14),t.qZA(),t.YNc(46,le,3,0,"div",9),t.qZA(),t.TgZ(47,"div",6)(48,"mat-form-field",7)(49,"mat-label"),t._uU(50,"TB Drug sold company"),t.qZA(),t.TgZ(51,"mat-select",15),t.NdJ("selectionChange",function(){return o.onCompanyChange()}),t.YNc(52,me,2,2,"mat-option",16),t.qZA()(),t.YNc(53,ce,3,0,"div",9),t.qZA(),t.TgZ(54,"div",6)(55,"mat-form-field",7)(56,"mat-label"),t._uU(57,"TB Drug sold product"),t.qZA(),t.TgZ(58,"mat-select",17,18),t.NdJ("selectionChange",function(a){return o.onSelectedProductsChange(a)}),t.YNc(60,de,2,2,"mat-option",16),t.qZA()(),t.YNc(61,ue,3,0,"div",9),t.qZA(),t.YNc(62,pe,14,2,"div",19),t.qZA(),t.TgZ(63,"div",5)(64,"div",6)(65,"mat-form-field",7)(66,"mat-label"),t._uU(67,"Batch No"),t.qZA(),t._UZ(68,"input",20),t.qZA(),t.YNc(69,he,3,0,"div",9),t.qZA(),t.TgZ(70,"div",6)(71,"mat-form-field",7)(72,"mat-label"),t._uU(73,"Date of Expiry"),t.qZA(),t._UZ(74,"input",21)(75,"mat-datepicker-toggle",22)(76,"mat-datepicker",null,23),t.qZA(),t.YNc(78,fe,3,0,"div",9),t.qZA(),t.TgZ(79,"div",6)(80,"mat-form-field",7)(81,"mat-label"),t._uU(82,"Bill No"),t.qZA(),t._UZ(83,"input",24),t.qZA(),t.YNc(84,_e,3,0,"div",9),t.qZA()(),t.TgZ(85,"div",25)(86,"button",26),t.NdJ("click",function(){return o.view()}),t._uU(87,"Add Data"),t.qZA()()()()()(),t.TgZ(88,"div",27)(89,"div",28),t._UZ(90,"div",29),t.TgZ(91,"div",30)(92,"button",31),t.NdJ("click",function(){return o.generateReport()}),t.TgZ(93,"mat-icon"),t._uU(94,"download"),t.qZA()()()(),t.TgZ(95,"div",2)(96,"table",32),t.ynx(97,33),t.YNc(98,ge,2,0,"th",34),t.YNc(99,ve,2,1,"td",35),t.BQk(),t.ynx(100,36),t.YNc(101,Ce,2,0,"th",34),t.YNc(102,Ze,2,1,"td",35),t.BQk(),t.ynx(103,37),t.YNc(104,be,2,0,"th",34),t.YNc(105,Ne,2,1,"td",35),t.BQk(),t.ynx(106,38),t.YNc(107,Te,2,0,"th",34),t.YNc(108,Ae,2,1,"td",35),t.BQk(),t.ynx(109,39),t.YNc(110,ye,2,0,"th",34),t.YNc(111,Ie,2,1,"td",35),t.BQk(),t.ynx(112,40),t.YNc(113,Ue,2,0,"th",41),t.YNc(114,we,4,2,"td",35),t.BQk(),t.YNc(115,ke,1,0,"tr",42),t.YNc(116,Ye,1,0,"tr",43),t.YNc(117,Pe,3,0,"tr",44),t.qZA(),t._UZ(118,"mat-paginator",45,46),t.qZA()()()),2&i){const n=t.MAs(77);let a,m,d,p,c,h,f,v,_,C;t.xp6(6),t.Q6J("formGroup",o.chemistform),t.xp6(8),t.Q6J("ngIf",o.chemistform.hasError("maxlength")),t.xp6(6),t.Q6J("ngIf",o.chemistform.controls.patientName.invali
1d),t.xp6(6),t.Q6J("ngIf",(null==(a=o.chemistform.get("patientAddress"))?null:a.hasError("required"))&&(null==(a=o.chemistform.get("patientAddress"))?null:a.touched)),t.xp6(6),t.Q6J("ngIf",(null==(m=o.chemistform.get("patientMobile"))?null:m.hasError("required"))&&(null==(m=o.chemistform.get("patientMobile"))?null:m.touched)),t.xp6(1),t.Q6J("ngIf",(null==(d=o.chemistform.get("patientMobile"))?null:d.hasError("pattern"))&&(null==(d=o.chemistform.get("patientMobile"))?null:d.touched)),t.xp6(7),t.Q6J("ngIf",(null==(p=o.chemistform.get("drName"))?null:p.hasError("required"))&&(null==(p=o.chemistform.get("drName"))?null:p.touched)),t.xp6(6),t.Q6J("ngIf",(null==(c=o.chemistform.get("drAddress"))?null:c.hasError("required"))&&(null==(c=o.chemistform.get("drName"))?null:c.touched)),t.xp6(6),t.Q6J("ngForOf",o.companylist),t.xp6(1),t.Q6J("ngIf",(null==(h=o.chemistform.get("companyId"))?null:h.hasError("required"))&&(null==(h=o.chemistform.get("companyId"))?null:h.touched)),t.xp6(5),t.Q6J("value",o.selectedProducts),t.xp6(2),t.Q6J("ngForOf",o.productlist),t.xp6(1),t.Q6J("ngIf",(null==(f=o.chemistform.get("companyId"))?null:f.hasError("required"))&&(null==(f=o.chemistform.get("companyId"))?null:f.touched)),t.xp6(1),t.Q6J("ngForOf",o.selectedProductsFormArray.controls),t.xp6(7),t.Q6J("ngIf",(null==(v=o.chemistform.get("batchNo"))?null:v.hasError("required"))&&(null==(v=o.chemistform.get("batchNo"))?null:v.touched)),t.xp6(5),t.Q6J("matDatepicker",n),t.xp6(1),t.Q6J("for",n),t.xp6(3),t.Q6J("ngIf",(null==(_=o.chemistform.get("expiryDate"))?null:_.hasError("required"))&&(null==(_=o.chemistform.get("expiryDate"))?null:_.touched)),t.xp6(6),t.Q6J("ngIf",(null==(C=o.chemistform.get("billNo"))?null:C.hasError("required"))&&(null==(C=o.chemistform.get("billNo"))?null:C.touched)),t.xp6(2),t.Q6J("disableRipple",!1)("disabled",o.chemistform.invalid),t.xp6(10),t.Q6J("dataSource",o.dataSource),t.xp6(19),t.Q6J("matHeaderRowDef",o.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",o.displayedColumns),t.xp6(2),t.Q6J("pageSizeOptions",t.DdM(25,Se))}},dependencies:[T.sg,T.O5,Y.ey,k.lW,g.Mq,g.hl,g.nW,R.Hw,b.TO,b.KE,b.hX,b.R9,N.Nt,J.NW,Z.gD,U.YE,U.nU,u.BZ,u.fO,u.as,u.w1,u.Dz,u.nj,u.ge,u.ev,u.XQ,u.Gk,u.Ee,s._Y,s.Fj,s.JJ,s.JL,s.nD,s.c5,s.sg,s.u,s.x0,s.CE],styles:[".mat-row:nth-child(even){background-color:#f0f5ef}  mat-footer-row,   mat-header-row,   mat-row,   td.mat-cell,   td.mat-footer-cell,   th.mat-header-cell{border:1px solid #ccc;padding:5px!important}  th.mat-header-cell{background-color:#7393b3;color:#fff;font-size:14px}  .mat-header-row,   .mat-row{height:30px!important;min-height:0px!important}  .mat-sort-header-arrow{color:#fff}.custom-download-button[_ngcontent-%COMP%]{font-size:2px!important;padding:2px 4px!important}table[_ngcontent-%COMP%]{width:100%}.field-gap[_ngcontent-%COMP%]{margin-top:10px}"]}),e})(),Qe=(()=>{class e{}return e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[T.ez,w.m,Yt.q,s.UX,s.u5,Z.LD,g.FA,N.c,k.ot,Y.XK,q.M,R.Ps,J.TU,F.Cv,U.JX,u.p0,S.Bz.forChild([{path:"report",component:kt},{path:"form",component:Je}])]}),e})()}}]);

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.