From 0f9f49e94562e4057dcb575b7453fc9a878a3562 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 23 May 2024 09:56:13 +0300 Subject: [PATCH 1/3] POC-737: Development of MOH Registers --- .../hiv/data-analytics-hiv.module.ts | 22 ++- .../hiv/data-analytics-hiv.routes.ts | 100 +++++++++++ .../anc-register/anc-register.component.css | 0 .../anc-register/anc-register.component.html | 54 ++++++ .../anc-register.component.spec.ts | 24 +++ .../anc-register/anc-register.component.ts | 161 ++++++++++++++++++ .../cntdaily-register.component.css | 0 .../cntdaily-register.component.html | 54 ++++++ .../cntdaily-register.component.spec.ts | 24 +++ .../cntdaily-register.component.ts | 161 ++++++++++++++++++ .../defaultertracing-register.component.css | 0 .../defaultertracing-register.component.html | 54 ++++++ ...efaultertracing-register.component.spec.ts | 24 +++ .../defaultertracing-register.component.ts | 161 ++++++++++++++++++ .../hei-register/hei-register.component.css | 0 .../hei-register/hei-register.component.html | 54 ++++++ .../hei-register.component.spec.ts | 24 +++ .../hei-register/hei-register.component.ts | 161 ++++++++++++++++++ .../htsrefferallinkage-register.component.css | 0 ...htsrefferallinkage-register.component.html | 54 ++++++ ...refferallinkage-register.component.spec.ts | 24 +++ .../htsrefferallinkage-register.component.ts | 161 ++++++++++++++++++ .../maternity-register.component.css | 0 .../maternity-register.component.html | 54 ++++++ .../maternity-register.component.spec.ts | 24 +++ .../maternity-register.component.ts | 161 ++++++++++++++++++ .../nutrition-register.component.css | 0 .../nutrition-register.component.html | 54 ++++++ .../nutrition-register.component.spec.ts | 24 +++ .../nutrition-register.component.ts | 161 ++++++++++++++++++ .../pnc-register/pnc-register.component.css | 0 .../pnc-register/pnc-register.component.html | 54 ++++++ .../pnc-register.component.spec.ts | 24 +++ .../pnc-register/pnc-register.component.ts | 161 ++++++++++++++++++ .../prepdaily-register.component.css | 0 .../prepdaily-register.component.html | 54 ++++++ .../prepdaily-register.component.spec.ts | 24 +++ .../prepdaily-register.component.ts | 161 ++++++++++++++++++ .../hiv/registers/registers.component.css | 0 .../hiv/registers/registers.component.html | 27 +++ .../hiv/registers/registers.component.spec.ts | 24 +++ .../hiv/registers/registers.component.ts | 79 +++++++++ .../schema/analytics.dashboard.conf.json | 6 + 43 files changed, 2408 insertions(+), 1 deletion(-) create mode 100644 src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/registers.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/registers.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/registers.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/registers.component.ts diff --git a/src/app/data-analytics-dashboard/hiv/data-analytics-hiv.module.ts b/src/app/data-analytics-dashboard/hiv/data-analytics-hiv.module.ts index f0664f9b7..d370a3a9e 100644 --- a/src/app/data-analytics-dashboard/hiv/data-analytics-hiv.module.ts +++ b/src/app/data-analytics-dashboard/hiv/data-analytics-hiv.module.ts @@ -44,6 +44,16 @@ import { TxMmdReportComponent } from './datim-reports/tx-mmd-report.component'; import { TxRttReportComponent } from './datim-reports/tx-rtt-report.component'; import { AhdReportComponent } from './ahd-report/ahd-report.component'; import { PlhivNcdV2ReportComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v2-report.component'; +import { RegistersComponent } from './registers/registers.component'; +import { HeiRegisterComponent } from './registers/hei-register/hei-register.component'; +import { AncRegisterComponent } from './registers/anc-register/anc-register.component'; +import { NutritionRegisterComponent } from './registers/nutrition-register/nutrition-register.component'; +import { MaternityRegisterComponent } from './registers/maternity-register/maternity-register.component'; +import { HtsrefferallinkageRegisterComponent } from './registers/htsrefferallinkage-register/htsrefferallinkage-register.component'; +import { PncRegisterComponent } from './registers/pnc-register/pnc-register.component'; +import { DefaultertracingRegisterComponent } from './registers/defaultertracing-register/defaultertracing-register.component'; +import { PrepdailyRegisterComponent } from './registers/prepdaily-register/prepdaily-register.component'; +import { CntdailyRegisterComponent } from './registers/cntdaily-register/cntdaily-register.component'; @NgModule({ imports: [ @@ -97,7 +107,17 @@ import { PlhivNcdV2ReportComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v2-re TxMmdReportComponent, TxRttReportComponent, PlhivNcdV2ReportComponent, - AhdReportComponent + AhdReportComponent, + RegistersComponent, + HeiRegisterComponent, + AncRegisterComponent, + NutritionRegisterComponent, + MaternityRegisterComponent, + HtsrefferallinkageRegisterComponent, + PncRegisterComponent, + DefaultertracingRegisterComponent, + PrepdailyRegisterComponent, + CntdailyRegisterComponent ], providers: [ DataAnalyticsDashboardService, diff --git a/src/app/data-analytics-dashboard/hiv/data-analytics-hiv.routes.ts b/src/app/data-analytics-dashboard/hiv/data-analytics-hiv.routes.ts index e9e7a5919..cd482d7c5 100644 --- a/src/app/data-analytics-dashboard/hiv/data-analytics-hiv.routes.ts +++ b/src/app/data-analytics-dashboard/hiv/data-analytics-hiv.routes.ts @@ -57,6 +57,16 @@ import { AhdReportComponent } from './ahd-report/ahd-report.component'; import { AhdMonthlyReportPatientlistComponent } from 'src/app/hiv-care-lib/ahd-monthly-report/ahd-monthly-report-patientlist/ahd-monthly-report-patientlist.component'; import { PlhivNcdV2ReportPatientListComponent } from 'src/app/hiv-care-lib/plhiv-ncd-v2-report/plhiv-ncd-v2-report-patient-list/plhiv-ncd-v2-report-patient-list.component'; import { PlhivNcdV2ReportComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v2-report.component'; +import { RegistersComponent } from './registers/registers.component'; +import { HeiRegisterComponent } from './registers/hei-register/hei-register.component'; +import { AncRegisterComponent } from './registers/anc-register/anc-register.component'; +import { NutritionRegisterComponent } from './registers/nutrition-register/nutrition-register.component'; +import { MaternityRegisterComponent } from './registers/maternity-register/maternity-register.component'; +import { HtsrefferallinkageRegisterComponent } from './registers/htsrefferallinkage-register/htsrefferallinkage-register.component'; +import { PncRegisterComponent } from './registers/pnc-register/pnc-register.component'; +import { DefaultertracingRegisterComponent } from './registers/defaultertracing-register/defaultertracing-register.component'; +import { PrepdailyRegisterComponent } from './registers/prepdaily-register/prepdaily-register.component'; +import { CntdailyRegisterComponent } from './registers/cntdaily-register/cntdaily-register.component'; const routes: Routes = [ { @@ -285,6 +295,96 @@ const routes: Routes = [ } ] }, + { + path: 'registers', + children: [ + { + path: '', + component: RegistersComponent + }, + { + path: 'hei-register', + children: [ + { + path: '', + component: HeiRegisterComponent + } + ] + }, + { + path: 'anc-register', + children: [ + { + path: '', + component: AncRegisterComponent + } + ] + }, + { + path: 'nutrition-register', + children: [ + { + path: '', + component: NutritionRegisterComponent + } + ] + }, + { + path: 'maternity-register', + children: [ + { + path: '', + component: MaternityRegisterComponent + } + ] + }, + { + path: 'htsrefferallinkage-register', + children: [ + { + path: '', + component: HtsrefferallinkageRegisterComponent + } + ] + }, + { + path: 'pnc-register', + children: [ + { + path: '', + component: PncRegisterComponent + } + ] + }, + { + path: 'defaultertracing-register', + children: [ + { + path: '', + component: DefaultertracingRegisterComponent + } + ] + }, + { + path: 'prepdaily-register', + children: [ + { + path: '', + component: PrepdailyRegisterComponent + } + ] + }, + { + path: 'cntdaily-register', + children: [ + { + path: '', + component: CntdailyRegisterComponent + } + ] + } + ] + }, { path: 'datim-report', children: [ diff --git a/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.css b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.css new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.spec.ts new file mode 100644 index 000000000..dc9a601fd --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AncRegisterComponent } from './anc-register.component'; + +describe('AncRegisterComponent', () => { + let component: AncRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AncRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AncRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 000000000..661cc2895 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-anc-register', + templateUrl: './anc-register.component.html', + styleUrls: ['./anc-register.component.css'] +}) +export class AncRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'ANC Register'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + this.isReleased = false; + } else { + this.isReleased = true; + } + } +} diff --git a/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.css b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.css new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.spec.ts new file mode 100644 index 000000000..afa8dd874 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CntdailyRegisterComponent } from './cntdaily-register.component'; + +describe('CntdailyRegisterComponent', () => { + let component: CntdailyRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [CntdailyRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CntdailyRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 000000000..ac6aed7de --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-cntdaily-register', + templateUrl: './cntdaily-register.component.html', + styleUrls: ['./cntdaily-register.component.css'] +}) +export class CntdailyRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'Care and Treatment Daily Activity'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').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.css b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.css new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.spec.ts new file mode 100644 index 000000000..85c755813 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DefaultertracingRegisterComponent } from './defaultertracing-register.component'; + +describe('DefaultertracingRegisterComponent', () => { + let component: DefaultertracingRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DefaultertracingRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaultertracingRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 000000000..83b012c91 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-defaultertracing-register', + templateUrl: './defaultertracing-register.component.html', + styleUrls: ['./defaultertracing-register.component.css'] +}) +export class DefaultertracingRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'Defaulter Tracing Register'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').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.css b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.css new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.spec.ts new file mode 100644 index 000000000..19143ac64 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HeiRegisterComponent } from './hei-register.component'; + +describe('HeiRegisterComponent', () => { + let component: HeiRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [HeiRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HeiRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 000000000..2a9de1b47 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-hei-register', + templateUrl: './hei-register.component.html', + styleUrls: ['./hei-register.component.css'] +}) +export class HeiRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'HEI Register'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + this.isReleased = false; + } else { + this.isReleased = true; + } + } +} diff --git a/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.css b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.html new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.spec.ts new file mode 100644 index 000000000..925245470 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HtsrefferallinkageRegisterComponent } from './htsrefferallinkage-register.component'; + +describe('HtsrefferallinkageRegisterComponent', () => { + let component: HtsrefferallinkageRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [HtsrefferallinkageRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HtsrefferallinkageRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.ts new file mode 100644 index 000000000..503ec25fc --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-htsrefferallinkage-register', + templateUrl: './htsrefferallinkage-register.component.html', + styleUrls: ['./htsrefferallinkage-register.component.css'] +}) +export class HtsrefferallinkageRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'HTS Lab Refferal & Linkage Register'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + this.isReleased = false; + } else { + this.isReleased = true; + } + } +} diff --git a/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.css b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.html new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.spec.ts new file mode 100644 index 000000000..1a50a56fd --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MaternityRegisterComponent } from './maternity-register.component'; + +describe('MaternityRegisterComponent', () => { + let component: MaternityRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [MaternityRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MaternityRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.ts new file mode 100644 index 000000000..8fe1183d4 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-maternity-register', + templateUrl: './maternity-register.component.html', + styleUrls: ['./maternity-register.component.css'] +}) +export class MaternityRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'Martenity Register'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + this.isReleased = false; + } else { + this.isReleased = true; + } + } +} diff --git a/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.css b/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.html new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.spec.ts new file mode 100644 index 000000000..02a62ca91 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NutritionRegisterComponent } from './nutrition-register.component'; + +describe('NutritionRegisterComponent', () => { + let component: NutritionRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [NutritionRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NutritionRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.ts new file mode 100644 index 000000000..3240e3fd1 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-nutrition-register', + templateUrl: './nutrition-register.component.html', + styleUrls: ['./nutrition-register.component.css'] +}) +export class NutritionRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'Nutrition Service Register'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + this.isReleased = false; + } else { + this.isReleased = true; + } + } +} diff --git a/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.css b/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.html new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.spec.ts new file mode 100644 index 000000000..bc56e4b5d --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PncRegisterComponent } from './pnc-register.component'; + +describe('PncRegisterComponent', () => { + let component: PncRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PncRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PncRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.ts new file mode 100644 index 000000000..160dead32 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-pnc-register', + templateUrl: './pnc-register.component.html', + styleUrls: ['./pnc-register.component.css'] +}) +export class PncRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'PNC Register'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').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.css b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.css new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..40a18d212 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.html @@ -0,0 +1,54 @@ +

+ {{ reportName }} +

+ +
+ Loading... +
+ + +
+ + + + +
+
+ +
+ × +

+ An + error occurred while trying to load the report. Please try again. +

+

+ {{ errorMessage }} +

+
+
+ Viewing a Draft Version of the Report for the chosen month. + This report is likely to change without warning. +
+
+ + + + + +
diff --git a/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.spec.ts new file mode 100644 index 000000000..b44182395 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PrepdailyRegisterComponent } from './prepdaily-register.component'; + +describe('PrepdailyRegisterComponent', () => { + let component: PrepdailyRegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PrepdailyRegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PrepdailyRegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.ts new file mode 100644 index 000000000..c982e94bd --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.ts @@ -0,0 +1,161 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +@Component({ + selector: 'app-prepdaily-register', + templateUrl: './prepdaily-register.component.html', + styleUrls: ['./prepdaily-register.component.css'] +}) +export class PrepdailyRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public txnewReportSummaryData: any = []; + public columnDefs: any = []; + public reportName = 'PrEP Daily Activity Register'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'locationControl,monthControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + + public _locationUuids: any = []; + public get locationUuids(): Array { + return this._locationUuids; + } + + public set locationUuids(v: Array) { + const locationUuids = []; + _.each(v, (location: any) => { + if (location.value) { + locationUuids.push(location); + } + }); + this._locationUuids = locationUuids; + } + + constructor(public router: Router, public route: ActivatedRoute) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment() + .subtract(1, 'M') + .endOf('month') + .format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + public generateReport(): any { + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(params.location_uuid); + }); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); + } + + public storeParamsInUrl(param) { + 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') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + // 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 calculateTotalSummary() { + const totalsRow = []; + if (this.txnewReportSummaryData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.txnewReportSummaryData, (row) => { + Object.keys(row).map((key) => { + if (Number.isInteger(row[key]) === true) { + if (totalObj[key]) { + totalObj[key] = row[key] + totalObj[key]; + } else { + totalObj[key] = row[key]; + } + } else { + if (Number.isNaN(totalObj[key])) { + totalObj[key] = 0; + } + if (totalObj[key] === null) { + totalObj[key] = 0; + } + totalObj[key] = 0 + totalObj[key]; + } + }); + }); + totalObj.location = 'Totals'; + totalsRow.push(totalObj); + this.pinnedBottomRowData = totalsRow; + } + } + public onIndicatorSelected(value) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: value.field, + indicatorHeader: value.headerName, + indicatorGender: value.gender, + month: this._month, + locationUuids: value.location, + currentView: this.currentView + } + }); + } + + public showDraftReportAlert(date) { + if (date != null && date >= Moment().endOf('month').format('YYYY-MM-DD')) { + this.isReleased = false; + } else { + this.isReleased = true; + } + } +} diff --git a/src/app/data-analytics-dashboard/hiv/registers/registers.component.css b/src/app/data-analytics-dashboard/hiv/registers/registers.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/data-analytics-dashboard/hiv/registers/registers.component.html b/src/app/data-analytics-dashboard/hiv/registers/registers.component.html new file mode 100644 index 000000000..c40ea7725 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/registers.component.html @@ -0,0 +1,27 @@ + +

Loading available dashboards ...

+
+ {{ errorMessage }} +
+ \ No newline at end of file diff --git a/src/app/data-analytics-dashboard/hiv/registers/registers.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/registers.component.spec.ts new file mode 100644 index 000000000..769a029a0 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/registers.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RegistersComponent } from './registers.component'; + +describe('RegistersComponent', () => { + let component: RegistersComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [RegistersComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RegistersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/registers/registers.component.ts b/src/app/data-analytics-dashboard/hiv/registers/registers.component.ts new file mode 100644 index 000000000..92750254f --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/registers.component.ts @@ -0,0 +1,79 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; + +@Component({ + selector: 'app-registers', + templateUrl: './registers.component.html', + styleUrls: ['./registers.component.css'] +}) +export class RegistersComponent implements OnInit { + public isBusy = false; + public errorMessage = ''; + + public dashboards: Array = []; + constructor(public router: Router, public route: ActivatedRoute) {} + + ngOnInit() { + this.dashboards = [ + { + title: 'MOH-408: HEI Register', + description: '', + url: 'hei-register', + icon: 'fa' + }, + { + title: 'MOH-405: ANC Register', + description: '', + url: 'anc-register', + icon: 'fa' + }, + { + title: 'MOH-407: Nutrition Service Register', + description: '', + url: 'nutrition-register', + icon: 'fa' + }, + { + title: 'MOH-333: Martenity Register', + description: '', + url: 'maternity-register', + icon: 'fa' + }, + { + title: 'MOH-362: HTS Lab Refferal & Linkage Register', + description: '', + url: 'htsrefferallinkage-register', + icon: 'fa' + }, + { + title: 'MOH-406: PNC Register', + description: '', + url: 'pnc-register', + icon: 'fa' + }, + { + title: 'Defaulter Tracing Register', + description: '', + url: 'defaultertracing-register', + icon: 'fa' + }, + { + title: 'MOH-267: PrEP Daily Activity Register', + description: '', + url: 'prepdaily-register', + icon: 'fa' + }, + { + title: 'MOH-366: Care and Treatment Daily Activity', + description: '', + url: 'cntdaily-register', + icon: 'fa' + } + ]; + } + public viewDashboard(dashboard: any) { + this.router.navigate([dashboard.url], { + relativeTo: this.route + }); + } +} diff --git a/src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json b/src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json index 0cc6d3a9c..ebd82770a 100644 --- a/src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json +++ b/src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json @@ -114,6 +114,12 @@ "icon": "fa fa-file", "isSideBarOpen": false }, + { + "url": "registers", + "label": "Registers", + "icon": "fa fa-list-alt", + "isSideBarOpen": false + }, { "url": "select-department", "label": "Change Department", From 624b758c6da367a1997fbadbbefbfed65202fdbf Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 23 May 2024 10:22:12 +0300 Subject: [PATCH 2/3] POC-737: Development of MOH Registers --- .../hiv/registers/registers.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/data-analytics-dashboard/hiv/registers/registers.component.html b/src/app/data-analytics-dashboard/hiv/registers/registers.component.html index c40ea7725..e040fcba0 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/registers.component.html +++ b/src/app/data-analytics-dashboard/hiv/registers/registers.component.html @@ -24,4 +24,4 @@
{{ dashboard.description }}
- \ No newline at end of file + From 09c622364348ec96296915bfb8a4a76084a3b225 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Fri, 24 May 2024 15:29:39 +0300 Subject: [PATCH 3/3] POC-746: MOH 366 Care and Treatment Daily Activity --- .../cntdaily-register.component.css | 14 + .../cntdaily-register.component.html | 990 +++++++++++++++++- 2 files changed, 988 insertions(+), 16 deletions(-) diff --git a/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.css b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.css index e69de29bb..7d7e743ba 100644 --- a/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.css +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.css @@ -0,0 +1,14 @@ +tr, +.table-bordered th, +.table-bordered td { + border: 2px solid #000; /* Darker border color */ +} +tbody tr { + height: 20px; /* Adjust the height as per your design */ +} +.vertical-text { + writing-mode: vertical-rl; + text-orientation: mixed; + transform: rotate(180deg); + white-space: nowrap; +} 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 40a18d212..0dfc1180d 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 @@ -35,20 +35,978 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning. -
- - - - - + +
+
+
+
+ Ministry Of Health +
+
+ HIV Care Treatment Daily Activity Register MOH 366 +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NoDateNational Identification NumberClient CCC NumberAgeStarting ART + TB in HIV Care
(Newly Initiated on ART) +
+ Currently on ART (Starting and Continuing ART) + DSDRemarks
Client Unique Number (NUPI) + Tick as appropriate for age + Screened for TBStarted TPT + Indicate No. of months of till next appointment or
+ "R"for patients making unscheduled visits +
StatusType
Indicate Y/N/NA + E=Established
+ NE=Not Established +
+ C
+ FT
+ HFAG
+ PFAG
+ HCAG
+ PCAG
+ CP
+ CADP
+ IACD +
< 1 yrs (M)< 1 yrs (F)1-4 yrs (M)1-4 yrs (F)5-9 yrs (M)5-9 yrs (F)10-14 yrs (M)10-14 yrs (F)15-19 yrs (M)15-19 yrs (F)20-24 yrs(M)20-24 yrs (F)25+ yrs (M)25+ yrs (F)< 15 yrs15+ yrs< 15 yrs15+ yrs< 1 yrs (M)< 1 yrs (F)1-4 yrs (M)1-4 yrs (F)5-9 yrs (M)5-9 yrs (F)10-14 yrs (M)10-14 yrs (F)15-19 yrs (M)15-19 yrs (F)20-24 yrs(M)20-24 yrs (F)25+ yrs (M)25+ yrs (F)
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(q)(r)(s)(t)(u)(v)(w)(x)(y)(z)(aa)(ab)(ac)(ad)(ae)(af)(ag)(ah)(ai)(aj)(ak)(al)(am)(an)(ao)
Data element CODEHV03-01HV03-02HV03-03HV03-04HV03-05HV03-06HV03-07HV03-08HV03-09HV03-10HV03-11HV03-12HV03-13HV03-14HV03-15HV03-16HV03-17HV03-18HV03-19HV03-20HV03-21HV03-22HV03-23HV03-24HV03-25HV03-26HV03-27HV03-28HV03-29HV03-30HV03-31HV03-32HV03-33HV03-34
TOTAL this Page
TOTAL this Page
TOTAL this Month
(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(q)(r)(s)(t)(u)(v)(w)(x)(y)(z)(aa)(ab)(ac)(ad)(ae)(af)(ag)(ah)(ai)(aj)(ak)(al)(am)(an)(ao)
+ Summary of clinical visits + + Count of clients with 2 months appointment +
Total this Month (2s)
+ Count of clients with 3 months appointment +
Total this Month (3s)
+ Count of clients with 4 months appointment +
Total this Month (4s)
+ Count of clients with 5 months appointment +
Total this Month (5s)
+ Count of clients with 6 months appointment +
Total this Month (6s)
+