1"use strict";(self.webpackChunkdemo1=self.webpackChunkdemo1||[]).push([[659],{4995:(H,Y,h)=>{h.d(Y,{n:()=>J});var R=h(520),l=h(2340),S=h(5e3);let J=(()=>{class N{constructor(y){this.apiUrl=`${l.N.apiUrl}/containers/storage/download`,this.http=new R.eN(y)}downloadFileWithContainer(y){return this.http.get(`${this.apiUrl}/${y}`,{responseType:"blob"})}}return N.\u0275fac=function(y){return new(y||N)(S.LFG(R.jN))},N.\u0275prov=S.Yz7({token:N,factory:N.\u0275fac,providedIn:"root"}),N})()},2673:(H,Y,h)=>{h.r(Y),h.d(Y,{LabModule:()=>oo});var R=h(7621),l=h(3075),S=h(7442),J=h(9826),N=h(4107),g=h(6856),y=h(7531),L=h(7423),x=h(508),Z=h(9808),u=h(8279),X=h(5245),F=h(6087),K=h(5899),tt=h(4847),et=h(9943),at=h(5226),I=h.n(at),M=h(727),it=h(5439),A=h.n(it),t=h(5e3),k=h(2340),B=h(520);let P=(()=>{class a{constructor(e){this.http=e,this.apiUrl=`${k.N.apiUrl}/LabReportings`}getlabReport(e){return this.http.post(`${this.apiUrl}/getRawData`,e)}getlabReportRest(e){const i=`${this.apiUrl}?filter=${JSON.stringify(e)}`;return this.http.get(i,e)}addData(e){const i=`${this.apiUrl}?filter=${JSON.stringify(e)}`;return this.http.post(i,e)}getlabReportCount(e){return this.http.post(`${this.apiUrl}/getCount`,e)}}return a.\u0275fac=function(e){return new(e||a)(t.LFG(B.eN))}
1,a.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),a})();var $=h(4995),O=h(89),j=h(6115),E=h(7665),V=h(1225);let q=(()=>{class a{constructor(e){this.http=e,this.apiUrl=`${k.N.apiUrl}/labReportingManuals`,this.apiUrldistrict=`${k.N.apiUrl}/Districts`,this.apiUrlblock=`${k.N.apiUrl}/Blocks`,this.apiUrlgramPanchayat=`${k.N.apiUrl}/gramPanchayats`,this.apiUrlDevlopmentBlockName=`${k.N.apiUrl}/gpDevlopmentBlocks`,this.apiUrlmunicipalBodieskName=`${k.N.apiUrl}/municipalBodies`}getManualLabReport(e){return this.http.post(`${this.apiUrl}/getRawData`,e)}AddManualLabReportData(e){const i=`${this.apiUrl}`;return console.log("Hello response :- "+i),this.http.post(i,e)}getDistricts(){return this.http.get(`${this.apiUrldistrict}`)}getBlocks(e){return this.http.get(`${this.apiUrlblock}?filter[where][districtId]=${e}`)}getAllBlocks(){return this.http.get(`${this.apiUrlblock}`)}getGramPanchayat(e){return this.http.get(`${this.apiUrlgramPanchayat}?filter[where][blockId]=${e}`)}getDevlopmentBlockName(e){return this.http.get(`${this.apiUrlDevlopmentBlockName}?filter[where][blockId]=${e}`)}getmunicipalBodiesName(e){return this.http.get(`${this.apiUrlmunicipalBodieskName}?filter[where][blockId]=${e}`)}getAllDataForDMC(e){const i=(new B.LE).set("filter",JSON.stringify(e));return this.http.get(`${this.apiUrl}`,{params:i})}getAllDataForCBNAAT(e){const i=(new B.LE).set("filter",JSON.stringify(e));return this.http.get(`${this.apiUrl}`,{params:i})}getAllDataForTrueNAAT(e){const i=(new B.LE).set("filter",JSON.stringify(e));return this.http.get(`${this.apiUrl}`,{params:i})}}return a.\u0275fac=function(e){return new(e||a)(t.LFG(B.eN))}
1,a.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),a})();var G=h(7177),v=h(7322),U=h(4946),Q=h(9783);function ot(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.districtName," ")}}function rt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1,"District is required!!!"),t.qZA())}function nt(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.blockName," ")}}function lt(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e)}}function st(a,o){1&a&&t._UZ(0,"mat-error")}function mt(a,o){if(1&a){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",6)(2,"h1",7),t._uU(3,"Lab Report"),t.qZA(),t.TgZ(4,"p",8),t._uU(5,"Download the raw data report"),t.qZA(),t.TgZ(6,"form",9)(7,"div",10)(8,"div",11)(9,"mat-form-field",12)(10,"mat-label"),t._uU(11,"District"),t.qZA(),t.TgZ(12,"mat-select",13),t.NdJ("selectionChange",function(r){t.CHM(e);const n=t.oxw();return t.KtG(n.getBlocks(r,""))}),t.YNc(13,ot,2,2,"mat-option",14),t.ALo(14,"async"),t.qZA(),t.YNc(15,rt,2,0,"mat-error",15),t.qZA()(),t.TgZ(16,"div",11)(17,"mat-form-field",12)(18,"mat-label"),t._uU(19,"Block"),t.qZA(),t.TgZ(20,"mat-select",16),t.YNc(21,nt,2,2,"mat-option",14),t.ALo(22,"async"),t.qZA()()(),t.TgZ(23,"div",11)(24,"mat-form-field",12)(25,"mat-label"),t._uU(26,"Select Report Type"),t.qZA(),t.TgZ(27,"mat-select",17)(28,"mat-option",18),t._uU(29,"Web Report"),t.qZA(),t.TgZ(30,"mat-option",19),t._uU(31,"Registered Report"),t.qZA()()()(),t.TgZ(32,"div",11)(33,"mat-form-field",12)(34,"mat-label"),t._uU(35,"Select Date"),t.qZA(),t._UZ(36,"input",20)(37,"mat-datepicker-toggle",21)(38,"mat-datepicker",null,22),t.qZA()(),t.TgZ(40,"div",11)(41,"mat-form-field",12)(42,"mat-label"),t._uU(43,"Select Lab Type"),t.qZA(),t.TgZ(44,"mat-select",23),t.YNc(45,lt,2,2,"mat-option",14),t.qZA()()(),t.TgZ(46,"div",11)(47,"mat-form-field",12)(48,"mat-label"),t._uU(49,"Select Date range"),t.qZA(),t.TgZ(50,"div",24)(51,"div",25)(52,"mat-date-range-input",26),t._UZ(53,"input",27)(54,"input",28),t.qZA(),t._UZ(55,"mat-datepicker-toggle",29),t.qZA(),t._UZ(56,"mat-date-range-picker",null,30),t.qZA(),t.YNc(58,st,1,0,"mat-error",15),t.qZA()()(),t.TgZ(59,"div",31)(60,"button",32),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.generateReport())}),t._uU(61,"Download Report"),t.qZA()()()()()}if(2&a){const e=t.MAs(39),i=t.MAs(57),r=t.oxw();
1t.xp6(6),t.Q6J("formGroup",r.form),t.xp6(7),t.Q6J("ngForOf",t.lcZ(14,12,r.districts$)),t.xp6(2),t.Q6J("ngIf",r.form.controls.districtId.invalid),t.xp6(6),t.Q6J("ngForOf",t.lcZ(22,14,r.blocks$)),t.xp6(15),t.Q6J("matDatepicker",e),t.xp6(1),t.Q6J("for",e),t.xp6(8),t.Q6J("ngForOf",r.labTypeList),t.xp6(7),t.Q6J("rangePicker",i),t.xp6(3),t.Q6J("for",i),t.xp6(3),t.Q6J("ngIf",r.form.controls.startDate.invalid),t.xp6(2),t.Q6J("disableRipple",!1)("disabled",r.form.invalid)}}function ct(a,o){if(1&a&&(t.TgZ(0,"th"),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.header," ")}}function dt(a,o){if(1&a&&(t.TgZ(0,"tr"),t.YNc(1,ct,2,1,"th",34),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.Q6J("ngForOf",e)}}function ut(a,o){if(1&a&&t._UZ(0,"p-treeTableToggler",37),2&a){const e=t.oxw(2).$implicit;t.Q6J("rowNode",e)}}function pt(a,o){if(1&a&&(t.TgZ(0,"td"),t.YNc(1,ut,1,1,"p-treeTableToggler",36),t._uU(2),t.qZA()),2&a){const e=o.$implicit,i=o.index,r=t.oxw().rowData;t.xp6(1),t.Q6J("ngIf",0===i),t.xp6(1),t.hij(" ",r[e.field]," ")}}function ht(a,o){if(1&a&&(t.TgZ(0,"tr",35),t.YNc(1,pt,3,2,"td",34),t.qZA()),2&a){const i=o.columns;t.Q6J("ttRow",o.$implicit),t.xp6(1),t.Q6J("ngForOf",i)}}const _t=function(){return{"min-width":"50rem"}};let ft=(()=>{class a{constructor(e,i,r,n,s,c,m,d,p){this.fb=e,this.labReportingService=i,this.fileLibraryServices=r,this._auth=n,this.districtService=s,this.blockService=c,this.PhiService=m,this.labReportingManualService=d,this.nodeService=p,this.subscription=new M.w0,this.disableBlock=!1,this.disableDistrict=!1,this.CoughsyrupsurveillanceReport=!1,this.LabReport=!0,this.labTypeList=[],this.designationList=[],this.showDistrictTable=!0,this.showBlockTable=!0,this.showLabTable=!0,this.outOfTree=!1,this.columns=[{field:"name",header:"Name"},{field:"size",header:"Size"},{field:"type",header:"Type"}],this.currentUser=this._auth.currentUserValue}ngOnInit(){var e,i,r,n,s,c,m,d,p,f;this.nodeService.getFilesystem().then(_=>{console.log(_),this.files=_}),!(null===(e=this.currentUser)||void 0===e)&&e.stateId&&(this.districts$=this.districtService.getDistricts({stateId:null===(i=this.currentUser)||void 0===i?void 0:i.stateId})),this.labTypeList="DMC"===this.currentUser.labType||"CBNAAT"===this.currentUser.labType||"TrueNAAT"===this.currentUser.labType?[this.currentUser.labType]:["All","DMC","CBNAAT","TrueNAAT"],this.blocks$=this.blockService.getBlocks({}),this.phis$=this.PhiService.getBlockPHIs({}),((null===(r=this.currentUser)||void 0===r?void 0:r.districtId)||(null===(n=this.currentUser)||void 0===n?void 0:n.blockId)||(null===(s=this.currentUser)||void 0===s?void 0:s.phiId))&&(this.getBlocks(null,null===(c=this.currentUser)||void 0===c?void 0:c.districtId),this.getPhis(null,null===(m=this.currentUser)||void 0===m?void 0:m.districtId,null===(d=this.currentUser)||void 0===d?void 0:d.blockId),this.disableDistrict=!(null===(p=this.currentUser)||void 0===p||!p.districtId),this.disableBlock=!(null===(f=this.currentUser)||void 0===f||!f.blockId)),this.form=this.createForm(),this.formCough=this.createCoughForm(),A()().month()+1>3?(this.fromDate=A()().month(3).startOf("month").format("YYYY-MM-DD"),this.toDate=A()().format("YYYY-MM-DD")):(this.fromDate=A()().month(3).startOf("month").subtract(1,"years").format("YYYY-MM-DD"),this.toDate=A()().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)):"Lab"===this.currentUser.designation&&(this.showLabTable=!1,this.getLabTable(this.currentUser))}onClickedOutside(e){console.log("Clicked outside:",e),this.outOfTree=!0}createForm(){var e,i,r;return this.fb.group({districtId:[{value:null!==(e=this.currentUser)&&void 0!==e&&e.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict},[l.kI.required]],blockId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.blockId?null===(r=this.currentUser)||void 0===r?void 0:r.blockId:"",disabled:this.disableBlock}],reportType:[""],labType:[""],date:[""],startDate:[""],endDate:[""]})}createCoughForm(){var e,i,r;return this.fb.group({districtId:[{value:null!==(e=this.currentUser)&&void 0!==e&&e.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict},[l.kI.required]],blockId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.blockId?null===(r=this.currentUser)||void 0===r?void 0:r.blockId:"",disabled:this.disableBlock}],startDate:[""],endDate:[""]})}getBlocks(e,i){var r,n;i=null!==(n=null===(r=null==this?void 0:this.form)||void 0===r?void 0:r.value)&&void 0!==n&&n.hasOwnProperty("districtId")?this.form.value.districtId:this.currentUser.districtId,this.blocks$=this.blockService.getBlocks({districtId:i})}getPhis(e,i,r){}onChange(e){"LabReport"===e?(this.LabReport=!0,this.CoughsyrupsurveillanceReport=!1):"CoughsyrupsurveillanceReport"===e?(this.CoughsyrupsurveillanceReport=!0,this.LabReport=!1):(this.LabReport=!1,this.CoughsyrupsurveillanceReport=!1)}generateReport(){const e={designation:this.currentUser.designation,labType:this.form.value.labType,date:this.form.value.date,fromDate:this.form.value.startDate,toDate:this.form.value.endDate,districtId:this.currentUser.districtId?this.currentUser.districtId:this.form.value.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:this.form.value.blockId};"register"==this.form.value.reportType?this.labReportingManualService.getManualLabReport(e).subscribe(i=>{I().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(r=>{r.value&&this.fileLibraryServices.downloadFileWithContainer(i).subscribe(n=>{const s=new Blob([n],{type:n.type}),c=window.URL.createObjectURL(s),m=document.createElement("a");m.href=c,m.download=i,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(c)})})}):this.labReportingService.getlabReport(e).subscribe(i=>{I().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(r=>{r.value&&this.fileLibraryServices.downloadFileWithContainer(i).subscribe(n=>{const s=new Blob([n],{type:n.type}),c=window.URL.createObjectURL(s),m=document.createElement("a");m.href=c,m.download=i,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(c)})})})}getStateTable(){this.stateTitle=`State level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,designation:this.currentUser.designation,stateId:this.currentUser.stateId}).subscribe(i=>{console.log("responsestate=====>",i),this.phichoahc=new u.by(i)})}getDistrictTable(e){this.districtTitle=`District level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showDistrictTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,labType:this.labTypeList,toDate:this.toDate,stateId:this.currentUser.stateId?this.currentUser.stateId:e.stateId,districtId:this.currentUser.districtId?this.currentUser.districtId:e.districtId,designation:"District"}).subscribe(r=>{console.log("responsedistrict=====>",r),this.phichoahcDistrict=new u.by(r)})}getBlockTable(e){this.blockTitle=`Block level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showBlockTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,stateId:this.currentUser.stateId?this.currentUser.stateId:e.stateId,districtId:e._id?e._id:e.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:e.blockId,designation:"Block"}).subscribe(r=>{this.phichoahcBlock=new u.by(r)})}getLabTable(e){this.labTitle=`Lab level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showLabTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,stateId:this.currentUser.stateId,districtId:this.currentUser.districtId,blockId:e._id,designation:"Lab"}).subscribe(r=>{this.phichoahcLab=new u.by(r)})}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(l.qu),t.Y36(P),t.Y36($.n),t.Y36(O.e8),t.Y36(j.R),t.Y36(E.g),t.Y36(V.B),t.Y36(q),t.Y36(G.D))}
1,a.\u0275cmp=t.Xpm({type:a,selectors:[["app-lab-dashboard"]],decls:5,vars:6,consts:[["class","card w-full",4,"ngIf"],[1,"card"],[3,"value","columns","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],[1,"card","w-full"],[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"],["placeholder","Select Report Type","formControlName","reportType"],["value","Web"],["value","register"],["matInput","","formControlName","date","placeholder","date",3,"matDatepicker"],["matSuffix","",3,"for"],["picker1",""],["placeholder","Select Designation","formControlName","labType"],[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",""],[1,"d-flex","justify-content-center"],["mat-raised-button","","color","primary",3,"disableRipple","disabled","click"],[3,"value"],[4,"ngFor","ngForOf"],[3,"ttRow"],[3,"rowNode",4,"ngIf"],[3,"rowNode"]],template:function(e,i){1&e&&(t.YNc(0,mt,62,16,"div",0),t.TgZ(1,"div",1)(2,"p-treeTable",2),t.YNc(3,dt,2,1,"ng-template",3),t.YNc(4,ht,2,2,"ng-template",4),t.qZA()()),2&e&&(t.Q6J("ngIf",i.LabReport),t.xp6(2),t.Q6J("value",i.files)("columns",i.columns)("scrollable",!0)("tableStyle",t.DdM(5,_t)))},dependencies:[Z.sg,Z.O5,x.ey,L.lW,g.Mq,g.hl,g.nW,g.wx,g.zY,g.By,g._g,v.TO,v.KE,v.hX,v.R9,y.Nt,N.gD,l._Y,l.Fj,l.JJ,l.JL,l.sg,l.u,U.iw,Q.jx,U.gc,U.V4,Z.Ov]}),a})();var bt=h(845),gt=h(5262),z=h(5714),W=h(3788),w=h(9814);function vt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Page number is required. "),t.qZA())}function Tt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Page number cannot exceed 4 digits. "),t.qZA())}function Ct(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Only numeric values are allowed. "),t.qZA())}function Dt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Date is required "),t.qZA())}function Zt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID is required. "),t.qZA())}function At(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID must be at least 2 digits. "),t.qZA())}function Nt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID cannot exceed 8 digits. "),t.qZA())}function yt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Only numeric values are allowed. "),t.qZA())}function Ut(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function Lt(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",56)(2,"mat-label"),t._uU(3,"Village Name "),t.qZA(),t._UZ(4,"input",57),t.YNc(5,Ut,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngIf",null==(i=e.cbnaatForm.get("villageName"))?null:i.hasError("required"))}}function xt(a,o){1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",56)(2,"mat-label"),t._uU(3,"Ward Name *"),t.qZA(),t._UZ(4,"input",58),t.qZA()())}function Ft(a,o){if(1&a&&(t.TgZ(0,"mat-option",59),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.districtName," ")}}function kt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option "),t.qZA())}function It(a,o){if(1&a&&(t.TgZ(0,"mat-option",59),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.blockName," ")}}function qt(a,o){if(1&a&&(t.TgZ(0,"mat-option",59),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.gpName," ")}}function wt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select a Gram Panchayat "),t.qZA())}function Bt(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Gram Panchayat Name "),t.qZA(),t.TgZ(4,"mat-select",60),t.YNc(5,qt,2,2,"mat-option",18),t.qZA(),t.YNc(6,wt,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngForOf",e.gramPanchayatList),t.xp6(1),t.Q6J("ngIf",null==(i=e.cbnaatForm.get("gramPanchayatName"))?null:i.hasError("required"))}}function Yt(a,o){1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Development Block Name "),t.qZA(),t._UZ(4,"input",61),t.qZA()())}function Rt(a,o){if(1&a&&(t.TgZ(0,"mat-option",59),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.name_of_municipal_body," ")}}function St(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select a Municipal Body "),t.qZA())}function Qt(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Municipal Body Name *"),t.qZA(),t.TgZ(4,"mat-select",62),t.YNc(5,Rt,2,2,"mat-option",18),t.qZA(),t.YNc(6,St,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngForOf",e.municipalList),t.xp6(1),t.Q6J("ngIf",null==(i=e.cbnaatForm.get("name_of_municipal_body"))?null:i.hasError("required"))}}function Jt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option "),t.qZA())}function Mt(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option "),t.qZA())}function Pt(a,o){if(1&a&&(t.TgZ(0,"div",63)(1,"label",20),t._uU(2,"Whether MTBC Detected? *"),t.qZA(),t.TgZ(3,"div",21)(4,"mat-radio-group",64)(5,"mat-radio-button",65),t._uU(6,"Yes"),t.qZA(),t.TgZ(7,"mat-radio-button",66),t._uU(8,"No"),t.qZA()()(),t.YNc(9,Mt,2,0,"mat-error",10),t.qZA()),2&a){const e=t.oxw();let i;t.xp6(9),t.Q6J("ngIf",null==(i=e.cbnaatForm.get("mtbcDetected"))?null:i.hasError("required"))}}function $t(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select Rural or Urban "),t.qZA())}function Ot(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Page No. "),t.qZA())}function jt(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.pageNumber," ")}}function Et(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Test Date "),t.qZA())}function Vt(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.testDate," ")}}function Gt(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Episode ID "),t.qZA())}function zt(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.episodeID," ")}}function Wt(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Submission Date "),t.qZA())}function Ht(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.submissionDate," ")}}function Xt(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," District Name "),t.qZA())}function Kt(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.districtNameAddress," ")}}function te(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Health Block "),t.qZA())}function ee(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.healthBlockAddress," ")}}function ae(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Village Name "),t.qZA())}function ie(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.villageName," ")}}function oe(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Year "),t.qZA())}function re(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.year," ")}}function ne(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Municipal Body "),t.qZA())}function le(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.municipalBodyName," ")}}function se(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Gram Panchayat "),t.qZA())}
1function me(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.gramPanchayatName," ")}}function ce(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Locality "),t.qZA())}function de(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.locality," ")}}function ue(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," MTBC Detected "),t.qZA())}function pe(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.mtbcDetected," ")}}function he(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Reason For Test "),t.qZA())}function _e(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.reasonForTest," ")}}function fe(a,o){1&a&&(t.TgZ(0,"th",67),t._uU(1," Ward Name "),t.qZA())}function be(a,o){if(1&a&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.wardName," ")}}function ge(a,o){1&a&&t._UZ(0,"tr",69)}function ve(a,o){1&a&&t._UZ(0,"tr",70)}const Te=function(){return[5,10,20]};let Ce=(()=>{class a{constructor(e,i,r,n){this.fb=e,this.labReportingService=i,this.authService=r,this.formService=n,this.districtList=[],this.districtMap=new Map,this.blockList=[],this.loadAllblockList=[],this.blockMap=new Map,this.gramPanchayatList=[],this.developmentBlockList=[],this.municipalList=[],this.currentMonth="",this.displayedColumns=["pageNumber","testDate","episodeID","submissionDate","districtNameAddress","healthBlockAddress","year","municipalBodyName","gramPanchayatName","locality","mtbcDetected","reasonForTest","villageName","wardName"],this.allData=[],this.dataSource=new u.by([]),this.setCurrentMonth(),this.currentUser=this.authService.currentUserValue,this.initializeForm(),this.loadDistricts()}isRuralSelected(){var e;return"rural"===(null===(e=this.cbnaatForm.get("locality"))||void 0===e?void 0:e.value)}getFormId(){this.formService.getForms({formName:"CBNAAT daily testing Form"}).subscribe(i=>{this.formId=i[0].id})}isUrbanSelected(){var e;return"urban"===(null===(e=this.cbnaatForm.get("locality"))||void 0===e?void 0:e.value)}ngOnInit(){var e;null===(e=this.cbnaatForm.get("locality"))||void 0===e||e.valueChanges.subscribe(()=>{this.onLocalityChange()}),this.onReasonForTestChange(),this.loadTableData(),this.loadBlocksforApiresponse(),this.getFormId()}ngAfterViewInit(){this.dataSource.paginator=this.paginator}initializeForm(){this.cbnaatForm=this.fb.group({pageNumber:["",[l.kI.required,l.kI.maxLength(4),l.kI.pattern(/^\d+$/)]],villageName:[""],testDate:[new Date,l.kI.required],wardName:[""],episodeID:["",[l.kI.required,l.kI.minLength(2),l.kI.maxLength(8),l.kI.pattern(/^\d+$/)]],gramPanchayatName:["",l.kI.required],developmentBlockName:["",l.kI.required],reasonForTest:[""],locality:[""],districtNameAddress:["",l.kI.required],healthBlockAddress:["",l.kI.required],municipalBodyName:[""],mtbcDetected:[{value:null,disabled:!0}],submissionDate:[{value:null,disabled:!1}]})}onSubmit(){var e,i,r,n,s;if(this.cbnaatForm.invalid)return;const c=this.cbnaatForm.value,m=Date.now(),d=this.gramPanchayatList.find(_=>_.id===c.gramPanchayatName),p=this.municipalList.find(_=>_.id===c.municipalBodyName),f=p?p.name_of_municipal_body:"Bilaspur MC",b=Object.assign(Object.assign({},c),{formId:this.formId,submissionDate:m,testDate:new Date(c.testDate).getTime(),year:new Date(c.testDate).getFullYear(),stateId:(null===(e=this.currentUser)||void 0===e?void 0:e.stateId)||"",districtId:(null===(i=this.currentUser)||void 0===i?void 0:i.districtId)||"",blockId:(null===(r=this.currentUser)||void 0===r?void 0:r.blockId)||"",createdBy:(null===(n=this.currentUser)||void 0===n?void 0:n.createdBy)||"",labType:(null===(s=this.currentUser)||void 0===s?void 0:s.labType)||"",gramPanchayatName:(null==d?void 0:d.gpName)||"",municipalBodyName:f,updatedAt:Date.now()});this.labReportingService.AddManualLabReportData(b).subscribe(_=>console.log("Data inserted successfully",_),_=>console.error("Error inserting data",_)),this.loadTableData(),this.cbnaatForm.reset()}setCurrentMonth(){const e=new Date;this.currentMonth=e.toLocaleString("default",{month:"long"})}loadDistricts(){this.labReportingService.getDistricts().subscribe(e=>{this.districtList=e,this.districtMap=new Map(e.map(i=>[i.id,i.districtName]))},e=>console.error("Error fetching districts",e))}onDistrictChange(e){this.loadBlocks(e)}onBlockChange(e){this.loadGramPanchayats(e),this.loadDevelopmentBlocks(e),this.loadMunicipalBodies(e)}loadBlocks(e){if(!e)return this.blockList=[];this.labReportingService.getBlocks(e).subscribe(i=>this.blockList=i,i=>console.error("Error fetching blocks",i))}loadBlocksforApiresponse(){this.labReportingService.getAllBlocks().subscribe(e=>{this.loadAllblockList=e,this.blockMap=new Map(e.map(i=>[i.id,i.blockName]))},e=>console.error("Error loading blocks",e))}loadGramPanchayats(e){if(!e)return this.gramPanchayatList=[];this.labReportingService.getGramPanchayat(e).subscribe(i=>this.gramPanchayatList=i,i=>console.error("Error fetching Gram Panchayats",i))}loadDevelopmentBlocks(e){if(!e)return this.developmentBlockList=[];this.labReportingService.getDevlopmentBlockName(e).subscribe(i=>{var r;this.developmentBlockList=i;const n=(null===(r=null==i?void 0:i[0])||void 0===r?void 0:r.gpDevlopmentBlockName)||"";this.cbnaatForm.patchValue({developmentBlockName:n})},i=>console.error("Error fetching Development Block Name",i))}loadMunicipalBodies(e){if(!e)return this.municipalList=[];this.labReportingService.getmunicipalBodiesName(e).subscribe(i=>this.municipalList=i,i=>
1console.error("Error fetching Municipal Bodies",i))}onLocalityChange(){var e,i,r,n,s,c,m,d,p,f,b,_,C,T,D;this.isRuralSelected()?(null===(e=this.cbnaatForm.get("villageName"))||void 0===e||e.setValidators(l.kI.required),null===(i=this.cbnaatForm.get("gramPanchayatName"))||void 0===i||i.setValidators(l.kI.required),null===(r=this.cbnaatForm.get("developmentBlockName"))||void 0===r||r.setValidators(l.kI.required),null===(n=this.cbnaatForm.get("wardName"))||void 0===n||n.clearValidators(),null===(s=this.cbnaatForm.get("name_of_municipal_body"))||void 0===s||s.clearValidators()):this.isUrbanSelected()&&(null===(c=this.cbnaatForm.get("wardName"))||void 0===c||c.setValidators(l.kI.required),null===(m=this.cbnaatForm.get("name_of_municipal_body"))||void 0===m||m.setValidators(l.kI.required),null===(d=this.cbnaatForm.get("villageName"))||void 0===d||d.clearValidators(),null===(p=this.cbnaatForm.get("gramPanchayatName"))||void 0===p||p.clearValidators(),null===(f=this.cbnaatForm.get("developmentBlockName"))||void 0===f||f.clearValidators()),null===(b=this.cbnaatForm.get("villageName"))||void 0===b||b.updateValueAndValidity(),null===(_=this.cbnaatForm.get("gramPanchayatName"))||void 0===_||_.updateValueAndValidity(),null===(C=this.cbnaatForm.get("developmentBlockName"))||void 0===C||C.updateValueAndValidity(),null===(T=this.cbnaatForm.get("wardName"))||void 0===T||T.updateValueAndValidity(),null===(D=this.cbnaatForm.get("name_of_municipal_body"))||void 0===D||D.updateValueAndValidity()}onReasonForTestChange(){var e;const i=null===(e=this.cbnaatForm.get("reasonForTest"))||void 0===e?void 0:e.value,r=this.cbnaatForm.get("mtbcDetected");"presumptiveCase"===i?(null==r||r.setValidators(l.kI.required),null==r||r.enable()):(null==r||r.clearValidators(),null==r||r.setValue(null),null==r||r.disable()),null==r||r.updateValueAndValidity()}getFinancialYearDates(){const e=new Date,i=e.getFullYear();let n,s;return e.getMonth()>=3?(n=new Date(i,3,1),s=new Date(i+1,2,31,23,59,59)):(n=new Date(i-1,3,1),s=new Date(i,2,31,23,59,59)),{fromDate:n.getTime(),toDate:s.getTime()}}loadTableData(){const{fromDate:e,toDate:i}=this.getFinancialYearDates();this.labReportingService.getAllDataForCBNAAT({where:{createdBy:this.currentUser.id,submissionDate:{between:[e,i]},labType:"CBNAAT"}}).subscribe(n=>{this.districtMap?(n=n.map(s=>Object.assign(Object.assign({},s),{testDate:this.formatDate(s.testDate),submissionDate:this.formatDate(s.submissionDate),districtNameAddress:this.districtMap.get(s.districtNameAddress)||"Unknown",healthBlockAddress:this.blockMap.get(s.healthBlockAddress)||"Unknown"})),this.dataSource.data=n):console.error("District map is not initialized yet!")},n=>console.error("Error fetching data",n))}formatDate(e){return e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"}):"-"}updateTableData(){if(this.paginator&&this.allData){const e=this.paginator.pageIndex*this.paginator.pageSize;this.dataSource.data=this.allData.slice(e,e+this.paginator.pageSize)}}onPageChange(){this.updateTableData()}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(l.qu),t.Y36(q),t.Y36(z.e),t.Y36(W.o))},a.\u0275cmp=t.Xpm({type:a,selectors:[["app-labcbnnat-form"]],viewQuery:function(e,i){if(1&e&&t.Gf(F.NW,5),2&e){let r;t.iGM(r=t.CRH())&&(i.paginator=r.first)}},decls:126,vars:29,consts:[[1,"card","w-full",2,"margin-top","-2rem !important"],[1,"card-title","my-3","mx-3","p-2"],[1,"card-title"],[1,"form-container","p-2"],[1,"w-full",3,"formGroup","ngSubmit"],[1,"flex","justify-evenly","gap-1"],[1,"row"],[1,"col-lg-3","readonly-wrapper"],["appearance","outline",2,"width","100%"],["matInput","","type","text","formControlName","pageNumber","maxlength","4"],[4,"ngIf"],[1,"col-lg-3","readonly-wrapper","w-full"],["matInput","","formControlName","testDate",3,"matDatepicker"],["matSuffix","",3,"for"],["picker",""],["matInput","","formControlName","episodeID","type","text","maxlength","8"],["class","col-lg-3 readonly-wrapper",4,"ngIf"],["formControlName","districtNameAddress",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],["formControlName","healthBlockAddress",3,"selectionChange"],[1,"block","font-medium","text-gray-700","mb-2"],[1,"flex","flex-wrap","items-center","gap-2","w-full"],["formControlName","reasonForTest",1,"flex","flex-wrap","items-center","gap-2","w-full",3,"change"],["value","presumptiveCase",1,"flex","items-center"],["value","UDST",1,"flex","items-center"],["class","col-lg-2 readonly-wrapper w-full",4,"ngIf"],[1,"col-lg-2","readonly-wrapper"],[1,"flex","items-center","gap-4"],["formControlName","locality",1,"flex","items-center","space-x-4",3,"change"],["value","rural"],["value","urban"],[1,"button-container","mt-4"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[1,"card","w-full","p-2"],[1,"card-title","p-2"],[1,"table-responsive"],["mat-table","",1,"mat-elevation-z8","table","table-bordered",3,"dataSource"],["matColumnDef","pageNumber"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","testDate"],["matColumnDef","episodeID"],["matColumnDef","submissionDate"],["matColumnDef","districtNameAddress"],["matColumnDef","healthBlockAddress"],["matColumnDef","villageName"],["matColumnDef","year"],["matColumnDef","municipalBodyName"],["matColumnDef","gramPanchayatName"],["matColumnDef","locality"],["matColumnDef","mtbcDetected"],["matColumnDef","reasonForTest"],["matColumnDef","wardName"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSize","pageSizeOptions"],["appearance","outline"],["matInput","","type","text","formControlName","villageName","required",""],["matInput","","type","text","formControlName","wardName","required",""],[3,"value"],["formControlName","gramPanchayatName"],["matInput","","type","text","formControlName","developmentBlockName"],["formControlName","name_of_municipal_body"],[1,"col-lg-2","readonly-wrapper","w-full"],["formControlName","mtbcDetected",1,"flex","flex-wrap","items-center","gap-2","w-full"],["value","yes",1,"flex","items-center"],["value","no",1,"flex","items-center"],["mat-header-cell",""],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h3",2),t._uU(3,"CBNAAT Daily Form"),t.qZA()(),t.TgZ(4,"div",3)(5,"form",4),t.NdJ("ngSubmit",function(){return i.onSubmit()}),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7)(9,"mat-form-field",8)(10,"mat-label"),t._uU(11,"Page No. of Register"),t.qZA(),t._UZ(12,"input",9),t.YNc(13,vt,2,0,"mat-error",10),t.YNc(14,Tt,2,0,"mat-error",10),t.YNc(15,Ct,2,0,"mat-error",10),t.qZA()(),t.TgZ(16,"div",11)(17,"mat-form-field",8)(18,"mat-label"),t._uU(19,"Test Date *"),t.qZA(),t._UZ(20,"input",12)(21,"mat-datepicker-toggle",13)(22,"mat-datepicker",null,14),t.YNc(24,Dt,2,0,"mat-error",10),t.qZA()(),t.TgZ(25,"div",7)(26,"mat-form-field",8)(27,"mat-label"),t._uU(28,"Episode ID"),t.qZA(),t._UZ(29,"input",15),t.YNc(30,Zt,2,0,"mat-error",10),t.YNc(31,At,2,0,"mat-error",10),t.YNc(32,Nt,2,0,"mat-error",10),t.YNc(33,yt,2,0,"mat-error",10),t.qZA()(),t.YNc(34,Lt,6,1,"div",16),t.YNc(35,xt,5,0,"div",16),t.TgZ(36,"div",7)(37,"mat-form-field",8)(38,"mat-label"),t._uU(39,"District Name Address "),t.qZA(),t.TgZ(40,"mat-select",17),t.NdJ("selectionChange",function(n){return i.onDistrictChange(n.value)}),t.YNc(41,Ft,2,2,"mat-option",18),t.qZA(),t.YNc(42,kt,2,0,"mat-error",10),t.qZA()(),t.TgZ(43,"div",7)(44,"mat-form-field",8)(45,"mat-label"),t._uU(46,"Health Block Address "),t.qZA(),t.TgZ(47,"mat-select",19),t.NdJ("selectionChange",function(n){return i.onBlockChange(n.value)}),t.YNc(48,It,2,2,"mat-option",18),t.qZA()()(),t.YNc(49,Bt,7,2,"div",16),t.YNc(50,Yt,5,0,"div",16),t.YNc(51,Qt,7,2,"div",16),t.TgZ(52,"div",11)(53,"label",20),t._uU(54,"Reason For Test *"),t.qZA(),t.TgZ(55,"div",21)(56,"mat-radio-group",22),t.NdJ("change",function(){return i.onReasonForTestChange()}),t.TgZ(57,"mat-radio-button",23),t._uU(58,"Presumptive Case"),t.qZA(),t.TgZ(59,"mat-radio-button",24),t._uU(60,"UDST"),t.qZA()()(),t.YNc(61,Jt,2,0,"mat-error",10),t.qZA(),t.YNc(62,Pt,10,1,"div",25),t.TgZ(63,"div",26)(64,"label",20),t._uU(65,"Locality *"),t.qZA(),t.TgZ(66,"div",27)(67,"mat-radio-group",28),t.NdJ("change",function(){return i.onLocalityChange()}),t.TgZ(68,"mat-radio-button",29),t._uU(69,"Rural (Gram Panchayat)"),t.qZA(),t.TgZ(70,"mat-radio-button",30),t._uU(71,"Urban (Municipal Bodies)"),t.qZA()()(),t.YNc(72,$t,2,0,"mat-error",10),t.qZA()()(),t.TgZ(73,"div",31)(74,"button",32),t._uU(75," Save Data "),t.qZA()()()()(),t.TgZ(76,"div",33)(77,"h3",34),t._uU(78," Show the data based on filled form Data"),t.qZA(),t.TgZ(79,"div",35)(80,"table",36),t.ynx(81,37),t.YNc(82,Ot,2,0,"th",38),t.YNc(83,jt,2,1,"td",39),t.BQk(),t.ynx(84,40),t.YNc(85,Et,2,0,"th",38),t.YNc(86,Vt,2,1,"td",39),t.BQk(),t.ynx(87,41),t.YNc(88,Gt,2,0,"th",38),t.YNc(89,zt,2,1,"td",39),t.BQk(),t.ynx(90,42),t.YNc(91,Wt,2,0,"th",38),t.YNc(92,Ht,2,1,"td",39),t.BQk(),t.ynx(93,43),t.YNc(94,Xt,2,0,"th",38),t.YNc(95,Kt,2,1,"td",39),t.BQk(),t.ynx(96,44),t.YNc(97,te,2,0,"th",38),t.YNc(98,ee,2,1,"td",39),t.BQk(),t.ynx(99,45),t.YNc(100,ae,2,0,"th",38),t.YNc(101,ie,2,1,"td",39),t.BQk(),t.ynx(102,46),t.YNc(103,oe,2,0,"th",38),t.YNc(104,re,2,1,"td",39),t.BQk(),t.ynx(105,47),t.YNc(106,ne,2,0,"th",38),t.YNc(107,le,2,1,"td",39),t.BQk(),t.ynx(108,48),t.YNc(109,se,2,0,"th",38),t.YNc(110,me,2,1,"td",39),t.BQk(),t.ynx(111,49),t.YNc(112,ce,2,0,"th",38),t.YNc(113,de,2,1,"td",39),t.BQk(),t.ynx(114,50),t.YNc(115,ue,2,0,"th",38),t.YNc(116,pe,2,1,"td",39),t.BQk(),t.ynx(117,51),t.YNc(118,he,2,0,"th",38),t.YNc(119,_e,2,1,"td",39),t.BQk(),t.ynx(120,52),t.YNc(121,fe,2,0,"th",38),t.YNc(122,be,2,1,"td",39),t.BQk(),t.YNc(123,ge,1,0,"tr",53),t.YNc(124,ve,1,0,"tr",54),t.qZA()(),t._UZ(125,"mat-paginator",55),t.qZA()),2&e){const r=t.MAs(23);let n,s,c,m,d,p,f,b,_,C,T,D;t.xp6(5),t.Q6J("formGroup",i.cbnaatForm),t.xp6(8),t.Q6J("ngIf",null==(n=i.cbnaatForm.get("pageNumber"))?null:n.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(s=i.cbnaatForm.get("pageNumber"))?null:s.hasError("maxlength")),t.xp6(1),t.Q6J("ngIf",null==(c=i.cbnaatForm.get("pageNumber"))?null:c.hasError("pattern")),t.xp6(5),t.Q6J("matDatepicker",r),t.xp6(1),t.Q6J("for",r),t.xp6(3),t.Q6J("ngIf",null==(m
1=i.cbnaatForm.get("testDate"))?null:m.hasError("required")),t.xp6(6),t.Q6J("ngIf",null==(d=i.cbnaatForm.get("episodeID"))?null:d.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(p=i.cbnaatForm.get("episodeID"))?null:p.hasError("minlength")),t.xp6(1),t.Q6J("ngIf",null==(f=i.cbnaatForm.get("episodeID"))?null:f.hasError("maxlength")),t.xp6(1),t.Q6J("ngIf",null==(b=i.cbnaatForm.get("episodeID"))?null:b.hasError("pattern")),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isUrbanSelected()),t.xp6(6),t.Q6J("ngForOf",i.districtList),t.xp6(1),t.Q6J("ngIf",null==(_=i.cbnaatForm.get("districtNameAddress"))?null:_.hasError("required")),t.xp6(6),t.Q6J("ngForOf",i.blockList),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isUrbanSelected()),t.xp6(10),t.Q6J("ngIf",null==(C=i.cbnaatForm.get("reasonForTest"))?null:C.hasError("required")),t.xp6(1),t.Q6J("ngIf","presumptiveCase"===(null==(T=i.cbnaatForm.get("reasonForTest"))?null:T.value)),t.xp6(10),t.Q6J("ngIf",null==(D=i.cbnaatForm.get("locality"))?null:D.hasError("required")),t.xp6(2),t.Q6J("disabled",!i.cbnaatForm.valid),t.xp6(6),t.Q6J("dataSource",i.dataSource),t.xp6(43),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",10)("pageSizeOptions",t.DdM(28,Te))}},dependencies:[Z.sg,Z.O5,x.ey,L.lW,g.Mq,g.hl,g.nW,v.TO,v.KE,v.hX,v.R9,y.Nt,F.NW,w.VQ,w.U0,N.gD,u.BZ,u.fO,u.as,u.w1,u.Dz,u.nj,u.ge,u.ev,u.XQ,u.Gk,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.nD,l.sg,l.u],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}.d-flex[_ngcontent-%COMP%]{gap:5px}.currmonth[_ngcontent-%COMP%]{color:#7393b3}"]}),a})();function De(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.districtName," ")}}function Ze(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1,"District is required!!!"),t.qZA())}function Ae(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.blockName," ")}}function Ne(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e)}}function ye(a,o){1&a&&t._UZ(0,"mat-error")}function Ue(a,o){if(1&a){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",6)(2,"h1",7),t._uU(3,"Lab Report"),t.qZA(),t.TgZ(4,"p",8),t._uU(5,"Download the raw data report"),t.qZA(),t.TgZ(6,"form",9)(7,"div",10)(8,"div",11)(9,"mat-form-field",12)(10,"mat-label"),t._uU(11,"District"),t.qZA(),t.TgZ(12,"mat-select",13),t.NdJ("selectionChange",function(r){t.CHM(e);const n=t.oxw();return t.KtG(n.getBlocks(r,""))}),t.YNc(13,De,2,2,"mat-option",14),t.ALo(14,"async"),t.qZA(),t.YNc(15,Ze,2,0,"mat-error",15),t.qZA()(),t.TgZ(16,"div",11)(17,"mat-form-field",12)(18,"mat-label"),t._uU(19,"Block"),t.qZA(),t.TgZ(20,"mat-select",16),t.YNc(21,Ae,2,2,"mat-option",14),t.ALo(22,"async"),t.qZA()()(),t.TgZ(23,"div",11)(24,"mat-form-field",12)(25,"mat-label"),t._uU(26,"Select Report Type"),t.qZA(),t.TgZ(27,"mat-select",17)(28,"mat-option",18),t._uU(29,"Web Report"),t.qZA(),t.TgZ(30,"mat-option",19),t._uU(31,"Registered Report"),t.qZA()()()(),t.TgZ(32,"div",11)(33,"mat-form-field",12)(34,"mat-label"),t._uU(35,"Select Date"),t.qZA(),t._UZ(36,"input",20)(37,"mat-datepicker-toggle",21)(38,"mat-datepicker",null,22),t.qZA()(),t.TgZ(40,"div",11)(41,"mat-form-field",12)(42,"mat-label"),t._uU(43,"Select Lab Type"),t.qZA(),t.TgZ(44,"mat-select",23),t.YNc(45,Ne,2,2,"mat-option",14),t.qZA()()(),t.TgZ(46,"div",11)(47,"mat-form-field",12)(48,"mat-label"),t._uU(49,"Select Date range"),t.qZA(),t.TgZ(50,"div",24)(51,"div",25)(52,"mat-date-range-input",26),t._UZ(53,"input",27)(54,"input",28),t.qZA(),t._UZ(55,"mat-datepicker-toggle",29),t.qZA(),t._UZ(56,"mat-date-range-picker",null,30),t.qZA(),t.YNc(58,ye,1,0,"mat-error",15),t.qZA()()(),t.TgZ(59,"div",31)(60,"button",32),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.generateReport())}),t._uU(61,"Download Report"),t.qZA()()()()()}
1if(2&a){const e=t.MAs(39),i=t.MAs(57),r=t.oxw();t.xp6(6),t.Q6J("formGroup",r.form),t.xp6(7),t.Q6J("ngForOf",t.lcZ(14,12,r.districts$)),t.xp6(2),t.Q6J("ngIf",r.form.controls.districtId.invalid),t.xp6(6),t.Q6J("ngForOf",t.lcZ(22,14,r.blocks$)),t.xp6(15),t.Q6J("matDatepicker",e),t.xp6(1),t.Q6J("for",e),t.xp6(8),t.Q6J("ngForOf",r.labTypeList),t.xp6(7),t.Q6J("rangePicker",i),t.xp6(3),t.Q6J("for",i),t.xp6(3),t.Q6J("ngIf",r.form.controls.startDate.invalid),t.xp6(2),t.Q6J("disableRipple",!1)("disabled",r.form.invalid)}}function Le(a,o){if(1&a&&(t.TgZ(0,"th"),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.header," ")}}function xe(a,o){if(1&a&&(t.TgZ(0,"tr"),t.YNc(1,Le,2,1,"th",34),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.Q6J("ngForOf",e)}}function Fe(a,o){if(1&a&&t._UZ(0,"p-treeTableToggler",37),2&a){const e=t.oxw(2).$implicit;t.Q6J("rowNode",e)}}function ke(a,o){if(1&a&&(t.TgZ(0,"td"),t.YNc(1,Fe,1,1,"p-treeTableToggler",36),t._uU(2),t.qZA()),2&a){const e=o.$implicit,i=o.index,r=t.oxw().rowData;t.xp6(1),t.Q6J("ngIf",0===i),t.xp6(1),t.hij(" ",r[e.field]," ")}}function Ie(a,o){if(1&a&&(t.TgZ(0,"tr",35),t.YNc(1,ke,3,2,"td",34),t.qZA()),2&a){const i=o.columns;t.Q6J("ttRow",o.$implicit),t.xp6(1),t.Q6J("ngForOf",i)}}const qe=function(){return{"min-width":"50rem"}};let we=(()=>{class a{constructor(e,i,r,n,s,c,m,d,p){this.fb=e,this.labReportingService=i,this.fileLibraryServices=r,this._auth=n,this.districtService=s,this.blockService=c,this.PhiService=m,this.labReportingManualService=d,this.nodeService=p,this.subscription=new M.w0,this.disableBlock=!1,this.disableDistrict=!1,this.CoughsyrupsurveillanceReport=!1,this.LabReport=!0,this.labTypeList=[],this.designationList=[],this.showDistrictTable=!0,this.showBlockTable=!0,this.showLabTable=!0,this.outOfTree=!1,this.columns=[{field:"name",header:"Name"},{field:"size",header:"Size"},{field:"type",header:"Type"}],this.currentUser=this._auth.currentUserValue}ngOnInit(){var e,i,r,n,s,c,m,d,p,f;this.nodeService.getFilesystem().then(_=>{console.log(_),this.files=_}),!(null===(e=this.currentUser)||void 0===e)&&e.stateId&&(this.districts$=this.districtService.getDistricts({stateId:null===(i=this.currentUser)||void 0===i?void 0:i.stateId})),this.labTypeList="DMC"===this.currentUser.labType||"CBNAAT"===this.currentUser.labType||"TrueNAAT"===this.currentUser.labType?[this.currentUser.labType]:["All","DMC","CBNAAT","TrueNAAT"],this.blocks$=this.blockService.getBlocks({}),this.phis$=this.PhiService.getBlockPHIs({}),((null===(r=this.currentUser)||void 0===r?void 0:r.districtId)||(null===(n=this.currentUser)||void 0===n?void 0:n.blockId)||(null===(s=this.currentUser)||void 0===s?void 0:s.phiId))&&(this.getBlocks(null,null===(c=this.currentUser)||void 0===c?void 0:c.districtId),this.getPhis(null,null===(m=this.currentUser)||void 0===m?void 0:m.districtId,null===(d=this.currentUser)||void 0===d?void 0:d.blockId),this.disableDistrict=!(null===(p=this.currentUser)||void 0===p||!p.districtId),this.disableBlock=!(null===(f=this.currentUser)||void 0===f||!f.blockId)),this.form=this.createForm(),this.formCough=this.createCoughForm(),A()().month()+1>3?(this.fromDate=A()().month(3).startOf("month").format("YYYY-MM-DD"),this.toDate=A()().format("YYYY-MM-DD")):(this.fromDate=A()().month(3).startOf("month").subtract(1,"years").format("YYYY-MM-DD"),this.toDate=A()().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)):"Lab"===this.currentUser.designation&&(this.showLabTable=!1,this.getLabTable(this.currentUser))}onClickedOutside(e){console.log("Clicked outside:",e),this.outOfTree=!0}createForm(){var e,i,r;return this.fb.group({districtId:[{value:null!==(e=this.currentUser)&&void 0!==e&&e.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict},[l.kI.required]],blockId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.blockId?null===(r=this.currentUser)||void 0===r?void 0:r.blockId:"",disabled:this.disableBlock}],reportType:[""],labType:[""],date:[""],startDate:[""],endDate:[""]})}createCoughForm(){var e,i,r;return this.fb.group({districtId:[{value:null!==(e=this.currentUser)&&void 0!==e&&e.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict},[l.kI.required]],blockId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.blockId?null===(r=this.currentUser)||void 0===r?void 0:r.blockId:"",disabled:this.disableBlock}],startDate:[""],endDate:[""]})}getBlocks(e,i){var r,n;i=null!==(n=null===(r=null==this?void 0:this.form)||void 0===r?void 0:r.value)&&void 0!==n&&n.hasOwnProperty("districtId")?this.form.value.districtId:this.currentUser.districtId,this.blocks$=this.blockService.getBlocks({districtId:i})}getPhis(e,i,r){}onChange(e){"LabReport"===e?(this.LabReport=!0,this.CoughsyrupsurveillanceReport=!1):"CoughsyrupsurveillanceReport"===e?(this.CoughsyrupsurveillanceReport=!0,this.LabReport=!1):(this.LabReport=!1,this.CoughsyrupsurveillanceReport=!1)}generateReport(){const e={designation:this.currentUser.designation,labType:this.form.value.labType,date:this.form.value.date,fromDate:this.form.value.startDate,toDate:this.form.value.endDate,districtId:this.currentUser.districtId?this.currentUser.districtId:this.form.value.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:this.form.value.blockId};"register"==this.form.value.reportType?this.labReportingManualService.getManualLabReport(e).subscribe(i=>{I().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(r=>{r.value&&this.fileLibraryServices.downloadFileWithContainer(i).subscribe(n=>{const s=new Blob([n],{type:n.type}),c=window.URL.createObjectURL(s),m=document.createElement("a");m.href=c,m.download=i,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(c)})})}):this.labReportingService.getlabReport(e).subscribe(i=>{I().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(r=>{r.value&&this.fileLibraryServices.downloadFileWithContainer(i).subscribe(n=>{const s=new Blob([n],{type:n.type}),c=window.URL.createObjectURL(s),m=document.createElement("a");m.href=c,m.download=i,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(c)})})})}getStateTable(){this.stateTitle=`State level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,designation:this.currentUser.designation,stateId:this.currentUser.stateId}).subscribe(i=>{console.log("responsestate=====>",i),this.phichoahc=new u.by(i)})}getDistrictTable(e){this.districtTitle=`District level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showDistrictTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,labType:this.labTypeList,toDate:this.toDate,stateId:this.currentUser.stateId?this.currentUser.stateId:e.stateId,districtId:this.currentUser.districtId?this.currentUser.districtId:e.districtId,designation:"District"}).subscribe(r=>{console.log("responsedistrict=====>",r),this.phichoahcDistrict=new u.by(r)})}getBlockTable(e){this.blockTitle=`Block level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showBlockTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,stateId:this.currentUser.stateId?this.currentUser.stateId:e.stateId,districtId:e._id?e._id:e.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:e.blockId,designation:"Block"}).subscribe(r=>{this.phichoahcBlock=new u.by(r)})}getLabTable(e){this.labTitle=`Lab level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showLabTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,stateId:this.currentUser.stateId,districtId:this.currentUser.districtId,blockId:e._id,designation:"Lab"}).subscribe(r=>{this.phichoahcLab=new u.by(r)})}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(l.qu),t.Y36(P),t.Y36($.n),t.Y36(O.e8),t.Y36(j.R),t.Y36(E.g),t.Y36(V.B),t.Y36(q),t.Y36(G.D))}
1,a.\u0275cmp=t.Xpm({type:a,selectors:[["app-lab-cbnnat-report"]],decls:7,vars:6,consts:[["class","card w-full",4,"ngIf"],[1,"card"],[3,"value","columns","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],[1,"card","w-full"],[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"],["placeholder","Select Report Type","formControlName","reportType"],["value","Web"],["value","register"],["matInput","","formControlName","date","placeholder","date",3,"matDatepicker"],["matSuffix","",3,"for"],["picker1",""],["placeholder","Select Designation","formControlName","labType"],[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",""],[1,"d-flex","justify-content-center"],["mat-raised-button","","color","primary",3,"disableRipple","disabled","click"],[3,"value"],[4,"ngFor","ngForOf"],[3,"ttRow"],[3,"rowNode",4,"ngIf"],[3,"rowNode"]],template:function(e,i){1&e&&(t.TgZ(0,"h1"),t._uU(1,"CBNAAT daily Report in progress"),t.qZA(),t.YNc(2,Ue,62,16,"div",0),t.TgZ(3,"div",1)(4,"p-treeTable",2),t.YNc(5,xe,2,1,"ng-template",3),t.YNc(6,Ie,2,2,"ng-template",4),t.qZA()()),2&e&&(t.xp6(2),t.Q6J("ngIf",i.LabReport),t.xp6(2),t.Q6J("value",i.files)("columns",i.columns)("scrollable",!0)("tableStyle",t.DdM(5,qe)))},dependencies:[Z.sg,Z.O5,x.ey,L.lW,g.Mq,g.hl,g.nW,g.wx,g.zY,g.By,g._g,v.TO,v.KE,v.hX,v.R9,y.Nt,N.gD,l._Y,l.Fj,l.JJ,l.JL,l.sg,l.u,U.iw,Q.jx,U.gc,U.V4,Z.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}.d-flex[_ngcontent-%COMP%]{gap:5px}.mat-raised-button[_ngcontent-%COMP%]{background-color:#0096ff;color:#fff;margin-top:10px}table[_ngcontent-%COMP%]{width:100%}"]}),a})();function Be(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Page number is required. "),t.qZA())}function Ye(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Page number cannot exceed 4 digits. "),t.qZA())}function Re(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Only numeric values are allowed. "),t.qZA())}function Se(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Date is required "),t.qZA())}function Qe(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID is required. "),t.qZA())}function Je(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID must be at least 2 digits. "),t.qZA())}function Me(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID cannot exceed 8 digits. "),t.qZA())}function Pe(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Only numeric values are allowed. "),t.qZA())}function $e(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function Oe(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",58)(2,"mat-label"),t._uU(3,"Village Name "),t.qZA(),t._UZ(4,"input",59),t.YNc(5,$e,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngIf",null==(i=e.cbnaatForm.get("villageName"))?null:i.hasError("required"))}}function je(a,o){1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",58)(2,"mat-label"),t._uU(3,"Ward Name *"),t.qZA(),t._UZ(4,"input",60),t.qZA()())}function Ee(a,o){if(1&a&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.districtName," ")}}function Ve(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option "),t.qZA())}function Ge(a,o){if(1&a&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.blockName," ")}}function ze(a,o){if(1&a&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.gpName," ")}}function We(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select a Gram Panchayat "),t.qZA())}function He(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Gram Panchayat Name "),t.qZA(),t.TgZ(4,"mat-select",62),t.YNc(5,ze,2,2,"mat-option",19),t.qZA(),t.YNc(6,We,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngForOf",e.gramPanchayatList),t.xp6(1),t.Q6J("ngIf",null==(i=e.cbnaatForm.get("gramPanchayatName"))?null:i.hasError("required"))}}function Xe(a,o){1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Development Block Name "),t.qZA(),t._UZ(4,"input",63),t.qZA()())}function Ke(a,o){if(1&a&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.name_of_municipal_body," ")}}function ta(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select a Municipal Body "),t.qZA())}function ea(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Municipal Body Name *"),t.qZA(),t.TgZ(4,"mat-select",64),t.YNc(5,Ke,2,2,"mat-option",19),t.qZA(),t.YNc(6,ta,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngForOf",e.municipalList),t.xp6(1),t.Q6J("ngIf",null==(i=e.cbnaatForm.get("name_of_municipal_body"))?null:i.hasError("required"))}}function aa(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option\n"),t.qZA())}function ia(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option\n"),t.qZA())}function oa(a,o){if(1&a&&(t.TgZ(0,"div",65)(1,"label",21),t._uU(2,"Whether MTBC Detected? *"),t.qZA(),t.TgZ(3,"div",22)(4,"mat-radio-group",66)(5,"mat-radio-button",67),t._uU(6,"Yes"),t.qZA(),t.TgZ(7,"mat-radio-button",68),t._uU(8,"No"),t.qZA()()(),t.YNc(9,ia,2,0,"mat-error",10),t.qZA()),2&a){const e=t.oxw();let i;t.xp6(9),t.Q6J("ngIf",null==(i=e.cbnaatForm.get("mtbcDetected"))?null:i.hasError("required"))}}function ra(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select Rural or Urban\n"),t.qZA())}function na(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Development Block "),t.qZA())}function la(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.developmentBlockName," ")}}function sa(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Test Date "),t.qZA())}function ma(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.testDate," ")}}function ca(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Episode ID "),t.qZA())}function da(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.episodeID," ")}}function ua(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Submission Date "),t.qZA())}function pa(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.submissionDate," ")}}function ha(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," District Name "),t.qZA())}function _a(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.districtNameAddress," ")}}function fa(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Health Block "),t.qZA())}function ba(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.healthBlockAddress," ")}}function ga(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Year "),t.qZA())}function va(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.year," ")}}function Ta(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Municipal Body "),t.qZA())}function Ca(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.municipalBodyName," ")}}function Da(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Gram Panchayat "),t.qZA())}function Za(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.gramPanchayatName," ")}}function Aa(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Locality "),t.qZA())}function Na(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.locality," ")}}function ya(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," MTBC Detected "),t.qZA())}function Ua(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.mtbcDetected," ")}}function La(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Reason For Test "),t.qZA())}function xa(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.reasonForTest," ")}}function Fa(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Village Name "),t.qZA())}function ka(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.villageName," ")}}function Ia(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Ward Name "),t.qZA())}function qa(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.wardName," ")}}function wa(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Page No. "),t.qZA())}function Ba(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.pageNumber," ")}}function Ya(a,o){1&a&&t._UZ(0,"tr",71)}function Ra(a,o){1&a&&t._UZ(0,"tr",72)}const Sa=function(){return[5,10,20]};let Qa=(()=>{class a{constructor(e,i,r){this.fb=e,this.labReportingService=i,this.authService=r,this.districtList=[],this.districtMap=new Map,this.loadAllblockList=[],this.blockList=[],this.blockMap=new Map,this.gramPanchayatList=[],this.developmentBlockList=[],this.municipalList=[],this.allData=[],this.dataSource=new u.by([]),this.displayedColumns=["testDate","episodeID","submissionDate","districtNameAddress","year","municipalBodyName","locality","mtbcDetected","reasonForTest","villageName","wardName","pageNumber","developmentBlockName","reasonForTest","gramPanchayatName","healthBlockAddress"],this.currentMonth="",this.currentUser=this.authService.currentUserValue,this.initializeForm(),this.loadDistricts()}isRuralSelected(){var e;return"rural"===(null===(e=this.cbnaatForm.get("locality"))||void 0===e?void 0:e.value)}isUrbanSelected(){var e;return"urban"===(null===(e=this.cbnaatForm.get("locality"))||void 0===e?void 0:e.value)}ngOnInit(){var e;null===(e=this.cbnaatForm.get("locality"))||void 0===e||e.valueChanges.subscribe(()=>{this.onLocalityChange()}),this.onReasonForTestChange(),this.loadAllTrueNAATDataTable(),this.loadBlocksforApiresponse(),this.setCurrentMonth()}ngAfterViewInit(){this.dataSource.paginator=this.paginator}setCurrentMonth(){const e=new Date;
1this.currentMonth=e.toLocaleString("default",{month:"long"})}initializeForm(){this.cbnaatForm=this.fb.group({pageNumber:["",[l.kI.required,l.kI.maxLength(4),l.kI.pattern(/^\d+$/)]],villageName:[""],testDate:[new Date,l.kI.required],wardName:[""],episodeID:["",[l.kI.required,l.kI.minLength(2),l.kI.maxLength(8),l.kI.pattern(/^\d+$/)]],gramPanchayatName:["",l.kI.required],developmentBlockName:["",l.kI.required],reasonForTest:[""],locality:[""],districtNameAddress:["",l.kI.required],healthBlockAddress:["",l.kI.required],municipalBodyName:[""],mtbcDetected:[{value:null,disabled:!0}]})}onSubmit(){var e,i,r,n,s;if(this.cbnaatForm.invalid)return;const c=this.cbnaatForm.value,m=this.gramPanchayatList.find(b=>b.id===c.gramPanchayatName),d=this.municipalList.find(b=>b.id===c.municipalBodyName),p=d?d.name_of_municipal_body:"Bilaspur MC",f=Object.assign(Object.assign({},c),{formId:"653f89291a50ac7d7d6f6263",testDate:new Date(c.testDate).getTime(),year:new Date(c.testDate).getFullYear(),stateId:(null===(e=this.currentUser)||void 0===e?void 0:e.stateId)||"",submissionDate:Date.now(),districtId:(null===(i=this.currentUser)||void 0===i?void 0:i.districtId)||"",blockId:(null===(r=this.currentUser)||void 0===r?void 0:r.blockId)||"",createdBy:(null===(n=this.currentUser)||void 0===n?void 0:n.createdBy)||"",labType:(null===(s=this.currentUser)||void 0===s?void 0:s.labType)||"",gramPanchayatName:(null==m?void 0:m.gpName)||"",municipalBodyName:p,updatedAt:Date.now()});this.labReportingService.AddManualLabReportData(f).subscribe(b=>console.log("Data inserted successfully",b),b=>console.error("Error inserting data",b)),this.loadAllTrueNAATDataTable()}loadDistricts(){this.labReportingService.getDistricts().subscribe(e=>{this.districtList=e,this.districtMap=new Map(e.map(i=>[i.id,i.districtName])),console.log("Districts",this.districtMap)},e=>console.error("Error fetching districts",e))}onDistrictChange(e){this.loadBlocks(e)}onBlockChange(e){this.loadGramPanchayats(e),this.loadDevelopmentBlocks(e),this.loadMunicipalBodies(e)}loadBlocks(e){if(!e)return this.blockList=[];this.labReportingService.getBlocks(e).subscribe(i=>this.blockList=i,i=>console.error("Error fetching blocks",i))}loadBlocksforApiresponse(){this.labReportingService.getAllBlocks().subscribe(e=>{this.loadAllblockList=e,this.blockMap=new Map(e.map(i=>[i.id,i.blockName]))},e=>console.error("Error loading blocks",e))}loadGramPanchayats(e){if(!e)return this.gramPanchayatList=[];this.labReportingService.getGramPanchayat(e).subscribe(i=>this.gramPanchayatList=i,i=>console.error("Error fetching Gram Panchayats",i))}loadDevelopmentBlocks(e){if(!e)return this.developmentBlockList=[];this.labReportingService.getDevlopmentBlockName(e).subscribe(i=>{var r;this.developmentBlockList=i;const n=(null===(r=null==i?void 0:i[0])||void 0===r?void 0:r.gpDevlopmentBlockName)||"";this.cbnaatForm.patchValue({developmentBlockName:n})},i=>console.error("Error fetching Development Block Name",i))}loadMunicipalBodies(e){if(!e)return this.municipalList=[];this.labReportingService.getmunicipalBodiesName(e).subscribe(i=>this.municipalList=i,i=>console.error("Error fetching Municipal Bodies",i))}onLocalityChange(){var e,i,r,n,s,c,m,d,p,f,b,_,C,T,D;this.isRuralSelected()?(null===(e=this.cbnaatForm.get("villageName"))||void 0===e||e.setValidators(l.kI.required),null===(i=this.cbnaatForm.get("gramPanchayatName"))||void 0===i||i.setValidators(l.kI.required),null===(r=this.cbnaatForm.get("developmentBlockName"))||void 0===r||r.setValidators(l.kI.required),null===(n=this.cbnaatForm.get("wardName"))||void 0===n||n.clearValidators(),null===(s=this.cbnaatForm.get("name_of_municipal_body"))||void 0===s||s.clearValidators()):this.isUrbanSelected()&&(null===(c=this.cbnaatForm.get("wardName"))||void 0===c||c.setValidators(l.kI.required),null===(m=this.cbnaatForm.get("name_of_municipal_body"))||void 0===m||m.setValidators(l.kI.required),null===(d=this.cbnaatForm.get("villageName"))||void 0===d||d.clearValidators(),null===(p=this.cbnaatForm.get("gramPanchayatName"))||void 0===p||p.clearValidators(),null===(f=this.cbnaatForm.get("developmentBlockName"))||void 0===f||f.clearValidators()),null===(b=this.cbnaatForm.get("villageName"))||void 0===b||b.updateValueAndValidity(),null===(_=this.cbnaatForm.get("gramPanchayatName"))||void 0===_||_.updateValueAndValidity(),null===(C=this.cbnaatForm.get("developmentBlockName"))||void 0===C||C.updateV
1alueAndValidity(),null===(T=this.cbnaatForm.get("wardName"))||void 0===T||T.updateValueAndValidity(),null===(D=this.cbnaatForm.get("name_of_municipal_body"))||void 0===D||D.updateValueAndValidity()}onReasonForTestChange(){var e;const i=null===(e=this.cbnaatForm.get("reasonForTest"))||void 0===e?void 0:e.value,r=this.cbnaatForm.get("mtbcDetected");"presumptiveCase"===i?(null==r||r.setValidators(l.kI.required),null==r||r.enable()):(null==r||r.clearValidators(),null==r||r.setValue(null),null==r||r.disable()),null==r||r.updateValueAndValidity()}getFinancialYearDates(){const e=new Date,i=e.getFullYear();let n,s;return e.getMonth()>=3?(n=new Date(i,3,1),s=new Date(i+1,2,31,23,59,59)):(n=new Date(i-1,3,1),s=new Date(i,2,31,23,59,59)),{fromDate:n.getTime(),toDate:s.getTime()}}loadAllTrueNAATDataTable(){const{fromDate:e,toDate:i}=this.getFinancialYearDates();this.labReportingService.getAllDataForTrueNAAT({where:{createdBy:this.currentUser.id,submissionDate:{between:[e,i]},labType:"TrueNAAT"}}).subscribe(n=>{console.log("API Response:",n),this.districtMap?(n=n.map(s=>{console.log("Before Mapping:",s);const c=Object.assign(Object.assign({},s),{testDate:this.formatDate(s.testDate),submissionDate:this.formatDate(s.submissionDate),districtNameAddress:this.districtMap.get(s.districtNameAddress)||"Unknown",healthBlockAddress:this.blockMap.get(s.healthBlockAddress)||"Unknown"});return console.log("After Mapping:",c),c}),console.log("Final Processed Data:",n),this.dataSource.data=n):console.error("District map is not initialized yet!")},n=>console.error("Error fetching data",n))}formatDate(e){return e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"}):"-"}updateTableData(){if(this.paginator&&this.allData){const e=this.paginator.pageIndex*this.paginator.pageSize;this.dataSource.data=this.allData.slice(e,e+this.paginator.pageSize)}}onPageChange(){this.updateTableData()}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(l.qu),t.Y36(q),t.Y36(z.e))},a.\u0275cmp=t.Xpm({type:a,selectors:[["app-lab-truenaat-form"]],viewQuery:function(e,i){if(1&e&&t.Gf(F.NW,5),2&e){let r;t.iGM(r=t.CRH())&&(i.paginator=r.first)}},decls:129,vars:29,consts:[[1,"card","w-full",2,"margin-top","-2rem !important"],[1,"card-title","my-3","mx-3","p-2"],[1,"card-title"],[1,"form-container","p-2"],[1,"w-full",3,"formGroup","ngSubmit"],[1,"flex","justify-evenly","gap-1"],[1,"row"],[1,"col-lg-3","readonly-wrapper"],["appearance","outline",2,"width","100%"],["matInput","","type","text","formControlName","pageNumber","maxlength","4"],[4,"ngIf"],[1,"col-lg-3","readonly-wrapper","w-full"],["appearance","outline",1,"w-full"],["matInput","","formControlName","testDate",3,"matDatepicker"],["matSuffix","",3,"for"],["picker",""],["matInput","","formControlName","episodeID","type","text","maxlength","8"],["class","col-lg-3 readonly-wrapper",4,"ngIf"],["formControlName","districtNameAddress",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],["formControlName","healthBlockAddress",3,"selectionChange"],[1,"block","font-medium","text-gray-700","mb-2"],[1,"flex","flex-wrap","items-center","gap-2","w-full"],["formControlName","reasonForTest",1,"flex","flex-wrap","items-center","gap-2","w-full",3,"change"],["value","presumptiveCase",1,"flex","items-center"],["value","UDST",1,"flex","items-center"],["class","col-lg-2 readonly-wrapper w-full",4,"ngIf"],[1,"col-lg-2","readonly-wrapper"],[1,"flex","items-center","gap-4"],["formControlName","locality",1,"flex","items-center","space-x-4",3,"change"],["value","rural"],["value","urban"],[1,"button-container","mt-4"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[1,"card","w-full","p-2"],[1,"card-title","p-2"],[1,"table-responsive"],["mat-table","",1,"mat-elevation-z8","table","table-bordered",3,"dataSource"],["matColumnDef","developmentBlockName"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","testDate"],["matColumnDef","episodeID"],["matColumnDef","submissionDate"],["matColumnDef","districtNameAddress"],["matColumnDef","healthBlockAddress"],["matColumnDef","year"],["matColumnDef","municipalBodyName"],["matColumnDef","gramPanchayatName"],["matColumnDef","locality"],["matColumnDef","mtbcDetected"],["matColumnDef","reasonForTest"],["matColumnDef","villageName"],["matColumnDef","wardName"],["matColumnDef","pageNumber"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSize","pageSizeOptions"],["appearance","outline"],["matInput","","type","text","formControlName","villageName","required",""],["matInput","","type","text","formControlName","wardName","required",""],[3,"value"],["formControlName","gramPanchayatName"],["matInput","","type","text","formControlName","developmentBlockName"],["formControlName","name_of_municipal_body"],[1,"col-lg-2","readonly-wrapper","w-full"],["formControlName","mtbcDetected",1,"flex","flex-wrap","items-center","gap-2","w-full"],["value","yes",1,"flex","items-center"],["value","no",1,"flex","items-center"],["mat-header-cell",""],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h3",2),t._uU(3,"TrueNAAT Daily Form"),t.qZA()(),t.TgZ(4,"div",3)(5,"form",4),t.NdJ("ngSubmit",function(){return i.onSubmit()}),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7)(9,"mat-form-field",8)(10,"mat-label"),t._uU(11,"Page No. of Register"),t.qZA(),t._UZ(12,"input",9),t.YNc(13,Be,2,0,"mat-error",10),t.YNc(14,Ye,2,0,"mat-error",10),t.YNc(15,Re,2,0,"mat-error",10),t.qZA()(),t.TgZ(16,"div",11)(17,"mat-form-field",12)(18,"mat-label"),t._uU(19,"Test Date *"),t.qZA(),t._UZ(20,"input",13)(21,"mat-datepicker-toggle",14)(22,"mat-datepicker",null,15),t.YNc(24,Se,2,0,"mat-error",10),t.qZA()(),t.TgZ(25,"div",7)(26,"mat-form-field",8)(27,"mat-label"),t._uU(28,"Episode ID"),t.qZA(),t._UZ(29,"input",16),t.YNc(30,Qe,2,0,"mat-error",10),t.YNc(31,Je,2,0,"mat-error",10),t.YNc(32,Me,2,0,"mat-error",10),t.YNc(33,Pe,2,0,"mat-error",10),t.qZA()(),t.YNc(34,Oe,6,1,"div",17),t.YNc(35,je,5,0,"div",17),t.TgZ(36,"div",7)(37,"mat-form-field",8)(38,"mat-label"),t._uU(39,"District Name Address "),t.qZA(),t.TgZ(40,"mat-select",18),t.NdJ("selectionChange",function(n){return i.onDistrictChange(n.value)}),t.YNc(41,Ee,2,2,"mat-option",19),t.qZA(),t.YNc(42,Ve,2,0,"mat-error",10),t.qZA()(),t.TgZ(43,"div",7)(44,"mat-form-field",8)(45,"mat-label"),t._uU(46,"Health Block Address "),t.qZA(),t.TgZ(47,"mat-select",20),t.NdJ("selectionChange",function(n){return i.onBlockChange(n.value)}),t.YNc(48,Ge,2,2,"mat-option",19),t.qZA()()(),t.YNc(49,He,7,2,"div",17),t.YNc(50,Xe,5,0,"div",17),t.YNc(51,ea,7,2,"div",17),t.TgZ(52,"div",11)(53,"label",21),t._uU(54,"Reason For Test *"),t.qZA(),t.TgZ(55,"div",22)(56,"mat-radio-group",23),t.NdJ("change",function(){return i.onReasonForTestChange()}),t.TgZ(57,"mat-radio-button",24),t._uU(58,"Presumptive Case"),t.qZA(),t.TgZ(59,"mat-radio-button",25),t._uU(60,"UDST"),t.qZA()()(),t.YNc(61,aa,2,0,"mat-error",10),t.qZA(),t.YNc(62,oa,10,1,"div",26),t.TgZ(63,"div",27)(64,"label",21),t._uU(65,"Locality *"),t.qZA(),t.TgZ(66,"div",28)(67,"mat-radio-group",29),t.NdJ("change",function(){return i.onLocalityChange()}),t.TgZ(68,"mat-radio-button",30),t._uU(69,"Rural (Gram Panchayat)"),t.qZA(),t.TgZ(70,"mat-radio-button",31),t._uU(71,"Urban (Municipal Bodies)"),t.qZA()()(),t.YNc(72,ra,2,0,"mat-error",10),t.qZA()()(),t.TgZ(73,"div",32)(74,"button",33),t._uU(75," Save Data "),t.qZA()()()()(),t.TgZ(76,"div",34)(77,"h3",35),t._uU(78," Show the data based on filled form Data"),t.qZA(),t.TgZ(79,"div",36)(80,"table",37),t.ynx(81,38),t.YNc(82,na,2,0,"th",39),t.YNc(83,la,2,1,"td",40),t.BQk(),t.ynx(84,41),t.YNc(85,sa,2,0,"th",39),t.YNc(86,ma,2,1,"td",40),t.BQk(),t.ynx(87,42),t.YNc(88,ca,2,0,"th",39),t.YNc(89,da,2,1,"td",40),t.BQk(),t.ynx(90,43),t.YNc(91,ua,2,0,"th",39),t.YNc(92,pa,2,1,"td",40),t.BQk(),t.ynx(93,44),t.YNc(94,ha,2,0,"th",39),t.YNc(95,_a,2,1,"td",40),t.BQk(),t.ynx(96,45),t.YNc(97,fa,2,0,"th",39),t.YNc(98,ba,2,1,"td",40),t.BQk(),t.ynx(99,46),t.YNc(100,ga,2,0,"th",39),t.YNc(101,va,2,1,"td",40),t.BQk(),t.ynx(102,47),t.YNc(103,Ta,2,0,"th",39),t.YNc(104,Ca,2,1,"td",40),t.BQk(),t.ynx(105,48),t.YNc(106,Da,2,0,"th",39),t.YNc(107,Za,2,1,"td",40),t.BQk(),t.ynx(108,49),t.YNc(109,Aa,2,0,"th",39),t.YNc(110,Na,2,1,"td",40),t.BQk(),t.ynx(111,50),t.YNc(112,ya,2,0,"th",39),t.YNc(113,Ua,2,1,"td",40),t.BQk(),t.ynx(114,51),t.YNc(115,La,2,0,"th",39),t.YNc(116,xa,2,1,"td",40),t.BQk(),t.ynx(117,52),t.YNc(118,Fa,2,0,"th",39),t.YNc(119,ka,2,1,"td",40),t.BQk(),t.ynx(120,53),t.YNc(121,Ia,2,0,"th",39),t.YNc(122,qa,2,1,"td",40),t.BQk(),t.ynx(123,54),t.YNc(124,wa,2,0,"th",39),t.YNc(125,Ba,2,1,"td",40),t.BQk(),t.YNc(126,Ya,1,0,"tr",55),t.YNc(127,Ra,1,0,"tr",56),t.qZA()(),t._UZ(128,"mat-paginator",57),t.qZA()),2&e){const r=t.MAs(23);let n,s,c,m,d,p,f,b,_,C,T,D;t.xp6(5),t.Q6J("formGroup",i.cbnaatForm),t.xp6(8),t.Q6J("ngIf",null==(n=i.cbnaatForm.get("pageNumber"))?null:n.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(s=i.cbnaatForm.get("pageNumber"))?null:s.hasError("maxlength")),t.xp6(1),t.Q6J("ngIf",null==(c=i.cbnaatForm.get("pageNumber"))?null:c.hasError("pattern")),t.xp6(5),t.Q6J("matDatepicker",r),t.xp6(1),t.Q6J("for",r),t.xp6(3),t.Q6J("ngIf",null==(m
1=i.cbnaatForm.get("testDate"))?null:m.hasError("required")),t.xp6(6),t.Q6J("ngIf",null==(d=i.cbnaatForm.get("episodeID"))?null:d.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(p=i.cbnaatForm.get("episodeID"))?null:p.hasError("minlength")),t.xp6(1),t.Q6J("ngIf",null==(f=i.cbnaatForm.get("episodeID"))?null:f.hasError("maxlength")),t.xp6(1),t.Q6J("ngIf",null==(b=i.cbnaatForm.get("episodeID"))?null:b.hasError("pattern")),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isUrbanSelected()),t.xp6(6),t.Q6J("ngForOf",i.districtList),t.xp6(1),t.Q6J("ngIf",null==(_=i.cbnaatForm.get("districtNameAddress"))?null:_.hasError("required")),t.xp6(6),t.Q6J("ngForOf",i.blockList),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isUrbanSelected()),t.xp6(10),t.Q6J("ngIf",null==(C=i.cbnaatForm.get("reasonForTest"))?null:C.hasError("required")),t.xp6(1),t.Q6J("ngIf","presumptiveCase"===(null==(T=i.cbnaatForm.get("reasonForTest"))?null:T.value)),t.xp6(10),t.Q6J("ngIf",null==(D=i.cbnaatForm.get("locality"))?null:D.hasError("required")),t.xp6(2),t.Q6J("disabled",!i.cbnaatForm.valid),t.xp6(6),t.Q6J("dataSource",i.dataSource),t.xp6(46),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",10)("pageSizeOptions",t.DdM(28,Sa))}},dependencies:[Z.sg,Z.O5,x.ey,L.lW,g.Mq,g.hl,g.nW,v.TO,v.KE,v.hX,v.R9,y.Nt,F.NW,w.VQ,w.U0,N.gD,u.BZ,u.fO,u.as,u.w1,u.Dz,u.nj,u.ge,u.ev,u.XQ,u.Gk,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.nD,l.sg,l.u],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}.d-flex[_ngcontent-%COMP%]{gap:5px}table[_ngcontent-%COMP%]{width:100%} .mat-radio-group{display:flex;align-items:center} .mat-radio-button{margin-right:16px}"]}),a})();function Ja(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.districtName," ")}}function Ma(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1,"District is required!!!"),t.qZA())}function Pa(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.blockName," ")}}function $a(a,o){if(1&a&&(t.TgZ(0,"mat-option",33),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e)}}function Oa(a,o){1&a&&t._UZ(0,"mat-error")}function ja(a,o){if(1&a){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",6)(2,"h1",7),t._uU(3,"Lab Report"),t.qZA(),t.TgZ(4,"p",8),t._uU(5,"Download the raw data report"),t.qZA(),t.TgZ(6,"form",9)(7,"div",10)(8,"div",11)(9,"mat-form-field",12)(10,"mat-label"),t._uU(11,"District"),t.qZA(),t.TgZ(12,"mat-select",13),t.NdJ("selectionChange",function(r){t.CHM(e);const n=t.oxw();return t.KtG(n.getBlocks(r,""))}),t.YNc(13,Ja,2,2,"mat-option",14),t.ALo(14,"async"),t.qZA(),t.YNc(15,Ma,2,0,"mat-error",15),t.qZA()(),t.TgZ(16,"div",11)(17,"mat-form-field",12)(18,"mat-label"),t._uU(19,"Block"),t.qZA(),t.TgZ(20,"mat-select",16),t.YNc(21,Pa,2,2,"mat-option",14),t.ALo(22,"async"),t.qZA()()(),t.TgZ(23,"div",11)(24,"mat-form-field",12)(25,"mat-label"),t._uU(26,"Select Report Type"),t.qZA(),t.TgZ(27,"mat-select",17)(28,"mat-option",18),t._uU(29,"Web Report"),t.qZA(),t.TgZ(30,"mat-option",19),t._uU(31,"Registered Report"),t.qZA()()()(),t.TgZ(32,"div",11)(33,"mat-form-field",12)(34,"mat-label"),t._uU(35,"Select Date"),t.qZA(),t._UZ(36,"input",20)(37,"mat-datepicker-toggle",21)(38,"mat-datepicker",null,22),t.qZA()(),t.TgZ(40,"div",11)(41,"mat-form-field",12)(42,"mat-label"),t._uU(43,"Select Lab Type"),t.qZA(),t.TgZ(44,"mat-select",23),t.YNc(45,$a,2,2,"mat-option",14),t.qZA()()(),t.TgZ(46,"div",11)(47,"mat-form-field",12)(48,"mat-label"),t._uU(49,"Select Date range"),t.qZA(),t.TgZ(50,"div",24)(51,"div",25)(52,"mat-date-range-input",26),t._UZ(53,"input",27)(54,"input",28),t.qZA(),t._UZ(55,"mat-datepicker-toggle",29),t.qZA(),t._UZ(56,"mat-date-range-picker",null,30),t.qZA(),t.YNc(58,Oa,1,0,"mat-error",15),t.qZA()()(),t.TgZ(59,"div",31)(60,"button",32),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.generateReport())}),t._uU(61,"Download Report"),t.qZA()()()()()}
1if(2&a){const e=t.MAs(39),i=t.MAs(57),r=t.oxw();t.xp6(6),t.Q6J("formGroup",r.form),t.xp6(7),t.Q6J("ngForOf",t.lcZ(14,12,r.districts$)),t.xp6(2),t.Q6J("ngIf",r.form.controls.districtId.invalid),t.xp6(6),t.Q6J("ngForOf",t.lcZ(22,14,r.blocks$)),t.xp6(15),t.Q6J("matDatepicker",e),t.xp6(1),t.Q6J("for",e),t.xp6(8),t.Q6J("ngForOf",r.labTypeList),t.xp6(7),t.Q6J("rangePicker",i),t.xp6(3),t.Q6J("for",i),t.xp6(3),t.Q6J("ngIf",r.form.controls.startDate.invalid),t.xp6(2),t.Q6J("disableRipple",!1)("disabled",r.form.invalid)}}function Ea(a,o){if(1&a&&(t.TgZ(0,"th"),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.header," ")}}function Va(a,o){if(1&a&&(t.TgZ(0,"tr"),t.YNc(1,Ea,2,1,"th",34),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.Q6J("ngForOf",e)}}function Ga(a,o){if(1&a&&t._UZ(0,"p-treeTableToggler",37),2&a){const e=t.oxw(2).$implicit;t.Q6J("rowNode",e)}}function za(a,o){if(1&a&&(t.TgZ(0,"td"),t.YNc(1,Ga,1,1,"p-treeTableToggler",36),t._uU(2),t.qZA()),2&a){const e=o.$implicit,i=o.index,r=t.oxw().rowData;t.xp6(1),t.Q6J("ngIf",0===i),t.xp6(1),t.hij(" ",r[e.field]," ")}}function Wa(a,o){if(1&a&&(t.TgZ(0,"tr",35),t.YNc(1,za,3,2,"td",34),t.qZA()),2&a){const i=o.columns;t.Q6J("ttRow",o.$implicit),t.xp6(1),t.Q6J("ngForOf",i)}}const Ha=function(){return{"min-width":"50rem"}};let Xa=(()=>{class a{constructor(e,i,r,n,s,c,m,d,p){this.fb=e,this.labReportingService=i,this.fileLibraryServices=r,this._auth=n,this.districtService=s,this.blockService=c,this.PhiService=m,this.labReportingManualService=d,this.nodeService=p,this.subscription=new M.w0,this.disableBlock=!1,this.disableDistrict=!1,this.CoughsyrupsurveillanceReport=!1,this.LabReport=!0,this.labTypeList=[],this.designationList=[],this.showDistrictTable=!0,this.showBlockTable=!0,this.showLabTable=!0,this.outOfTree=!1,this.columns=[{field:"name",header:"Name"},{field:"size",header:"Size"},{field:"type",header:"Type"}],this.currentUser=this._auth.currentUserValue}ngOnInit(){var e,i,r,n,s,c,m,d,p,f;this.nodeService.getFilesystem().then(_=>{console.log(_),this.files=_}),!(null===(e=this.currentUser)||void 0===e)&&e.stateId&&(this.districts$=this.districtService.getDistricts({stateId:null===(i=this.currentUser)||void 0===i?void 0:i.stateId})),this.labTypeList="DMC"===this.currentUser.labType||"CBNAAT"===this.currentUser.labType||"TrueNAAT"===this.currentUser.labType?[this.currentUser.labType]:["All","DMC","CBNAAT","TrueNAAT"],this.blocks$=this.blockService.getBlocks({}),this.phis$=this.PhiService.getBlockPHIs({}),((null===(r=this.currentUser)||void 0===r?void 0:r.districtId)||(null===(n=this.currentUser)||void 0===n?void 0:n.blockId)||(null===(s=this.currentUser)||void 0===s?void 0:s.phiId))&&(this.getBlocks(null,null===(c=this.currentUser)||void 0===c?void 0:c.districtId),this.getPhis(null,null===(m=this.currentUser)||void 0===m?void 0:m.districtId,null===(d=this.currentUser)||void 0===d?void 0:d.blockId),this.disableDistrict=!(null===(p=this.currentUser)||void 0===p||!p.districtId),this.disableBlock=!(null===(f=this.currentUser)||void 0===f||!f.blockId)),this.form=this.createForm(),this.formCough=this.createCoughForm(),A()().month()+1>3?(this.fromDate=A()().month(3).startOf("month").format("YYYY-MM-DD"),this.toDate=A()().format("YYYY-MM-DD")):(this.fromDate=A()().month(3).startOf("month").subtract(1,"years").format("YYYY-MM-DD"),this.toDate=A()().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)):"Lab"===this.currentUser.designation&&(this.showLabTable=!1,this.getLabTable(this.currentUser))}onClickedOutside(e){console.log("Clicked outside:",e),this.outOfTree=!0}createForm(){var e,i,r;return this.fb.group({districtId:[{value:null!==(e=this.currentUser)&&void 0!==e&&e.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict},[l.kI.required]],blockId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.blockId?null===(r=this.currentUser)||void 0===r?void 0:r.blockId:"",disabled:this.disableBlock}],reportType:[""],labType:[""],date:[""],startDate:[""],endDate:[""]})}createCoughForm(){var e,i,r;return this.fb.group({districtId:[{value:null!==(e=this.currentUser)&&void 0!==e&&e.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict},[l.kI.required]],blockId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.blockId?null===(r=this.currentUser)||void 0===r?void 0:r.blockId:"",disabled:this.disableBlock}],startDate:[""],endDate:[""]})}getBlocks(e,i){var r,n;i=null!==(n=null===(r=null==this?void 0:this.form)||void 0===r?void 0:r.value)&&void 0!==n&&n.hasOwnProperty("districtId")?this.form.value.districtId:this.currentUser.districtId,this.blocks$=this.blockService.getBlocks({districtId:i})}getPhis(e,i,r){}onChange(e){"LabReport"===e?(this.LabReport=!0,this.CoughsyrupsurveillanceReport=!1):"CoughsyrupsurveillanceReport"===e?(this.CoughsyrupsurveillanceReport=!0,this.LabReport=!1):(this.LabReport=!1,this.CoughsyrupsurveillanceReport=!1)}generateReport(){const e={designation:this.currentUser.designation,labType:this.form.value.labType,date:this.form.value.date,fromDate:this.form.value.startDate,toDate:this.form.value.endDate,districtId:this.currentUser.districtId?this.currentUser.districtId:this.form.value.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:this.form.value.blockId};"register"==this.form.value.reportType?this.labReportingManualService.getManualLabReport(e).subscribe(i=>{I().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(r=>{r.value&&this.fileLibraryServices.downloadFileWithContainer(i).subscribe(n=>{const s=new Blob([n],{type:n.type}),c=window.URL.createObjectURL(s),m=document.createElement("a");m.href=c,m.download=i,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(c)})})}):this.labReportingService.getlabReport(e).subscribe(i=>{I().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(r=>{r.value&&this.fileLibraryServices.downloadFileWithContainer(i).subscribe(n=>{const s=new Blob([n],{type:n.type}),c=window.URL.createObjectURL(s),m=document.createElement("a");m.href=c,m.download=i,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(c)})})})}getStateTable(){this.stateTitle=`State level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,designation:this.currentUser.designation,stateId:this.currentUser.stateId}).subscribe(i=>{console.log("responsestate=====>",i),this.phichoahc=new u.by(i)})}getDistrictTable(e){this.districtTitle=`District level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showDistrictTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,labType:this.labTypeList,toDate:this.toDate,stateId:this.currentUser.stateId?this.currentUser.stateId:e.stateId,districtId:this.currentUser.districtId?this.currentUser.districtId:e.districtId,designation:"District"}).subscribe(r=>{console.log("responsedistrict=====>",r),this.phichoahcDistrict=new u.by(r)})}getBlockTable(e){this.blockTitle=`Block level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showBlockTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,stateId:this.currentUser.stateId?this.currentUser.stateId:e.stateId,districtId:e._id?e._id:e.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:e.blockId,designation:"Block"}).subscribe(r=>{this.phichoahcBlock=new u.by(r)})}getLabTable(e){this.labTitle=`Lab level cummulative data of Lab reporting from ${this.fromDate} to ${this.toDate}`,this.showLabTable=!1,this.labReportingService.getlabReportCount({fromDate:this.fromDate,toDate:this.toDate,labType:this.labTypeList,stateId:this.currentUser.stateId,districtId:this.currentUser.districtId,blockId:e._id,designation:"Lab"}).subscribe(r=>{this.phichoahcLab=new u.by(r)})}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(l.qu),t.Y36(P),t.Y36($.n),t.Y36(O.e8),t.Y36(j.R),t.Y36(E.g),t.Y36(V.B),t.Y36(q),t.Y36(G.D))}
1,a.\u0275cmp=t.Xpm({type:a,selectors:[["app-lab-truenaat-report"]],decls:5,vars:6,consts:[["class","card w-full",4,"ngIf"],[1,"card"],[3,"value","columns","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],[1,"card","w-full"],[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"],["placeholder","Select Report Type","formControlName","reportType"],["value","Web"],["value","register"],["matInput","","formControlName","date","placeholder","date",3,"matDatepicker"],["matSuffix","",3,"for"],["picker1",""],["placeholder","Select Designation","formControlName","labType"],[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",""],[1,"d-flex","justify-content-center"],["mat-raised-button","","color","primary",3,"disableRipple","disabled","click"],[3,"value"],[4,"ngFor","ngForOf"],[3,"ttRow"],[3,"rowNode",4,"ngIf"],[3,"rowNode"]],template:function(e,i){1&e&&(t.YNc(0,ja,62,16,"div",0),t.TgZ(1,"div",1)(2,"p-treeTable",2),t.YNc(3,Va,2,1,"ng-template",3),t.YNc(4,Wa,2,2,"ng-template",4),t.qZA()()),2&e&&(t.Q6J("ngIf",i.LabReport),t.xp6(2),t.Q6J("value",i.files)("columns",i.columns)("scrollable",!0)("tableStyle",t.DdM(5,Ha)))},dependencies:[Z.sg,Z.O5,x.ey,L.lW,g.Mq,g.hl,g.nW,g.wx,g.zY,g.By,g._g,v.TO,v.KE,v.hX,v.R9,y.Nt,N.gD,l._Y,l.Fj,l.JJ,l.JL,l.sg,l.u,U.iw,Q.jx,U.gc,U.V4,Z.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}.d-flex[_ngcontent-%COMP%]{gap:5px}.mat-raised-button[_ngcontent-%COMP%]{background-color:#0096ff;color:#fff;margin-top:10px}table[_ngcontent-%COMP%]{width:100%}"]}),a})();function Ka(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Page number is required. "),t.qZA())}function ti(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Page number cannot exceed 4 digits. "),t.qZA())}function ei(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Only numeric values are allowed. "),t.qZA())}function ai(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Date is required "),t.qZA())}function ii(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID is required. "),t.qZA())}function oi(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID must be at least 2 digits. "),t.qZA())}function ri(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Episode ID cannot exceed 8 digits. "),t.qZA())}function ni(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Only numeric values are allowed. "),t.qZA())}function li(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function si(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Village Name "),t.qZA(),t._UZ(4,"input",58),t.YNc(5,li,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngIf",null==(i=e.dmcForm.get("villageName"))?null:i.hasError("required"))}}function mi(a,o){1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",59)(2,"mat-label"),t._uU(3,"Ward Name *"),t.qZA(),t._UZ(4,"input",60),t.qZA()())}function ci(a,o){if(1&a&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.districtName," ")}}function di(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option "),t.qZA())}function ui(a,o){if(1&a&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.blockName," ")}}function pi(a,o){if(1&a&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.gpName," ")}}function hi(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select a Gram Panchayat "),t.qZA())}function _i(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Gram Panchayat Name "),t.qZA(),t.TgZ(4,"mat-select",62),t.YNc(5,pi,2,2,"mat-option",17),t.qZA(),t.YNc(6,hi,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngForOf",e.gramPanchayatList),t.xp6(1),t.Q6J("ngIf",null==(i=e.dmcForm.get("gramPanchayatName"))?null:i.hasError("required"))}}function fi(a,o){1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Development Block Name "),t.qZA(),t._UZ(4,"input",63),t.qZA()())}function bi(a,o){if(1&a&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.name_of_municipal_body," ")}}function gi(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select a Municipal Body "),t.qZA())}function vi(a,o){if(1&a&&(t.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),t._uU(3,"Municipal Body Name *"),t.qZA(),t.TgZ(4,"mat-select",64),t.YNc(5,bi,2,2,"mat-option",17),t.qZA(),t.YNc(6,gi,2,0,"mat-error",10),t.qZA()()),2&a){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngForOf",e.municipalList),t.xp6(1),t.Q6J("ngIf",null==(i=e.dmcForm.get("name_of_municipal_body"))?null:i.hasError("required"))}}function Ti(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option "),t.qZA())}function Ci(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select an option "),t.qZA())}function Di(a,o){if(1&a&&(t.TgZ(0,"div",65)(1,"label",20),t._uU(2,"Whether Smear Positive TB Diagnosed? *"),t.qZA(),t.TgZ(3,"div",21)(4,"mat-radio-group",66)(5,"mat-radio-button",67),t._uU(6,"Yes"),t.qZA(),t.TgZ(7,"mat-radio-button",68),t._uU(8,"No"),t.qZA()()(),t.YNc(9,Ci,2,0,"mat-error",10),t.qZA()),2&a){const e=t.oxw();let i;t.xp6(9),t.Q6J("ngIf",null==(i=e.dmcForm.get("tbPositive"))?null:i.hasError("required"))}}function Zi(a,o){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Please select Rural or Urban "),t.qZA())}function Ai(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Page No. "),t.qZA())}function Ni(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.pageNumber," ")}}function yi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Test Date "),t.qZA())}function Ui(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.testDate," ")}}function Li(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Episode ID "),t.qZA())}function xi(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.episodeID," ")}}function Fi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Submission Date "),t.qZA())}function ki(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.submissionDate," ")}}function Ii(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," District Name "),t.qZA())}function qi(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.districtNameAddress," ")}}function wi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Health Block "),t.qZA())}function Bi(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.healthBlockAddress," ")}}function Yi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Year "),t.qZA())}function Ri(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.year," ")}}function Si(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Municipal Body "),t.qZA())}function Qi(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.municipalBodyName," ")}}function Ji(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Gram Panchayat "),t.qZA())}function Mi(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.gramPanchayatName," ")}}function Pi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Locality "),t.qZA())}function $i(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.locality," ")}}function Oi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1,"Development BlockName "),t.qZA())}function ji(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.developmentBlockName," ")}}function Ei(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," TB Positive "),t.qZA())}function Vi(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.tbPositive," ")}}function Gi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Reason For Test "),t.qZA())}function zi(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.reasonForTest," ")}}function Wi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Village Name "),t.qZA())}function Hi(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.villageName," ")}}function Xi(a,o){1&a&&(t.TgZ(0,"th",69),t._uU(1," Ward Name "),t.qZA())}function Ki(a,o){if(1&a&&(t.TgZ(0,"td",70),t._uU(1),t.qZA()),2&a){const e=o.$implicit;t.xp6(1),t.hij(" ",e.wardName," ")}}function to(a,o){1&a&&t._UZ(0,"tr",71)}function eo(a,o){1&a&&t._UZ(0,"tr",72)}const ao=function(){return[5,10,20]};let io=(()=>{class a{constructor(e,i,r,n){this.fb=e,this.labReportingService=i,this.authService=r,this.formService=n,this.currentMonth="",this.districtList=[],this.blockList=[],this.blockMap=new Map,this.gramPanchayatList=[],this.developmentBlockList=[],this.municipalList=[],this.districtMap=new Map,this.displayedColumns=["pageNumber","testDate","episodeID","submissionDate","districtNameAddress","healthBlockAddress","year","municipalBodyName","gramPanchayatName","locality","tbPositive","reasonForTest","villageName","wardName","locality","developmentBlockName","reasonForTest"],this.dataSource=new u.by([]),this.currentUser=this.authService.currentUserValue,this.initializeForm(),this.loadDistricts()}isRuralSelected(){var e;return"rural"===(null===(e=this.dmcForm.get("locality"))||void 0===e?void 0:e.value)}isUrbanSelected(){var e;return"urban"===(null===(e=this.dmcForm.get("locality"))||void 0===e?void 0:e.value)}ngOnInit(){var e;null===(e=this.dmcForm.get("locality"))||void 0===e||e.valueChanges.subscribe(()=>{this.onLocalityChange()}),this.setCurrentMonth(),this.onReasonForTestChange(),this.getAllTableData(),this.loadBlocksforApiresponse(),this.getFormId()}ngAfterViewInit(){this.dataSource.paginator=this.paginator}initializeForm(){this.dmcForm=this.fb.group({pageNumber:["",[l.kI.required,l.kI.maxLength(4),l.kI.pattern(/^\d+$/)]],villageName:[""],testDate:[new Date,l.kI.required],wardName:[""],episodeID:["",[l.kI.required,l.kI.minLength(2),l.kI.maxLength(8),l.kI.pattern(/^\d+$/)]],locality:["",l.kI.required],gramPanchayatName:["",l.kI.required],developmentBlockName:["",l.kI.required],reasonForTest:[""],districtNameAddress:["",l.kI.required],healthBlockAddress:["",l.kI.required],municipalBodyName:[""],tbPositive:[{value:null,disabled:!0}],submissionDate:[{value:null,disabled:!1}]})}getFormId(){this.formService.getForms({formName:"DMC daily testing Form"}).subscribe(i=>{this.formId=i[0].id})}onSubmit(){var e,i,r,n,s;
1if(this.dmcForm.invalid)return void console.log("Form is invalid",this.dmcForm.errors);const c=this.dmcForm.value,m=Date.now(),d=this.gramPanchayatList.find(_=>_.id===c.gramPanchayatName),p=this.municipalList.find(_=>_.id===c.municipalBodyName),f=p?p.name_of_municipal_body:"Bilaspur MC",b=Object.assign(Object.assign({},c),{formId:this.formId,testDate:new Date(c.testDate).getTime(),submissionDate:m,year:new Date(c.testDate).getFullYear(),stateId:(null===(e=this.currentUser)||void 0===e?void 0:e.stateId)||"",districtId:(null===(i=this.currentUser)||void 0===i?void 0:i.districtId)||"",blockId:(null===(r=this.currentUser)||void 0===r?void 0:r.blockId)||"",createdBy:(null===(n=this.currentUser)||void 0===n?void 0:n.id)||"",labType:(null===(s=this.currentUser)||void 0===s?void 0:s.labType)||"",gramPanchayatName:(null==d?void 0:d.gpName)||"",municipalBodyName:f,updatedAt:Date.now()});this.labReportingService.AddManualLabReportData(b).subscribe(_=>console.log("Data inserted successfully",_),_=>console.error("Error inserting data",_)),this.getAllTableData(),this.dmcForm.reset()}setCurrentMonth(){const e=new Date;this.currentMonth=e.toLocaleString("default",{month:"long"})}loadDistricts(){this.labReportingService.getDistricts().subscribe(e=>{this.districtList=e,this.districtMap=new Map(e.map(i=>[i.id,i.districtName]))},e=>console.error("Error fetching districts",e))}onDistrictChange(e){this.loadBlocks(e)}onBlockChange(e){this.loadGramPanchayats(e),this.loadDevelopmentBlocks(e),this.loadMunicipalBodies(e)}loadBlocks(e){if(!e)return this.blockList=[];this.labReportingService.getBlocks(e).subscribe(i=>this.blockList=i,i=>console.error("Error fetching blocks",i))}loadBlocksforApiresponse(){this.labReportingService.getAllBlocks().subscribe(e=>{this.blockList=e,this.blockMap=new Map(e.map(i=>[i.id,i.blockName]))},e=>console.error("Error loading blocks",e))}loadGramPanchayats(e){if(!e)return this.gramPanchayatList=[];this.labReportingService.getGramPanchayat(e).subscribe(i=>this.gramPanchayatList=i,i=>console.error("Error fetching Gram Panchayats",i))}loadDevelopmentBlocks(e){if(!e)return this.developmentBlockList=[];this.labReportingService.getDevlopmentBlockName(e).subscribe(i=>{var r;this.developmentBlockList=i;const n=(null===(r=null==i?void 0:i[0])||void 0===r?void 0:r.gpDevlopmentBlockName)||"";this.dmcForm.patchValue({developmentBlockName:n})},i=>console.error("Error fetching Development Block Name",i))}loadMunicipalBodies(e){if(!e)return this.municipalList=[];this.labReportingService.getmunicipalBodiesName(e).subscribe(i=>this.municipalList=i,i=>console.error("Error fetching Municipal Bodies",i))}onLocalityChange(){var e,i,r,n,s,c,m,d,p,f,b,_,C,T,D;this.isRuralSelected()?(null===(e=this.dmcForm.get("villageName"))||void 0===e||e.setValidators(l.kI.required),null===(i=this.dmcForm.get("gramPanchayatName"))||void 0===i||i.setValidators(l.kI.required),null===(r=this.dmcForm.get("developmentBlockName"))||void 0===r||r.setValidators(l.kI.required),null===(n=this.dmcForm.get("wardName"))||void 0===n||n.clearValidators(),null===(s=this.dmcForm.get("name_of_municipal_body"))||void 0===s||s.clearValidators()):this.isUrbanSelected()&&(null===(c=this.dmcForm.get("wardName"))||void 0===c||c.setValidators(l.kI.required),null===(m=this.dmcForm.get("name_of_municipal_body"))||void 0===m||m.setValidators(l.kI.required),null===(d=this.dmcForm.get("villageName"))||void 0===d||d.clearValidators(),null===(p=this.dmcForm.get("gramPanchayatName"))||void 0===p||p.clearValidators(),null===(f=this.dmcForm.get("developmentBlockName"))||void 0===f||f.clearValidators()),null===(b=this.dmcForm.get("villageName"))||void 0===b||b.updateValueAndValidity(),null===(_=this.dmcForm.get("gramPanchayatName"))||void 0===_||_.updateValueAndValidity(),null===(C=this.dmcForm.get("developmentBlockName"))||void 0===C||C.updateValueAndValidity(),null===(T=this.dmcForm.get("wardName"))||void 0===T||T.updateValueAndValidity(),null===(D=this.dmcForm.get("name_of_municipal_body"))||void 0===D||D.updateValueAndValidity()}onReasonForTestChange(){var e;const i=null===(e=this.dmcForm.get("reasonForTest"))||void 0===e?void 0:e.value,r={tbPositive:this.dmcForm.get("tbPositive")};Object.entries(r).forEach(([n,s])=>{"presumptiveCase"===i||"tbPositive"===n&&"ptfuTest"===i?(null==s||s.setValidators(l.kI.required),null==s||s.enable()):(null==s||s.clearValidators(),null==s||s.setValue(null),null==s||s.disable()),null==s||s.updateV
1alueAndValidity()})}getFinancialYearDates(){const e=new Date,i=e.getFullYear();let n,s;return e.getMonth()>=3?(n=new Date(i,3,1),s=new Date(i+1,2,31,23,59,59)):(n=new Date(i-1,3,1),s=new Date(i,2,31,23,59,59)),{fromDate:n.getTime(),toDate:s.getTime()}}getAllTableData(){const{fromDate:e,toDate:i}=this.getFinancialYearDates();this.labReportingService.getAllDataForDMC({where:{createdBy:this.currentUser.id,submissionDate:{between:[e,i]},labType:"DMC"}}).subscribe(n=>{this.districtMap?(n=n.map(s=>Object.assign(Object.assign({},s),{testDate:this.formatDate(s.testDate),submissionDate:this.formatDate(s.submissionDate),districtNameAddress:this.districtMap.get(s.districtNameAddress)||"Unknown",healthBlockAddress:this.blockMap.get(s.healthBlockAddress)||"Unknown"})),this.dataSource.data=n):console.error("District map is not initialized yet!")},n=>console.error("Error fetching data",n))}formatDate(e){return e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"}):"-"}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(l.qu),t.Y36(q),t.Y36(z.e),t.Y36(W.o))},a.\u0275cmp=t.Xpm({type:a,selectors:[["app-labcbnnat-form"]],viewQuery:function(e,i){if(1&e&&t.Gf(F.NW,5),2&e){let r;t.iGM(r=t.CRH())&&(i.paginator=r.first)}},decls:131,vars:29,consts:[[1,"card","w-full",2,"margin-top","-2rem !important"],[1,"card-title","my-3","mx-3","p-2"],[1,"card-title"],[1,"form-container","p-2"],[1,"w-full",3,"formGroup","ngSubmit"],[1,"flex","justify-evenly","gap-1"],[1,"row"],[1,"col-lg-3","readonly-wrapper"],["appearance","outline",2,"width","100%"],["matInput","","type","text","formControlName","pageNumber","maxlength","4"],[4,"ngIf"],["matInput","","formControlName","testDate",3,"matDatepicker"],["matSuffix","",3,"for"],["picker",""],["matInput","","formControlName","episodeID","type","text","maxlength","8"],["class","col-lg-3 readonly-wrapper",4,"ngIf"],["formControlName","districtNameAddress",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],["formControlName","healthBlockAddress",3,"selectionChange"],[1,"col-lg-3","readonly-wrapper","w-full"],[1,"block","font-medium","text-gray-700","mb-2"],[1,"flex","flex-wrap","items-center","gap-2","w-full"],["formControlName","reasonForTest",1,"flex","flex-wrap","items-center","gap-2","w-full",3,"change"],["value","presumptiveCase",1,"flex","items-center"],["value","ipcpfu",1,"flex","items-center"],["value","ptfuTest",1,"flex","items-center"],["class","col-lg-2 readonly-wrapper w-full",4,"ngIf"],[1,"col-lg-2","readonly-wrapper"],[1,"flex","items-center","gap-4"],["formControlName","locality",1,"flex","items-center","space-x-4",3,"change"],["value","rural"],["value","urban"],[1,"button-container","mt-4"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[1,"card","w-full","p-2"],[1,"card-title","p-2"],[1,"table-responsive"],["mat-table","",1,"mat-elevation-z8","table","table-bordered",3,"dataSource"],["matColumnDef","pageNumber"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","testDate"],["matColumnDef","episodeID"],["matColumnDef","submissionDate"],["matColumnDef","districtNameAddress"],["matColumnDef","healthBlockAddress"],["matColumnDef","year"],["matColumnDef","municipalBodyName"],["matColumnDef","gramPanchayatName"],["matColumnDef","locality"],["matColumnDef","developmentBlockName"],["matColumnDef","tbPositive"],["matColumnDef","reasonForTest"],["matColumnDef","villageName"],["matColumnDef","wardName"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSize","pageSizeOptions"],["matInput","","type","text","formControlName","villageName","required",""],["appearance","outline"],["matInput","","type","text","formControlName","wardName","required",""],[3,"value"],["formControlName","gramPanchayatName"],["matInput","","type","text","formControlName","developmentBlockName"],["formControlName","name_of_municipal_body"],[1,"col-lg-2","readonly-wrapper","w-full"],["formControlName","tbPositive",1,"flex","flex-wrap","items-center","gap-2","w-full"],["value","yes",1,"flex","items-center"],["value","no",1,"flex","items-center"],["mat-header-cell",""],["mat-cell",""],["mat-header-row",""],["mat-row",""]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h3",2),t._uU(3,"DMC Daily Form"),t.qZA()(),t.TgZ(4,"div",3)(5,"form",4),t.NdJ("ngSubmit",function(){return i.onSubmit()}),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7)(9,"mat-form-field",8)(10,"mat-label"),t._uU(11,"Page No. of Register"),t.qZA(),t._UZ(12,"input",9),t.YNc(13,Ka,2,0,"mat-error",10),t.YNc(14,t
1i,2,0,"mat-error",10),t.YNc(15,ei,2,0,"mat-error",10),t.qZA()(),t.TgZ(16,"div",7)(17,"mat-form-field",8)(18,"mat-label"),t._uU(19,"Test Date *"),t.qZA(),t._UZ(20,"input",11)(21,"mat-datepicker-toggle",12)(22,"mat-datepicker",null,13),t.YNc(24,ai,2,0,"mat-error",10),t.qZA()(),t.TgZ(25,"div",7)(26,"mat-form-field",8)(27,"mat-label"),t._uU(28,"Episode ID"),t.qZA(),t._UZ(29,"input",14),t.YNc(30,ii,2,0,"mat-error",10),t.YNc(31,oi,2,0,"mat-error",10),t.YNc(32,ri,2,0,"mat-error",10),t.YNc(33,ni,2,0,"mat-error",10),t.qZA()(),t.YNc(34,si,6,1,"div",15),t.YNc(35,mi,5,0,"div",15),t.TgZ(36,"div",7)(37,"mat-form-field",8)(38,"mat-label"),t._uU(39,"District Name Address "),t.qZA(),t.TgZ(40,"mat-select",16),t.NdJ("selectionChange",function(n){return i.onDistrictChange(n.value)}),t.YNc(41,ci,2,2,"mat-option",17),t.qZA(),t.YNc(42,di,2,0,"mat-error",10),t.qZA()(),t.TgZ(43,"div",7)(44,"mat-form-field",8)(45,"mat-label"),t._uU(46,"Health Block Address "),t.qZA(),t.TgZ(47,"mat-select",18),t.NdJ("selectionChange",function(n){return i.onBlockChange(n.value)}),t.YNc(48,ui,2,2,"mat-option",17),t.qZA()()(),t.YNc(49,_i,7,2,"div",15),t.YNc(50,fi,5,0,"div",15),t.YNc(51,vi,7,2,"div",15),t.TgZ(52,"div",19)(53,"label",20),t._uU(54,"Reason For Test *"),t.qZA(),t.TgZ(55,"div",21)(56,"mat-radio-group",22),t.NdJ("change",function(){return i.onReasonForTestChange()}),t.TgZ(57,"mat-radio-button",23),t._uU(58,"Presumptive Case"),t.qZA(),t.TgZ(59,"mat-radio-button",24),t._uU(60,"End of IP_CP FU"),t.qZA(),t.TgZ(61,"mat-radio-button",25),t._uU(62,"PTFU Test"),t.qZA()()(),t.YNc(63,Ti,2,0,"mat-error",10),t.qZA(),t.YNc(64,Di,10,1,"div",26),t.TgZ(65,"div",27)(66,"label",20),t._uU(67,"Locality *"),t.qZA(),t.TgZ(68,"div",28)(69,"mat-radio-group",29),t.NdJ("change",function(){return i.onLocalityChange()}),t.TgZ(70,"mat-radio-button",30),t._uU(71,"Rural (Gram Panchayat)"),t.qZA(),t.TgZ(72,"mat-radio-button",31),t._uU(73,"Urban (Municipal Bodies)"),t.qZA()()(),t.YNc(74,Zi,2,0,"mat-error",10),t.qZA()()(),t.TgZ(75,"div",32)(76,"button",33),t._uU(77," Save Data "),t.qZA()()()()(),t.TgZ(78,"div",34)(79,"h3",35),t._uU(80," Show the data based on filled form Data"),t.qZA(),t.TgZ(81,"div",36)(82,"table",37),t.ynx(83,38),t.YNc(84,Ai,2,0,"th",39),t.YNc(85,Ni,2,1,"td",40),t.BQk(),t.ynx(86,41),t.YNc(87,yi,2,0,"th",39),t.YNc(88,Ui,2,1,"td",40),t.BQk(),t.ynx(89,42),t.YNc(90,Li,2,0,"th",39),t.YNc(91,xi,2,1,"td",40),t.BQk(),t.ynx(92,43),t.YNc(93,Fi,2,0,"th",39),t.YNc(94,ki,2,1,"td",40),t.BQk(),t.ynx(95,44),t.YNc(96,Ii,2,0,"th",39),t.YNc(97,qi,2,1,"td",40),t.BQk(),t.ynx(98,45),t.YNc(99,wi,2,0,"th",39),t.YNc(100,Bi,2,1,"td",40),t.BQk(),t.ynx(101,46),t.YNc(102,Yi,2,0,"th",39),t.YNc(103,Ri,2,1,"td",40),t.BQk(),t.ynx(104,47),t.YNc(105,Si,2,0,"th",39),t.YNc(106,Qi,2,1,"td",40),t.BQk(),t.ynx(107,48),t.YNc(108,Ji,2,0,"th",39),t.YNc(109,Mi,2,1,"td",40),t.BQk(),t.ynx(110,49),t.YNc(111,Pi,2,0,"th",39),t.YNc(112,$i,2,1,"td",40),t.BQk(),t.ynx(113,50),t.YNc(114,Oi,2,0,"th",39),t.YNc(115,ji,2,1,"td",40),t.BQk(),t.ynx(116,51),t.YNc(117,Ei,2,0,"th",39),t.YNc(118,Vi,2,1,"td",40),t.BQk(),t.ynx(119,52),t.YNc(120,Gi,2,0,"th",39),t.YNc(121,zi,2,1,"td",40),t.BQk(),t.ynx(122,53),t.YNc(123,Wi,2,0,"th",39),t.YNc(124,Hi,2,1,"td",40),t.BQk(),t.ynx(125,54),t.YNc(126,Xi,2,0,"th",39),t.YNc(127,Ki,2,1,"td",40),t.BQk(),t.YNc(128,to,1,0,"tr",55),t.YNc(129,eo,1,0,"tr",56),t.qZA()(),t._UZ(130,"mat-paginator",57),t.qZA()),2&e){const r=t.MAs(23);let n,s,c,m,d,p,f,b,_,C,T,D;t.xp6(5),t.Q6J("formGroup",i.dmcForm),t.xp6(8),t.Q6J("ngIf",null==(n=i.dmcForm.get("pageNumber"))?null:n.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(s=i.dmcForm.get("pageNumber"))?null:s.hasError("maxlength")),t.xp6(1),t.Q6J("ngIf",null==(c=i.dmcForm.get("pageNumber"))?null:c.hasError("pattern")),t.xp6(5),t.Q6J("matDatepicker",r),t.xp6(1),t.Q6J("for",r),t.xp6(3),t.Q6J("ngIf",null==(m=i.dmcForm.get("testDate"))?null:m.hasError("required")),t.xp6(6),t.Q6J("ngIf",null==(d=i.dmcForm.get("episodeID"))?null:d.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(p=i.dmcForm.get("episodeID"))?null:p.hasError("minlength")),t.xp6(1),t.Q6J("ngIf",null==(f=i.dmcForm.get("episodeID"))?null:f.hasError("maxlength")),t.xp6(1),t.Q6J("ngIf",null==(b=i.dmcForm.get("episodeID"))?null:b.hasError("pattern")),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isUrbanSelected()),t.xp6(6),t.Q6J("ngForOf",i.districtList),t.xp6(1),t.Q6J("ngIf",null==(_=i.dmcForm.get("districtNameAddress"))?null:_.hasError("required")),t.xp6(6),t.Q6J("ngForOf",i.blockList),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isRuralSelected()),t.xp6(1),t.Q6J("ngIf",i.isUrbanSelected()),t.xp6(12),t.Q6J("ngIf",null==(C=i.dmcForm.get("reasonForTest"))?null:C.hasError("required")),t.xp6(1),t.Q6J("ngIf","ptfuTest"===(null==(T=i.dmcForm.get("reasonForTest"))?null:T.value)||"presumptiveCase"===(null==(T=i.dmcForm.get("reasonForTest"))?null:T.value)),t.xp6(10),t.Q6J("ngIf",null==(D=i.dmcForm.get("locality"))?null:D.hasError("required")),t.xp6(2),t.Q6J("disabled",!i.dmcForm.valid),t.xp6(6),t.Q6J("dataSource",i.dataSource),t.xp6(46),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",10)("pageSizeOptions",t.DdM(28,ao))}},dependencies:[Z.sg,Z.O5,x.ey,L.lW,g.Mq,g.hl,g.nW,v.TO,v.KE,v.hX,v.R9,y.Nt,F.NW,w.VQ,w.U0,N.gD,u.BZ,u.fO,u.as,u.w1,u.Dz,u.nj,u.ge,u.ev,u.XQ,u.Gk,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.nD,l.sg,l.u],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}.d-flex[_ngcontent-%COMP%]{gap:5px}table[_ngcontent-%COMP%]{width:100%}
1 .mat-radio-group{display:flex;align-items:center} .mat-radio-button{margin-right:16px}.currmonth[_ngcontent-%COMP%]{color:#7393b3}"]}),a})(),oo=(()=>{class a{}return a.\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({imports:[Z.ez,S.m,et.q,l.UX,l.u5,N.LD,g.FA,y.c,L.ot,x.XK,R.M,X.Ps,F.TU,K.Cv,tt.JX,u.p0,U.dp,Q.m8,bt.hJ,gt.w,J.Bz.forChild([{path:"cbnnat-form",component:Ce},{path:"truenaat-form",component:Qa},{path:"report",component:ft},{path:"cbnnat-report",component:we},{path:"truenaat-report",component:Xa},{path:"dmc-form",component:io}])]}),a})()}}]);
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.