diff --git a/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.html index 371af8220..644e6514e 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.html +++ b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.html @@ -11,8 +11,8 @@

@@ -31,19 +31,32 @@

{{ errorMessage }}

-
- Viewing a Draft Version of the Report for the chosen month. - This report is likely to change without warning. -
-
+
+ +
+
+
Ministry Of Health
- MOH 267 PrEP Daily Activity Register + AnteNatal (ANC) Register MOH 405
Ver. July 2023 @@ -346,596 +359,69 @@

(ar) (as) + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {{data.date_of_visit | date:'dd/MM/yyyy' }} + {{data.anc_number}} + {{data.anc_number_NUPI}} + {{data.number_of_anc_visits}} + {{data.full_names}} + {{data.date_of_birth | date:'dd/MM/yyyy'}} + {{data.subcounty_county}} + {{data.village_estate_landmark}} + {{data.marital_status}} + {{data.parity}} + {{data.gravidae}} + {{data.last_lmp_date | date:'dd/MM/yyyy'}} + {{data.edd | date:'dd/MM/yyyy'}} + {{data.gestation_in_weeks}} + {{data.muac}} + {{data.height}} + {{data.weight}} + {{data.blood_pressure}} + {{data.breast_exam}} + {{data.fgm}} + {{data.haemoglobin}} + {{data.blood_sugar_test}} + {{data.blood_group_rhesus}} + {{data.urinalysis}} + {{data.rpr_vdrl_duo}} + {{data.hepatitisB}} + {{data.tb_screening}} + {{data.hiv_test_type}} + {{data.hiv_test_1_kit_name}} + {{data.hiv_test_2_kit_name}} + {{data.hiv_test_3_kit_name}} + {{data.hiv_results}} + {{data.maternal_haart}} + {{data.infant_prophylaxis}} + {{data.partner_hiv_testing}} + {{data.other_conditions}} + {{data.deworming}} + {{data.ipt_1_3}} + {{data.tt_dose}} + {{data.supplementation}} + {{data.llitns}} + {{data.referrals_from}} + {{data.referrals_to}} + {{data.reason_for_referral}} + {{data.remarks}} - - - - - - - - - - + {{data.NUPI}} + {{data.age}} + {{data.phone_number}} + {{data.fgm_complications}} + {{data.rpr_vdrl_duo_results}} + {{data.hepatitisB_treatment}} + {{data.hiv_test_1_expiry_date | date:'dd/MM/yyyy'}} + {{data.hiv_test_2_expiry_date | date:'dd/MM/yyyy'}} + {{data.hiv_test_3_expiry_date | date:'dd/MM/yyyy'}} + {{data.other_conditions_treatment}} +

diff --git a/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.ts index 661cc2895..c90889c56 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.ts +++ b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.ts @@ -1,7 +1,18 @@ -import { Component, OnInit, Output } from '@angular/core'; +import { DatePipe } from '@angular/common'; +import { + Component, + ElementRef, + OnInit, + Output, + ViewChild +} from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; import * as Moment from 'moment'; +import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/services/data-analytics-dashboard.services'; +import { ANCRegisterResourceService } from 'src/app/etl-api/anc-register-resource.service'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; @Component({ selector: 'app-anc-register', templateUrl: './anc-register.component.html', @@ -12,9 +23,9 @@ export class AncRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public ancRegisterData: any = []; public columnDefs: any = []; - public reportName = 'ANC Register'; + public reportName = 'AnteNatal (ANC) Register MOH 405'; public currentView = 'monthly'; public currentViewBelow = 'pdf'; public month: string; @@ -22,16 +33,18 @@ export class AncRegisterComponent implements OnInit { public quarter: string; public eDate: string; public sDate: string; + public jointLocationUuids: string; public statusError = false; public errorMessage = ''; public showInfoMessage = false; public isLoading = false; public reportHead: any; - public enabledControls = 'locationControl,monthControl'; + public enabledControls = 'locationControl,dayControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + @ViewChild('cntdarcontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; public get locationUuids(): Array { @@ -48,13 +61,16 @@ export class AncRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + constructor( + public router: Router, + public route: ActivatedRoute, + public ancRegisterService: ANCRegisterResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined - ? (this._month = Moment() - .subtract(1, 'M') - .endOf('month') - .format('YYYY-MM-DD')) + ? (this._month = Moment().format('YYYY-MM-DD')) : (this._month = data.month); this.showDraftReportAlert(this._month); @@ -64,24 +80,30 @@ export class AncRegisterComponent implements OnInit { ngOnInit() {} public onMonthChange(value): any { - this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + this._month = Moment(value).format('YYYY-MM-DD'); } public generateReport(): any { + this.dataAnalyticsDashboardService + .getSelectedLocations() + .subscribe((data) => { + const locationValues = data.locations.map( + (location) => `'${location.value}'` + ); + this.jointLocationUuids = locationValues.join(', '); + }); + this.route.parent.parent.params.subscribe((params: any) => { - this.storeParamsInUrl(params.location_uuid); + this.storeParamsInUrl(); }); - this.txnewReportSummaryData = []; - // this.getTxNewReport(this.params); + this.ancRegisterData = []; + this.getANCRegisterData(this.params); } - public storeParamsInUrl(param) { + public storeParamsInUrl() { this.params = { - locationUuids: param, - _month: Moment(this._month).endOf('month').format('YYYY-MM-DD'), - month: Moment(this._month).endOf('month').format('YYYY-MM-DD'), - reportName: this.reportName, - _date: Moment(this._month).format('DD-MM-YYYY') + locationUuids: this.jointLocationUuids, + month: Moment(this._month).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -89,31 +111,31 @@ export class AncRegisterComponent implements OnInit { }); } - // public getTxNewReport(params: any) { - // this.isLoading = true; - // this.txnewReport.getTxNewReport(params).subscribe((data) => { - // if (data.error) { - // this.showInfoMessage = true; - // this.errorMessage = `There has been an error while loading the report, please retry again`; - // this.isLoading = false; - // } else { - // this.showInfoMessage = false; - // this.columnDefs = data.sectionDefinitions; - // this.txnewReportSummaryData = data.result; - // this.calculateTotalSummary(); - // this.isLoading = false; - // this.showDraftReportAlert(this._month); - // } - // }); - // } + public getANCRegisterData(params: any) { + this.isLoading = true; + this.ancRegisterService.getANCRegisterRegister(params).subscribe((data) => { + if (data.error) { + this.showInfoMessage = true; + this.errorMessage = `There has been an error while loading the report, please retry again`; + this.isLoading = false; + } else { + this.showInfoMessage = false; + this.columnDefs = data.sectionDefinitions; + this.ancRegisterData = data; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } public calculateTotalSummary() { const totalsRow = []; - if (this.txnewReportSummaryData.length > 0) { + if (this.ancRegisterData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.txnewReportSummaryData, (row) => { + _.each(this.ancRegisterData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { @@ -152,10 +174,27 @@ export class AncRegisterComponent implements OnInit { } public showDraftReportAlert(date) { - if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + if (date != null && date >= Moment().format('YYYY-MM-DD')) { this.isReleased = false; } else { this.isReleased = true; } } + + transformDate(date: string): string | null { + return this.datePipe.transform(date, 'dd/MM/yyyy'); + } + + public takeSnapshotAndExport() { + const elementToSnapshot = this.contentToSnapshot.nativeElement; + + html2canvas(elementToSnapshot).then((canvas) => { + const imgData = canvas.toDataURL('image/png'); + const pdf = new jsPDF('p', 'mm', 'a4'); + const imgWidth = 210; // A4 width in mm + const imgHeight = (canvas.height * imgWidth) / canvas.width; + pdf.addImage(imgData, 'PNG', 0, 0, imgWidth, imgHeight); + pdf.save('MOH 405 ANC Register.pdf'); + }); + } } diff --git a/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.html index bea9419a2..9fa86f769 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.html +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.html @@ -11,8 +11,8 @@

@@ -31,10 +31,6 @@

{{ errorMessage }}

-
- Viewing a Draft Version of the Report for the chosen month. - This report is likely to change without warning. -
> {{ a + 1 }} - {{ data.DATE }} - {{ data.National_ID }} + {{ data.date | date:'dd/MM/yyyy' }} + {{ data.national_id_number }} - {{ data.CCC_Number }} + {{ data.ccc_number }} - {{ data.Age }} - - - - + {{ data.age }} + {{data.started_on_art}} @@ -222,8 +215,11 @@

+ {{data.screened_for_tb}} + {{data.started_on_tpt}} + {{data.current_on_art}} @@ -237,9 +233,9 @@

- - - + {{data.dsd_status}} + {{data.dsd_type}} + {{data.remarks}} {{ data.NUPI }} diff --git a/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.ts index 9b5fe26cd..f94ae500f 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.ts +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.ts @@ -40,7 +40,7 @@ export class CntdailyRegisterComponent implements OnInit { public showInfoMessage = false; public isLoading = false; public reportHead: any; - public enabledControls = 'locationControl,monthControl'; + public enabledControls = 'locationControl,dayControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; @@ -70,10 +70,7 @@ export class CntdailyRegisterComponent implements OnInit { ) { this.route.queryParams.subscribe((data) => { data.month === undefined - ? (this._month = Moment() - .subtract(1, 'M') - .endOf('month') - .format('YYYY-MM-DD')) + ? (this._month = Moment().format('YYYY-MM-DD')) : (this._month = data.month); this.showDraftReportAlert(this._month); @@ -83,7 +80,7 @@ export class CntdailyRegisterComponent implements OnInit { ngOnInit() {} public onMonthChange(value): any { - this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + this._month = Moment(value).format('YYYY-MM-DD'); } public generateReport(): any { @@ -106,7 +103,7 @@ export class CntdailyRegisterComponent implements OnInit { public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).endOf('month').format('YYYY-MM-DD') + month: Moment(this._month).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -180,7 +177,7 @@ export class CntdailyRegisterComponent implements OnInit { } public showDraftReportAlert(date) { - if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + if (date != null && date >= Moment().format('YYYY-MM-DD')) { this.isReleased = false; } else { this.isReleased = true; diff --git a/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.html index 5b49af7a1..cfb6026be 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.html +++ b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.html @@ -11,8 +11,8 @@

@@ -31,10 +31,6 @@

{{ errorMessage }}

-
- Viewing a Draft Version of the Report for the chosen month. - This report is likely to change without warning. -
× @@ -46,10 +42,6 @@

{{ errorMessage }}

-
- Viewing a Draft Version of the Report for the chosen month. - This report is likely to change without warning. -
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {{ a + 1 }} + {{ data.client_id_No }} + {{ data.first_name }} {{ data.middle }} {{ data.last_name }} + {{ data.village }} + {{ data.telephone_number }} + {{ data.date_of_missed_appointment | date:'dd/MM/yyyy' }} + {{ data.defaulter_tracing_outcomes }} + {{ data.date_of_outcomes | date:'dd/MM/yyyy' }} + {{ data.outcomes }} - + {{ data.nupi }} +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.ts index c9a90b99e..f7666f45f 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.ts +++ b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.ts @@ -42,7 +42,7 @@ export class DefaultertracingRegisterComponent implements OnInit { public showInfoMessage = false; public isLoading = false; public reportHead: any; - public enabledControls = 'locationControl,monthControl'; + public enabledControls = 'locationControl,dayControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; @@ -74,10 +74,7 @@ export class DefaultertracingRegisterComponent implements OnInit { ) { this.route.queryParams.subscribe((data) => { data.month === undefined - ? (this._month = Moment() - .subtract(1, 'M') - .endOf('month') - .format('YYYY-MM-DD')) + ? (this._month = Moment().format('YYYY-MM-DD')) : (this._month = data.month); this.showDraftReportAlert(this._month); @@ -87,7 +84,7 @@ export class DefaultertracingRegisterComponent implements OnInit { ngOnInit() {} public onMonthChange(value): any { - this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + this._month = Moment(value).format('YYYY-MM-DD'); } public generateReport(): any { @@ -104,14 +101,14 @@ export class DefaultertracingRegisterComponent implements OnInit { this.storeParamsInUrl(); }); this.defaulterTracingRegisterData = []; - this.getPrEPRegisterReport(this.params); + this.getDefaulterTracingRegister(this.params); this.generated = true; } public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).endOf('month').format('YYYY-MM-DD') + month: Moment(this._month).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -119,9 +116,9 @@ export class DefaultertracingRegisterComponent implements OnInit { }); } - public getPrEPRegisterReport(params: any) { + public getDefaulterTracingRegister(params: any) { this.isLoading = true; - this.register.getPrEPRegisterReport(params).subscribe((data) => { + this.register.getDefaulterTracingRegister(params).subscribe((data) => { if (data.error) { this.showInfoMessage = true; this.errorMessage = `There has been an error while loading the report, please retry again`; @@ -150,7 +147,7 @@ export class DefaultertracingRegisterComponent implements OnInit { } public showDraftReportAlert(date) { - if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + if (date != null && date >= Moment().format('YYYY-MM-DD')) { this.isReleased = false; } else { this.isReleased = true; diff --git a/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html index 8f90e37ae..8f305ccc1 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html @@ -11,8 +11,8 @@

@@ -31,10 +31,6 @@

{{ errorMessage }}

-
- Viewing a Draft Version of the Report for the chosen month. - This report is likely to change without warning. -
{{ data.Birth_Certificate_number }} - + {{ data.HEI_ID }} diff --git a/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.ts index 747442537..06a7aceb8 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.ts +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.ts @@ -41,7 +41,7 @@ export class HeiRegisterComponent implements OnInit { public showInfoMessage = false; public isLoading = false; public reportHead: any; - public enabledControls = 'locationControl,monthControl'; + public enabledControls = 'locationControl,dayControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; @@ -71,10 +71,7 @@ export class HeiRegisterComponent implements OnInit { ) { this.route.queryParams.subscribe((data) => { data.month === undefined - ? (this._month = Moment() - .subtract(1, 'M') - .endOf('month') - .format('YYYY-MM-DD')) + ? (this._month = Moment().format('YYYY-MM-DD')) : (this._month = data.month); this.showDraftReportAlert(this._month); @@ -84,7 +81,7 @@ export class HeiRegisterComponent implements OnInit { ngOnInit() {} public onMonthChange(value): any { - this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + this._month = Moment(value).format('YYYY-MM-DD'); } public generateReport(): any { @@ -107,7 +104,7 @@ export class HeiRegisterComponent implements OnInit { public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).endOf('month').format('YYYY-MM-DD') + month: Moment(this._month).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -177,7 +174,7 @@ export class HeiRegisterComponent implements OnInit { } public showDraftReportAlert(date) { - if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + if (date != null && date >= Moment().format('YYYY-MM-DD')) { this.isReleased = false; } else { this.isReleased = true; diff --git a/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.html index 5ff82d48e..03028642c 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.html +++ b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.html @@ -11,8 +11,8 @@

@@ -31,10 +31,6 @@

{{ errorMessage }}

-
- Viewing a Draft Version of the Report for the chosen month. - This report is likely to change without warning. -
× @@ -46,10 +42,6 @@

{{ errorMessage }}

-
- Viewing a Draft Version of the Report for the chosen month. - This report is likely to change without warning. -
{ data.month === undefined - ? (this._month = Moment() - .subtract(1, 'M') - .endOf('month') - .format('YYYY-MM-DD')) + ? (this._month = Moment().format('YYYY-MM-DD')) : (this._month = data.month); this.showDraftReportAlert(this._month); @@ -86,7 +83,7 @@ export class PrepdailyRegisterComponent implements OnInit { ngOnInit() {} public onMonthChange(value): any { - this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + this._month = Moment(value).format('MM-DD-YYYY'); } public generateReport(): any { @@ -110,7 +107,7 @@ export class PrepdailyRegisterComponent implements OnInit { public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).endOf('month').format('YYYY-MM-DD') + month: Moment(this._month).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -149,7 +146,7 @@ export class PrepdailyRegisterComponent implements OnInit { } public showDraftReportAlert(date) { - if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + if (date != null && date >= Moment().format('YYYY-MM-DD')) { this.isReleased = false; } else { this.isReleased = true; diff --git a/src/app/etl-api/anc-register-resource.service.ts b/src/app/etl-api/anc-register-resource.service.ts new file mode 100644 index 000000000..7e966f10a --- /dev/null +++ b/src/app/etl-api/anc-register-resource.service.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core'; +import { AppSettingsService } from '../app-settings/app-settings.service'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import * as Moment from 'moment'; +import { catchError, map } from 'rxjs/operators'; +@Injectable({ + providedIn: 'root' +}) +export class ANCRegisterResourceService { + public get url(): string { + return this.appSettingsService.getEtlRestbaseurl().trim(); + } + constructor( + public http: HttpClient, + public appSettingsService: AppSettingsService + ) {} + public getANCRegisterRegister(params: any): Observable { + return this.http + .get( + `${this.url}registers/ancregister?endDate=${params.month}&locationUuids=${params.locationUuids}` + ) + .pipe( + catchError((err: any) => { + const error: any = err; + const errorObj = { + error: error.status, + message: error.statusText + }; + return Observable.of(errorObj); + }), + map((response: Response) => { + return response; + }) + ); + } +} diff --git a/src/app/etl-api/care-treatment-resource.service.ts b/src/app/etl-api/care-treatment-resource.service.ts index 77e76f6fd..a4708492d 100644 --- a/src/app/etl-api/care-treatment-resource.service.ts +++ b/src/app/etl-api/care-treatment-resource.service.ts @@ -19,7 +19,7 @@ export class CareTreatmentResourceService { // tslint:disable-next-line: max-line-length return this.http .get( - `${this.url}care-and-treatment-register?endDate=${params.month}&locationUuids=${params.locationUuids}` + `${this.url}registers/cntregister?endDate=${params.month}&locationUuids=${params.locationUuids}` ) .pipe( catchError((err: any) => { diff --git a/src/app/etl-api/hei-register-resource.service.ts b/src/app/etl-api/hei-register-resource.service.ts index 9fe930f89..b16ee1913 100644 --- a/src/app/etl-api/hei-register-resource.service.ts +++ b/src/app/etl-api/hei-register-resource.service.ts @@ -19,7 +19,7 @@ export class HeiRegisterResourceService { // tslint:disable-next-line: max-line-length return this.http .get( - `${this.url}hei-register?endDate=${params.month}&locationUuids=${params.locationUuids}` + `${this.url}registers/heiregister?endDate=${params.month}&locationUuids=${params.locationUuids}` ) .pipe( catchError((err: any) => { diff --git a/src/app/etl-api/registers-resource.service.ts b/src/app/etl-api/registers-resource.service.ts index 140bb39e9..50b28d775 100644 --- a/src/app/etl-api/registers-resource.service.ts +++ b/src/app/etl-api/registers-resource.service.ts @@ -16,10 +16,28 @@ export class RegistersResourceService { public appSettingsService: AppSettingsService ) {} public getPrEPRegisterReport(params: any): Observable { - // tslint:disable-next-line: max-line-length return this.http .get( - `${this.url}prepregisterdata?month=${params.month}&locationUuids=${params.locationUuids}` + `${this.url}registers/prepregisterdata?month=${params.month}&locationUuids=${params.locationUuids}` + ) + .pipe( + catchError((err: any) => { + const error: any = err; + const errorObj = { + error: error.status, + message: error.statusText + }; + return Observable.of(errorObj); + }), + map((response: Response) => { + return response; + }) + ); + } + public getDefaulterTracingRegister(params: any): Observable { + return this.http + .get( + `${this.url}registers/defaultertracing?month=${params.month}&locationUuids=${params.locationUuids}` ) .pipe( catchError((err: any) => { diff --git a/src/app/shared/report-filters/report-filters.component.html b/src/app/shared/report-filters/report-filters.component.html index cd43126a6..0f37045cf 100644 --- a/src/app/shared/report-filters/report-filters.component.html +++ b/src/app/shared/report-filters/report-filters.component.html @@ -124,7 +124,7 @@
- +