From 2b3ec3761561239b083a5029fe9ac52eaa63cf51 Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:56:31 +0300 Subject: [PATCH 01/50] Poc 739 (#1752) * POC-737: Development of MOH Registers * POC-737: Development of MOH Registers * POC-739: MOH 408 HIV Exposed Infant Registers * POC-739 added data for HEI --------- Co-authored-by: Alfred-Mutai --- .../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 | 8 + .../hei-register/hei-register.component.html | 206 ++++++++++++++++++ .../hei-register.component.spec.ts | 24 ++ .../hei-register/hei-register.component.ts | 167 ++++++++++++++ .../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 +++++++ .../etl-api/hei-register-resource.service.ts | 58 +++++ .../schema/analytics.dashboard.conf.json | 6 + 44 files changed, 2632 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 create mode 100644 src/app/etl-api/hei-register-resource.service.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 2a04aba4e..1122e2fbd 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 @@ -59,6 +59,16 @@ import { PlhivNcdV2ReportPatientListComponent } from 'src/app/hiv-care-lib/plhiv import { PlhivNcdV2ReportComponent } from './plhiv-ncd-v2-report/plhiv-ncd-v2-report.component'; import { CaseSurveillanceBaseComponent } from 'src/app/hiv-care-lib/dqa-reports/case-surveillance/case-surveillance-base/case-surveillance-base.component'; import { CaseSurveillancePatientListComponent } from 'src/app/hiv-care-lib/dqa-reports/case-surveillance/case-surveillance-patient-list/case-surveillance-patient-list.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 = [ { @@ -287,6 +297,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..a6a8ced85 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.css @@ -0,0 +1,8 @@ +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 */ +} 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..fedc228d4 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html @@ -0,0 +1,206 @@ +

+ {{ 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. +
+
+
+
+
+ Ministry Of Health +
+
+ HIV EXPOSED INFANT REGISTER MOH 408 +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Cohort: Month/Year + (MMM-YYYY).........................../.............................................. +
Infant and Mother/Guardian Information + First HIV DNA PCR Test at Birth, 6 weeks or First Contact + Second HIV DNA PCR TestThird HIV DNA PCR TestHEI Outcomes at 12 monthsConfirmatory PCRAntibody test (18 to 24 months)HEI Outcomes at 24 monthsComments
Registration InformationInfant's informationParent's information
Serial No. + Date of Collected enrollment (DD/MM/YYYY) + Birth Certificate NumberHEI ID (MFL-YYYY-NNNN)Infant's NameDOB (DD/MM/YYYY)Sex + Infant Prophylaxis 1=NVP, 2=AZT, 3=NVP &AZT, 4=None, + Father's/Mother's/Guardian's NameAge at Test (in wks) + Type of Test 1=At Birth 2=at 6 weeks 3=at First Contact + Date Sample CollectedAge at Test (in months)Date Sample CollectedAge at Test (in months)Date Sample CollectedInfant Feeding + 1=Infected 2= Uninfected 3=Lost to Follow 4=Transfer Out 5=Dead + Age at Test (in months)Date Sample CollectedAge at Test (in months)Date Sample CollectedInfant Feeding + 1=Infected 2= Uninfected 3=Lost to Follow 4=Transfer Out 5=Dead +
Client Unique Number (NUPI)(M/F)(M/F)Telephone numberTest result (P,N)Test result (P,N)Test result (P,N)BF=Breastfeeding NBF=Not BreastfeedingTest result (P,N)Test result (P,N)BF=Breastfeeding NBF=Not Breastfeeding
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y)
{{a+1}}{{data.date_enrolled}}{{data.Birth_Certificate_number}}{{data.HEI_ID}}{{data.Infant_name}}{{data.birth_date}}Sex{{null}}{{data.parent_name}}{{data.age_in_weeks_on_first_pcr}}{{date_enrolled}}{{data.first_pcr_date}}{{data.age_in_months_on_second_pcr}}{{data.second_pcr_date}}{{data.age_in_months_on_third_pcr}}{{data.third_pcr_date}}Infant Feeding{{data.hei_outcome}}{{data.age_in_months_on_confirm_pcr}}{{data.confirm_pcr_date}}{{data.age_in_months_on_first_antibody}}{{data.first_antibody_date}}{{null}}{{null}}{{null}}
{{data.NUPI}}{{data.gender}}{{data.Phone_Number}}{{data.results_pcr_first_pcr}}{{data.results_pcr_second_pcr}}{{data.results_pcr_third_pcr}}{{data.infant_feeding}}{{data.results_confirm_pcr}}{{data.results_first_antibody}}{{null}}{{null}}
+
+
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..5721caff6 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.ts @@ -0,0 +1,167 @@ +import { Component, OnInit, Output } from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +import { HeiRegisterResourceService } from 'src/app/etl-api/hei-register-resource.service'; +@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 heiRegisterData: 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, + public heiRegisterService: HeiRegisterResourceService + ) { + 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.heiRegisterData = []; + this.getHeiRegisterData(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 getHeiRegisterData(params: any) { + this.isLoading = true; + this.heiRegisterService.getHeiRegister(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 { + console.log('HeiDataSummary: ', data); + this.showInfoMessage = false; + this.columnDefs = data.sectionDefinitions; + this.heiRegisterData = data; + // this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } + + public calculateTotalSummary() { + const totalsRow = []; + if (this.heiRegisterData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.heiRegisterData, (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..e040fcba0 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/registers.component.html @@ -0,0 +1,27 @@ + +

Loading available dashboards ...

+
+ {{ errorMessage }} +
+ 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/etl-api/hei-register-resource.service.ts b/src/app/etl-api/hei-register-resource.service.ts new file mode 100644 index 000000000..9fe930f89 --- /dev/null +++ b/src/app/etl-api/hei-register-resource.service.ts @@ -0,0 +1,58 @@ +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 HeiRegisterResourceService { + public get url(): string { + return this.appSettingsService.getEtlRestbaseurl().trim(); + } + constructor( + public http: HttpClient, + public appSettingsService: AppSettingsService + ) {} + public getHeiRegister(params: any): Observable { + // tslint:disable-next-line: max-line-length + return this.http + .get( + `${this.url}hei-register?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; + }) + ); + } + public getTxNewPatientList(params: any): Observable { + // tslint:disable-next-line: max-line-length + return this.http + .get( + `${this.url}txnew-summary-patient-list?endDate=${params.month}&locationUuids=${params.locationUuids}&indicators=${params.indicators}` + ) + .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/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 587bc2e1b7711aec55d7d2d74e460d38e67578d9 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Fri, 24 May 2024 15:29:39 +0300 Subject: [PATCH 02/50] 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)
+
From 60c7144f056a3d663f24c62f6059927b086a161b Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:34:30 +0300 Subject: [PATCH 03/50] POC-746 added data for HEI --- .../cntdaily-register.component.html | 883 ++---------------- .../cntdaily-register.component.ts | 54 +- .../care-treatment-resource.service.ts | 38 + 3 files changed, 122 insertions(+), 853 deletions(-) create mode 100644 src/app/etl-api/care-treatment-resource.service.ts 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 0dfc1180d..0852fc031 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 @@ -36,7 +36,7 @@

This report is likely to change without warning.

-
+
@@ -177,835 +177,58 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Data element CODE - - - HV03-01 - HV03-02 - HV03-03 - HV03-04 - HV03-05 - HV03-06 - HV03-07 - HV03-08 - HV03-09 - HV03-10 - HV03-11 - HV03-12 - HV03-13 - HV03-14 - HV03-15 - HV03-16 - HV03-17 - HV03-18 - HV03-19 - HV03-20 - HV03-21 - HV03-22 - HV03-23 - HV03-24 - HV03-25 - HV03-26 - HV03-27 - HV03-28 - HV03-29 - HV03-30 - HV03-31 - HV03-32 - HV03-33 - HV03-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) - - - - - - - - - - - - - - - - - - - + + + {{a+1}} + {{data.DATE}} + {{data.National_ID}} + {{data.CCC_Number}} + {{data.Age}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{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 ac6aed7de..69f16c6f9 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 @@ -2,6 +2,7 @@ import { Component, OnInit, Output } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; import * as Moment from 'moment'; +import { CareTreatmentResourceService } from 'src/app/etl-api/care-treatment-resource.service'; @Component({ selector: 'app-cntdaily-register', templateUrl: './cntdaily-register.component.html', @@ -12,7 +13,7 @@ export class CntdailyRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public careTreatmentRegisterData: any = []; public columnDefs: any = []; public reportName = 'Care and Treatment Daily Activity'; public currentView = 'monthly'; @@ -48,7 +49,11 @@ export class CntdailyRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + constructor( + public router: Router, + public route: ActivatedRoute, + public careTreatmentRegisterService: CareTreatmentResourceService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -71,8 +76,8 @@ export class CntdailyRegisterComponent implements OnInit { this.route.parent.parent.params.subscribe((params: any) => { this.storeParamsInUrl(params.location_uuid); }); - this.txnewReportSummaryData = []; - // this.getTxNewReport(this.params); + this.careTreatmentRegisterData = []; + this.getCareTreatmentRegisterData(this.params); } public storeParamsInUrl(param) { @@ -89,31 +94,34 @@ export class CntdailyRegisterComponent 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 getCareTreatmentRegisterData(params: any) { + this.isLoading = true; + this.careTreatmentRegisterService + .getCareTreatmentRegister(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 { + console.log('Care&Treatment', data); + this.showInfoMessage = false; + this.columnDefs = data.sectionDefinitions; + this.careTreatmentRegisterData = data; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } public calculateTotalSummary() { const totalsRow = []; - if (this.txnewReportSummaryData.length > 0) { + if (this.careTreatmentRegisterData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.txnewReportSummaryData, (row) => { + _.each(this.careTreatmentRegisterData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { diff --git a/src/app/etl-api/care-treatment-resource.service.ts b/src/app/etl-api/care-treatment-resource.service.ts new file mode 100644 index 000000000..77e76f6fd --- /dev/null +++ b/src/app/etl-api/care-treatment-resource.service.ts @@ -0,0 +1,38 @@ +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 CareTreatmentResourceService { + public get url(): string { + return this.appSettingsService.getEtlRestbaseurl().trim(); + } + constructor( + public http: HttpClient, + public appSettingsService: AppSettingsService + ) {} + public getCareTreatmentRegister(params: any): Observable { + // tslint:disable-next-line: max-line-length + return this.http + .get( + `${this.url}care-and-treatment-register?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; + }) + ); + } +} From f9883b23c0b69b2a68f3c152b29f85f663ea92f1 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 23 May 2024 09:56:13 +0300 Subject: [PATCH 04/50] POC-737: Development of MOH Registers --- .../cntdaily-register.component.html | 213 ++---------------- .../cntdaily-register.component.ts | 54 ++--- .../hei-register/hei-register.component.html | 184 ++------------- .../hei-register/hei-register.component.ts | 52 ++--- 4 files changed, 78 insertions(+), 425 deletions(-) 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 0852fc031..40a18d212 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,201 +35,20 @@

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)
{{a+1}}{{data.DATE}}{{data.National_ID}}{{data.CCC_Number}}{{data.Age}}
{{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 69f16c6f9..ac6aed7de 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 @@ -2,7 +2,6 @@ import { Component, OnInit, Output } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; import * as Moment from 'moment'; -import { CareTreatmentResourceService } from 'src/app/etl-api/care-treatment-resource.service'; @Component({ selector: 'app-cntdaily-register', templateUrl: './cntdaily-register.component.html', @@ -13,7 +12,7 @@ export class CntdailyRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public careTreatmentRegisterData: any = []; + public txnewReportSummaryData: any = []; public columnDefs: any = []; public reportName = 'Care and Treatment Daily Activity'; public currentView = 'monthly'; @@ -49,11 +48,7 @@ export class CntdailyRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor( - public router: Router, - public route: ActivatedRoute, - public careTreatmentRegisterService: CareTreatmentResourceService - ) { + constructor(public router: Router, public route: ActivatedRoute) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -76,8 +71,8 @@ export class CntdailyRegisterComponent implements OnInit { this.route.parent.parent.params.subscribe((params: any) => { this.storeParamsInUrl(params.location_uuid); }); - this.careTreatmentRegisterData = []; - this.getCareTreatmentRegisterData(this.params); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); } public storeParamsInUrl(param) { @@ -94,34 +89,31 @@ export class CntdailyRegisterComponent implements OnInit { }); } - public getCareTreatmentRegisterData(params: any) { - this.isLoading = true; - this.careTreatmentRegisterService - .getCareTreatmentRegister(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 { - console.log('Care&Treatment', data); - this.showInfoMessage = false; - this.columnDefs = data.sectionDefinitions; - this.careTreatmentRegisterData = data; - this.calculateTotalSummary(); - this.isLoading = false; - this.showDraftReportAlert(this._month); - } - }); - } + // 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.careTreatmentRegisterData.length > 0) { + if (this.txnewReportSummaryData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.careTreatmentRegisterData, (row) => { + _.each(this.txnewReportSummaryData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { 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 fedc228d4..40a18d212 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 @@ -35,172 +35,20 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning.

-
-
-
-
- Ministry Of Health -
-
- HIV EXPOSED INFANT REGISTER MOH 408 -
-
- Ver. July 2023 -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Cohort: Month/Year - (MMM-YYYY).........................../.............................................. -
Infant and Mother/Guardian Information - First HIV DNA PCR Test at Birth, 6 weeks or First Contact - Second HIV DNA PCR TestThird HIV DNA PCR TestHEI Outcomes at 12 monthsConfirmatory PCRAntibody test (18 to 24 months)HEI Outcomes at 24 monthsComments
Registration InformationInfant's informationParent's information
Serial No. - Date of Collected enrollment (DD/MM/YYYY) - Birth Certificate NumberHEI ID (MFL-YYYY-NNNN)Infant's NameDOB (DD/MM/YYYY)Sex - Infant Prophylaxis 1=NVP, 2=AZT, 3=NVP &AZT, 4=None, - Father's/Mother's/Guardian's NameAge at Test (in wks) - Type of Test 1=At Birth 2=at 6 weeks 3=at First Contact - Date Sample CollectedAge at Test (in months)Date Sample CollectedAge at Test (in months)Date Sample CollectedInfant Feeding - 1=Infected 2= Uninfected 3=Lost to Follow 4=Transfer Out 5=Dead - Age at Test (in months)Date Sample CollectedAge at Test (in months)Date Sample CollectedInfant Feeding - 1=Infected 2= Uninfected 3=Lost to Follow 4=Transfer Out 5=Dead -
Client Unique Number (NUPI)(M/F)(M/F)Telephone numberTest result (P,N)Test result (P,N)Test result (P,N)BF=Breastfeeding NBF=Not BreastfeedingTest result (P,N)Test result (P,N)BF=Breastfeeding NBF=Not Breastfeeding
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y)
{{a+1}}{{data.date_enrolled}}{{data.Birth_Certificate_number}}{{data.HEI_ID}}{{data.Infant_name}}{{data.birth_date}}Sex{{null}}{{data.parent_name}}{{data.age_in_weeks_on_first_pcr}}{{date_enrolled}}{{data.first_pcr_date}}{{data.age_in_months_on_second_pcr}}{{data.second_pcr_date}}{{data.age_in_months_on_third_pcr}}{{data.third_pcr_date}}Infant Feeding{{data.hei_outcome}}{{data.age_in_months_on_confirm_pcr}}{{data.confirm_pcr_date}}{{data.age_in_months_on_first_antibody}}{{data.first_antibody_date}}{{null}}{{null}}{{null}}
{{data.NUPI}}{{data.gender}}{{data.Phone_Number}}{{data.results_pcr_first_pcr}}{{data.results_pcr_second_pcr}}{{data.results_pcr_third_pcr}}{{data.infant_feeding}}{{data.results_confirm_pcr}}{{data.results_first_antibody}}{{null}}{{null}}
-
+
+ + + + +
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 5721caff6..2a9de1b47 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 @@ -2,7 +2,6 @@ import { Component, OnInit, Output } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; import * as Moment from 'moment'; -import { HeiRegisterResourceService } from 'src/app/etl-api/hei-register-resource.service'; @Component({ selector: 'app-hei-register', templateUrl: './hei-register.component.html', @@ -13,7 +12,7 @@ export class HeiRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public heiRegisterData: any = []; + public txnewReportSummaryData: any = []; public columnDefs: any = []; public reportName = 'HEI Register'; public currentView = 'monthly'; @@ -49,11 +48,7 @@ export class HeiRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor( - public router: Router, - public route: ActivatedRoute, - public heiRegisterService: HeiRegisterResourceService - ) { + constructor(public router: Router, public route: ActivatedRoute) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -76,8 +71,8 @@ export class HeiRegisterComponent implements OnInit { this.route.parent.parent.params.subscribe((params: any) => { this.storeParamsInUrl(params.location_uuid); }); - this.heiRegisterData = []; - this.getHeiRegisterData(this.params); + this.txnewReportSummaryData = []; + // this.getTxNewReport(this.params); } public storeParamsInUrl(param) { @@ -94,32 +89,31 @@ export class HeiRegisterComponent implements OnInit { }); } - public getHeiRegisterData(params: any) { - this.isLoading = true; - this.heiRegisterService.getHeiRegister(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 { - console.log('HeiDataSummary: ', data); - this.showInfoMessage = false; - this.columnDefs = data.sectionDefinitions; - this.heiRegisterData = data; - // this.calculateTotalSummary(); - this.isLoading = false; - this.showDraftReportAlert(this._month); - } - }); - } + // 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.heiRegisterData.length > 0) { + if (this.txnewReportSummaryData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.heiRegisterData, (row) => { + _.each(this.txnewReportSummaryData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { From fbb8db84475a13aedd51269bb9216ea518095aee Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Mon, 27 May 2024 12:24:25 +0300 Subject: [PATCH 05/50] POC-745: MOH 267 PrEP Daily Activity Register --- .../cntdaily-register.component.html | 54 --- .../prepdaily-register.component.css | 14 + .../prepdaily-register.component.html | 372 +++++++++++++++++- 3 files changed, 370 insertions(+), 70 deletions(-) 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..e69de29bb 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 @@ -1,54 +0,0 @@ -

- {{ 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.css b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.css index e69de29bb..7d7e743ba 100644 --- 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 @@ -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/prepdaily-register/prepdaily-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.html index 40a18d212..70eaf9048 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 @@ -35,20 +35,360 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning.

-
- - - - - + +
+ × +

+ 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. +
+ +
+
+
+
+ Ministry Of Health +
+
+ MOH 267 PrEP Daily Activity Register +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PrEP NoDate of VisitNational Identification NumberAge + Sex
+ (M/F) +
+ Population type
+ (Use the codes):
+ 1. General Population
+ 2. Discordant Couple
+ 3. MSM/MSW
+ 4. FSW
+ 5. PWID/PWUD
+ 6. VP +
+ Client PrEP Status:
+ N- New
+ C- Continuing
+ D-Discontinued
+ R-Restart +
+ PrEP Method:
+ 1. Daily oral PrEP
+ 2. Event driven oral PrEP
+ 3. Dapivirine Vaginal ring
+ 4. Cabotegravir Injectable +
+ HIV Results
+ (N/P/Ic/NA) +
+ Diagnosed with
+ STI
+ (N/Y) +
Remarks
National Unique Patient Identifier (NUPI)
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)
TOTAL this Page
TOTAL this Month
+
From b3a99abb58b76da403477d424373ba56dc5bc191 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 6 Jun 2024 10:11:21 +0300 Subject: [PATCH 06/50] Added data --- .../prepdaily-register.component.html | 303 ++++-------------- .../prepdaily-register.component.ts | 107 ++++--- .../registers-resource.service.spec.ts | 18 ++ src/app/etl-api/registers-resource.service.ts | 38 +++ 4 files changed, 171 insertions(+), 295 deletions(-) create mode 100644 src/app/etl-api/registers-resource.service.spec.ts create mode 100644 src/app/etl-api/registers-resource.service.ts 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 70eaf9048..11909e88a 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 @@ -51,7 +51,24 @@

This report is likely to change without warning.

-
+
+ +
+
+
@@ -69,7 +86,9 @@

PrEP No Date of Visit - National Identification Number + + National Identification Number + Age Sex
@@ -111,7 +130,9 @@

Remarks - National Unique Patient Identifier (NUPI) + + National Unique Patient Identifier (NUPI) + (a) @@ -128,185 +149,43 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + {{ data.PrEP_Number }} + + + {{ transformDate(data.Date_Of_Visit) }} + + {{ data.National_ID }} + {{ data.Age }} + {{ data.Sex }} + + {{ data.population_type }} + + + {{ data.client_prep_status }} + + + {{ data.prep_method }} + + + {{ data.HIV_result }} + + + {{ data.with_STI }} + + + {{ data.remarks }} + + + + {{ data.NUPI }} + + TOTAL this Page - + {{ prepRegisterData.length }} @@ -317,7 +196,7 @@

TOTAL this Month - + {{ prepRegisterData.length }} @@ -326,68 +205,6 @@

-

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 index c982e94bd..90cab6a0c 100644 --- 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 @@ -1,7 +1,19 @@ -import { Component, OnInit, Output } from '@angular/core'; +import { DatePipe } from '@angular/common'; +import { + Component, + OnInit, + Output, + Input, + OnDestroy, + ViewChild, + ElementRef +} from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; import * as Moment from 'moment'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; @Component({ selector: 'app-prepdaily-register', templateUrl: './prepdaily-register.component.html', @@ -12,7 +24,7 @@ export class PrepdailyRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public prepRegisterData: any = []; public columnDefs: any = []; public reportName = 'PrEP Daily Activity Register'; public currentView = 'monthly'; @@ -32,6 +44,7 @@ export class PrepdailyRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + @ViewChild('prepcontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; public get locationUuids(): Array { @@ -48,7 +61,12 @@ export class PrepdailyRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + constructor( + public router: Router, + public route: ActivatedRoute, + public register: RegistersResourceService, + private datePipe: DatePipe + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -71,8 +89,8 @@ export class PrepdailyRegisterComponent implements OnInit { this.route.parent.parent.params.subscribe((params: any) => { this.storeParamsInUrl(params.location_uuid); }); - this.txnewReportSummaryData = []; - // this.getTxNewReport(this.params); + this.prepRegisterData = []; + this.getPrEPRegisterReport(this.params); } public storeParamsInUrl(param) { @@ -89,54 +107,22 @@ export class PrepdailyRegisterComponent 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 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 getPrEPRegisterReport(params: any) { + this.isLoading = true; + this.register.getPrEPRegisterReport(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.prepRegisterData = data; + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); } + public onIndicatorSelected(value) { this.router.navigate(['patient-list'], { relativeTo: this.route, @@ -158,4 +144,21 @@ export class PrepdailyRegisterComponent implements OnInit { 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 267 PrEP Daily Activity Register.pdf'); + }); + } } diff --git a/src/app/etl-api/registers-resource.service.spec.ts b/src/app/etl-api/registers-resource.service.spec.ts new file mode 100644 index 000000000..35c519fe1 --- /dev/null +++ b/src/app/etl-api/registers-resource.service.spec.ts @@ -0,0 +1,18 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { RegistersResourceService } from './registers-resource.service'; + +describe('RegistersResourceService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [RegistersResourceService] + }); + }); + + it('should be created', inject( + [RegistersResourceService], + (service: RegistersResourceService) => { + expect(service).toBeTruthy(); + } + )); +}); diff --git a/src/app/etl-api/registers-resource.service.ts b/src/app/etl-api/registers-resource.service.ts new file mode 100644 index 000000000..140bb39e9 --- /dev/null +++ b/src/app/etl-api/registers-resource.service.ts @@ -0,0 +1,38 @@ +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 RegistersResourceService { + public get url(): string { + return this.appSettingsService.getEtlRestbaseurl().trim(); + } + constructor( + public http: HttpClient, + 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}` + ) + .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; + }) + ); + } +} From 8b4a90bb6851641efa82907a4f3cb63d7e6637d1 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 2 May 2024 16:22:17 +0300 Subject: [PATCH 07/50] Initial MOH731 template --- .../moh-731-report-pdf-view.component.html | 382 +++++++++++++++++- 1 file changed, 380 insertions(+), 2 deletions(-) diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html index e62f3113b..21fc3e2e7 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html @@ -20,7 +20,7 @@
- - + --> + + +
+
+ Ministry of Health +
+
+ Ver. July 2023 +
+
+
+ National AIDS & STI Control Program - NASCOP + MOH 731-Ver. July 2023
+ Comprehensive HIV/AIDS reporting form +
+
+
+ County________________________Sub County__________________________Facility______________________MFL_________Month_______Year__________ +
+
+
+
+
+ 1. HIV Testing Services & Pre exposure Prophylaxis +
+
+
+
+
+ 1.1 HIV Tests +
+
+
+
+ Male +
+
+ Female(including PMTCT) +
+
+ Tests +
+
+ HV01-01 +
+
+ HV01-02 +
+
+
+
+ Tests-Facility +
+
+ HV01-03 +
+
+ Tests-Community +
+
+ HV01-04 +
+
+
+
+ Tested KVP +
+
+ HV01-05 +
+
+
+
+ 1.2 HIV Positive Results +
+
+
+
+ Male +
+
+ Female(including PMTCT) +
+
+
+
+ Positive_2-9 +
+
+ HV01-06 +
+
+ HV01-07 +
+
+ Positive_10-14 +
+
+ HV01-08 +
+
+ HV01-09 +
+
+ Positive_15-19 +
+
+ HV01-10 +
+
+ HV01-11 +
+
+ Positive_20-24 +
+
+ HV01-12 +
+
+ HV01-13 +
+
+ Positive_25+ +
+
+ HV01-14 +
+
+ HV01-15 +
+
+ Positive_KVP +
+
+ HV01-16 +
+
+
+
+ Discordant +
+
+ HV01-17 +
+
+ HV01-18 +
+
+
+
+ 1.3 No. Seroconverted while on PrEP +
+
+
+
+ Male +
+
+ Female +
+
+
+
+ HIV Positive +
+
+ HV01-19 +
+
+ HV01-20 +
+
+
+
+
+
+ 1.4 No. Initiated on PrEP(NEW) +
+
+
+
+ Male +
+
+ Female +
+
+
+
+ General popn +
+
+ HV01-21 +
+
+ HV01-22 +
+
+ MSM/MSW +
+
+ HV01-23 +
+
+ PSW +
+
+ HV01-24 +
+
+ PWID/PWUD +
+
+ HV01-25 +
+
+ HV01-26 +
+
+ Discordant Couple +
+
+ HV01-27 +
+
+ HV01-28 +
+
+ Vulnerable Pop +
+
+ HV01-29 +
+
+ HV01-30 +
+
+ AYP (15-24yrs) +
+
+ HV01-31 +
+
+ HV01-32 +
+
+ Pregnant and breastfeeding women +
+
+ HV01-33 +
+
+
+
+ 1.5 No. on Prep Diagnosed with STI +
+
+
+
+ Male +
+
+ Female +
+
+
+
+ General popn +
+
+ HV01-34 +
+
+ HV01-35 +
+
+ MSM/MSW +
+
+ HV01-36 +
+
+ PSW +
+
+ HV01-37 +
+
+ PWID/PWUD +
+
+ HV01-38 +
+
+ HV01-39 +
+
+ Discordant Couple +
+
+ HV01-40 +
+
+ HV01-41 +
+
+ Vulnerable Pop +
+
+ HV01-42 +
+
+ HV01-43 +
+
+ AYP (15-24yrs) +
+
+ HV01-44 +
+
+ HV01-45 +
+
+
+
+
+
+
+ 2. Elimination of Mother-To-Child Transmission(EMTCT) +
+
+ sdfghjk +
+
+ 3. HIV and TB Treatment +
+
+
+
+
+
+ sdfghjk +
+
+ sdfghjk +
+
+ sdfghjk +
+
+
+
+
+
+ kdthfjklh +
+
+ 4. Medical Male Circumcision +
+
+ sdfghjk +
+
+ 5. Post Exposure Prophylaxis +
+
+ sdfghjk +
+
+ +
+
+
+
+ + +
5. Post Exposure Prophylaxis
- sdfghjk +
+
+ Exposed_Occupational +
+
+ HV05-01 + +
+
+ Exposed_Other +
+
+ HV05-02 + +
+
+
+
+ PEP_Occupational +
+
+ HV05-03 + +
+
+ PEP_Other +
+
+ HV05-04 + +
+
From 7915583882bb607768cd8ce7d1bf4f910c4c3194 Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Fri, 3 May 2024 17:27:45 +0300 Subject: [PATCH 10/50] MOH-731 added section 4.3 --- .../moh-731-report-pdf-view.component.html | 76 ++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html index 36f8fceee..f7108aa41 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html @@ -1253,7 +1253,81 @@ 4. Medical Male Circumcision
- sdfghjk +
+ 4.3 Circumcision Adverse Events +
+
+
+ AE_During_Moderate +
+
+ HV04-09 + +
+
+ AE_During_Severe +
+
+ HV04-10 + +
+
+ IAE_Post_Moderate +
+
+ HV04-11 + +
+
+ AE_Post_Severe +
+
+ HV04-12 + +
+
+ Follow up visit less than 14d +
+
+ HV04-13 + +
+
+
Date: Mon, 6 May 2024 12:51:33 +0300 Subject: [PATCH 11/50] Updated MOH template --- .../moh-731-report-pdf-view.component.html | 952 +++++++++++++++--- 1 file changed, 818 insertions(+), 134 deletions(-) diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html index f7108aa41..1153a53f1 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html @@ -110,13 +110,13 @@
HV01-01 -
HV01-02 -
@@ -127,7 +127,7 @@
HV01-03 -
@@ -138,7 +138,7 @@ >HV01-04 HV01-05 -
@@ -177,13 +177,13 @@
HV01-06 -
HV01-07 -
@@ -194,7 +194,7 @@ >HV01-08 HV01-09 HV01-10 HV01-11 HV01-12 HV01-13 HV01-14 HV01-15 HV01-16 HV01-17 -
HV01-18 -
@@ -347,13 +347,13 @@
HV01-19 -
HV01-20 -
@@ -379,13 +379,13 @@
HV01-21 -
HV01-22 -
@@ -396,7 +396,7 @@ >HV01-23 HV01-24 -
@@ -418,7 +418,7 @@
HV01-25 -
@@ -426,7 +426,7 @@ >HV01-26 HV01-27 HV01-28 HV01-29 HV01-30 HV01-31 HV01-32 HV01-33 HV01-34 -
HV01-35 -
@@ -567,7 +567,7 @@ >HV01-36 HV01-37 -
@@ -589,7 +589,7 @@
HV01-38 -
@@ -597,7 +597,7 @@ >HV01-39 HV01-40 HV01-41 HV01-42 HV01-43 HV01-44 HV01-45 HV02-01 -
@@ -740,13 +740,13 @@
HV02-02 -
HV02-03 -
@@ -757,7 +757,7 @@ >HV02-04 HV02-05 HV02-06 HV02-07 HV02-08 HV02-09 HV02-10 -
@@ -853,7 +853,7 @@ >HV02-11 HV02-12 HV02-13 HV02-14 -
@@ -913,7 +913,7 @@ >HV02-15 HV02-16 HV02-17 HV02-18 HV02-19 -
@@ -990,7 +990,7 @@ >HV02-20 HV02-21 -
HV02-22 -
@@ -1039,7 +1039,7 @@ >HV02-23 HV02-24 HV02-25 HV02-26 HV02-27 HV02-28 HV02-29 -
@@ -1135,7 +1135,7 @@ >HV02-30 HV02-31 HV02-32 -
@@ -1184,7 +1184,7 @@
HV02-33 -
@@ -1195,7 +1195,7 @@ >HV02-34
-
+
- sdfghjk +
+ 3.1 Starting ART +
+
+
+ Start ART_< 1 +
+
+ (M)HV03-01 + +
+
+ (F)HV03-02 + +
+
+ Start ART_1-4 +
+
+ (M)HV03-03 + +
+
+ (F)HV03-04 + +
+
+ Start ART_5-9 +
+
+ (M)HV03-05 + +
+
+ (F)HV03-06 + +
+
+ Start ART_10-14 +
+
+ (M)HV03-07 + +
+
+ (F)HV03-08 + +
+
+ Start ART_15-19 +
+
+ (M)HV03-09 + +
+
+ (F)HV03-10 + +
+
+ Start ART_20-24 +
+
+ (M)HV03-11 + +
+
+ (F)HV03-12 + +
+
+ Start ART_25+ +
+
+ (M)HV03-13 + +
+
+ (F)HV03-14 + +
+
+
+
+ 3.2 Currently on ART([All]) +
+
+
+ Start ART_< 1 +
+
+ (M)HV03-015 + +
+
+ (F)HV03-016 + +
+
+ Start ART_1-4 +
+
+ (M)HV03-017 + +
+
+ (F)HV03-018 + +
+
+ Start ART_5-9 +
+
+ (M)HV03-019 + +
+
+ (F)HV03-020 + +
+
+ Start ART_10-14 +
+
+ (M)HV03-021 + +
+
+ (F)HV03-022 + +
+
+ Start ART_15-19 +
+
+ (M)HV03-023 + +
+
+ (F)HV03-024 + +
+
+ Start ART_20-24 +
+
+ (M)HV03-025 + +
+
+ (F)HV03-026 + +
+
+ Start ART_25+ +
+
+ (M)HV03-027 + +
+
+ (F)HV03-028 + +
+
+
+
+ 3.3 TB Screening +
+
+
+ Screen for TB_< 15 +
+
+ HV03-029 + +
+
+ Screen for TB_15+ +
+
+ HV03-030 + +
+
+
+
+ 3.4 Starting TPT +
+
+
+ Start TPT_< 15 +
+
+ HV03-031 + +
+
+ Start TPT_15+ +
+
+ HV03-032 + +
+
+
+
+ 3.5 Differentiated Service Delivery +
+
+
+ Established +
+
+ HV03-033 + +
+
+ Not Established +
+
+ HV03-034 + +
+
+ Community +
+
+ HV03-035 + +
+
+ Facility +
+
+ HV03-036 + +
+
+
- sdfghjk -
-
- sdfghjk +
+ 3.6 Nutrition and HIV +
+
+
+ Number SAM + +
+
+ 0-59Months +
+
+ HV03-037 + +
+
+ 5-9Years +
+
+ HV03-038 + +
+
+ 10-14Years +
+
+ HV03-039 + +
+
+ 15-19Years +
+
+ HV03-040 + +
+
+ 20+ +
+
+ HV03-041 + +
+
+ Pregnant & Lactating +
+
+ HV03-042 + +
+
+
+
+ Number MAM + +
+
+ 0-59Months +
+
+ HV03-043 + +
+
+ 5-9Years +
+
+ HV03-044 + +
+
+ 10-14Years +
+
+ HV03-045 + +
+
+ 15-19Years +
+
+ HV03-046 + +
+
+ 20+ +
+
+ HV03-047 + +
+
+ Pregnant & Lactating +
+
+ HV03-048 + +
+
+
+
+ Number SAM+ receiving therapeutic foods +
+
+ 0-59Months +
+
+ HV03-049 + +
+
+ 5-9Years +
+
+ HV03-050 + +
+
+ 10-14Years +
+
+ HV03-051 + +
+
+ 15-19Years +
+
+ HV03-052 + +
+
+ 20+ +
+
+ HV03-053 + +
+
+ Pregnant & Lactating +
+
+ HV03-054 + +
+
+
+
+ Number MAM + receiving Supplemental foods +
+
+ 0-59Months +
+
+ HV03-055 + +
+
+ 5-9Years +
+
+ HV03-056 + +
+
+ 10-14Years +
+
+ HV03-057 + +
+
+ 15-19Years +
+
+ HV03-058 + +
+
+ 20+ +
+
+ HV03-059 + +
+
+ Pregnant & Lactating +
+
+ HV03-060 + +
+
+
+
-
+
- kdthfjklh +
+ 3.7 HIV in TB Clinic +
+
+
+ TB cases _New +
+
+ HV03-061 + +
+
+ TB New_Known HIV Positive(KPs) +
+
+ HV03-062 + +
+
+ TB_New HIV Positive +
+
+ HV03-063 + +
+
+ TB_New_Known HIV Positive(KP) +
+
+ HV03-064 + +
+
+ TB New_Start_HAART +
+
+ HV03-065 + +
+
+
4. Medical Male Circumcision
-
- 4.3 Circumcision Adverse Events +
+ 4.1 Number circumcised
- AE_During_Moderate + Circumcised_0-60 days
HV04-09 - HV04-01 +
- AE_During_Severe + Circumcised_61 days-9 yrs
- HV04-10 - HV04-02 +
- IAE_Post_Moderate + Circumcised_10-14
HV04-11 - HV04-03 +
- AE_Post_Severe + Circumcised_15+
HV04-12 - HV04-04 +
+
+
- Follow up visit less than 14d + Tested_ HIV+
HV04-13 - HV04-05 +
+
+ Tested_ HIV- +
+
+ HV04-06 + +
+
+
+ 4.2 Type of circumcision +
+
+
+ Surgical +
+
+ HV04-07 + +
+
+ Devices +
+
+ HV04-08 + +
+
+
+
+ 4.3 Circumcision Adverse Events +
+
+
+ AE_During_Moderate +
+
+ HV04-09 + +
+
+ AE_During_Severe +
+
+ HV04-10 + +
+
+ IAE_Post_Moderate +
+
+ HV04-11 + +
+
+ AE_Post_Severe +
+
+ HV04-12 + +
+
+ Follow up visit less than 14d +
+
+ HV04-13 + +
+
@@ -1339,7 +2023,7 @@ > 5. Post Exposure Prophylaxis
-
+
Exposed_Occupational @@ -1347,7 +2031,7 @@
HV05-01 -
@@ -1358,7 +2042,7 @@ >HV05-02 HV05-03 -
@@ -1384,7 +2068,7 @@ >HV05-04 Date: Wed, 8 May 2024 11:26:25 +0300 Subject: [PATCH 12/50] MOH-731: Updated report --- .../moh-731-report-pdf-view.component.html | 4876 ++++++++++------- .../moh-731-report-pdf-view.component.ts | 57 +- 2 files changed, 2984 insertions(+), 1949 deletions(-) diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html index 1153a53f1..80678a74b 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html @@ -11,7 +11,7 @@
- -
diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.ts b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.ts index 893109337..c452b9af8 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.ts +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.ts @@ -1,5 +1,12 @@ import { take } from 'rxjs/operators'; -import { Component, OnInit, Input, OnDestroy } from '@angular/core'; +import { + Component, + OnInit, + Input, + OnDestroy, + ViewChild, + ElementRef +} from '@angular/core'; import { MOHReportService } from './moh-731-report-pdf-view.service'; import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser'; import { LocationResourceService } from '../../openmrs-api/location-resource.service'; @@ -7,6 +14,8 @@ import * as _ from 'lodash'; import { Subscription, BehaviorSubject } from 'rxjs'; import * as Moment from 'moment'; import { PDFDocumentProxy } from 'ng2-pdf-viewer'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; @Component({ selector: 'moh-731-pdf', templateUrl: 'moh-731-report-pdf-view.component.html' @@ -21,13 +30,18 @@ export class MOHReportComponent implements OnInit, OnDestroy { public errorFlag = false; public subscription: Subscription; public locations = []; + public location: any; + public reportData: any; public sectionDefinitions: any; public mohReports: Array; public previousData: any; public numberOfPages = 0; public _data; + month: string | null = null; + year: string | null = null; public stack = []; + @ViewChild('contentToSnapshot') contentToSnapshot!: ElementRef; @Input() public isAggregated = false; @@ -70,6 +84,19 @@ export class MOHReportComponent implements OnInit, OnDestroy { } } + 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-731.pdf'); + }); + } + public generatePdf(): void { this.resolveLationParams(); } @@ -151,14 +178,40 @@ export class MOHReportComponent implements OnInit, OnDestroy { ); } + public extractMonthAndYear(dateString: string) { + const parts = dateString.split('-'); + if (parts.length === 3) { + const day = parseInt(parts[0], 10); + const month = parseInt(parts[1], 10); + const year = parseInt(parts[2], 10); + + // Creating a Date object to validate the date + const dateObject = new Date(year, month - 1, day); // Month is zero-based + + if (!isNaN(dateObject.getTime())) { + // Date is valid, extract month and year + this.month = dateObject.toLocaleString('default', { month: 'long' }); + this.year = year.toString(); + } else { + // Invalid date + console.error('Invalid date format.'); + } + } else { + // Invalid date format + console.error('Invalid date format.'); + } + } + private moh731Report(reportsData, sectionDefinitions) { if (Array.isArray(reportsData) && reportsData.length > 0) { // tslint:disable-next-line:prefer-for-of // for (let i = 0; i < reportsData.length; i++) { const paramsArray = this.getLocationHeaders(reportsData); + this.location = paramsArray; + this.extractMonthAndYear(paramsArray[0].endDate); const rowsArray = this.getJoinLocations(reportsData); - + this.reportData = reportsData; this.mohReportService .generateMultiplePdfs(paramsArray, rowsArray, sectionDefinitions) .pipe(take(1)) From 9f58a73de8b7ff52ecd76d4b7c8dc89dedc94b12 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Wed, 8 May 2024 19:33:47 +0300 Subject: [PATCH 13/50] Sorted formatting --- .../moh-731-report-pdf-view.component.html | 507 ++++++++++++------ 1 file changed, 345 insertions(+), 162 deletions(-) diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html index 80678a74b..27a108017 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html @@ -49,7 +49,15 @@ >
 National AIDS & STI Control Program - NASCOP National AIDS & STI Control Program - NASCOP HV01-02 HV01-03 HV01-04 HV01-06 HV01-07 HV01-08 HV01-10 HV01-12 HV01-14 HV01-16 HV01-18 HV01-19 HV01-20 HV01-21 HV01-22 HV01-23 {{ reportData[0]?.started_PEP_occupational }} +
+
+ HV01-24 + HV01-25 HV01-27 HV01-29 HV01-31 HV01-33 HV01-35 HV01-36 HV01-38 HV01-40 HV01-42 HV01-44 HV02-01 HV02-02 HV02-03 HV02-04 HV02-06 HV02-08 HV02-10 HV02-11 HV02-13 HV02-15 HV02-17 HV02-19 HV02-20 HV02-22 HV02-23 HV02-25 HV02-27 HV02-29 HV02-30 HV02-32 HV02-33 HV02-34 (F)HV03-02 (M)HV03-03 (M)HV03-05 (M)HV03-07 (M)HV03-09 (M)HV03-11 (M)HV03-13 (M)HV03-015 (F)HV03-016 (M)HV03-017 (M)HV03-019 (M)HV03-021 (M)HV03-023 (M)HV03-025 (M)HV03-027 HV03-029 HV03-030 HV03-032 HV03-034 HV03-036 HV03-038 HV03-040 HV03-042 HV03-044 HV03-046 HV03-048 HV03-050 HV03-052 HV03-054 HV03-056 HV03-058 HV03-060 HV03-062 HV03-064 HV04-01 HV04-02 HV04-04 HV04-06 HV04-08 HV04-10 HV04-12 HV05-01 HV05-02 HV05-04 {{ reportData[0]?.started_PEP_occupational }}0
@@ -156,7 +156,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -175,7 +175,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -193,7 +193,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -212,7 +212,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -244,7 +244,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -258,7 +258,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -276,7 +276,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -291,7 +291,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -309,7 +309,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0
@@ -324,7 +324,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -342,7 +342,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -357,7 +357,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -375,7 +375,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -390,7 +390,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -408,7 +408,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -427,7 +427,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -441,7 +441,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -473,7 +473,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -487,7 +487,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -521,7 +521,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -535,7 +535,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -553,7 +553,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -570,21 +570,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }} - -
- HV01-24 - {{ reportData[0]?.started_PEP_occupational }}0
@@ -616,7 +602,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -634,7 +620,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -649,7 +635,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -667,7 +653,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -682,7 +668,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -700,7 +686,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -715,7 +701,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -733,7 +719,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -765,7 +751,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -779,7 +765,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -797,7 +783,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -814,7 +800,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -846,7 +832,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -864,7 +850,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -879,7 +865,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -897,7 +883,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -912,7 +898,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -930,7 +916,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -945,7 +931,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -992,7 +978,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1020,7 +1006,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1034,7 +1020,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1052,7 +1038,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1067,7 +1053,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1085,7 +1071,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1100,7 +1086,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1118,7 +1104,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1133,7 +1119,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1156,7 +1142,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1174,7 +1160,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1192,7 +1178,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1210,7 +1196,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1233,7 +1219,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1251,7 +1237,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1269,7 +1255,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1287,7 +1273,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}
0
@@ -1305,7 +1291,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1330,7 +1316,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1348,7 +1334,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1384,7 +1370,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1398,7 +1384,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1416,7 +1402,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1431,7 +1417,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1449,7 +1435,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1464,7 +1450,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1482,7 +1468,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1497,7 +1483,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1520,7 +1506,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1538,7 +1524,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1556,7 +1542,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1581,7 +1567,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1602,7 +1588,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1620,7 +1606,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -1671,7 +1657,10 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__0_to_1__started_art + }} @@ -1685,7 +1674,10 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__0_to_1__started_art + }} @@ -1704,7 +1696,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__1_to_9__started_art + }} @@ -1719,7 +1714,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__1_to_9__started_art + }} @@ -1738,7 +1736,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__1_to_9__started_art + }} @@ -1753,7 +1754,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__1_to_9__started_art + }} @@ -1772,7 +1776,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__10_to_14__gender__M__started_art + }} @@ -1787,7 +1794,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__10_to_14__gender__F__started_art + }} @@ -1806,7 +1816,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__15_to_19__gender__M__started_art + }} @@ -1821,7 +1834,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__15_to_19__gender__F__started_art + }} @@ -1840,7 +1856,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__20_to_24__gender__M__started_art + }} @@ -1855,7 +1874,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__20_to_24__gender__F__started_art + }} @@ -1874,7 +1896,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__older_than_24__gender__M__started_art + }} @@ -1889,7 +1914,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__older_than_24__gender__F__started_art + }} @@ -1918,7 +1946,10 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__0_to_1__current_on_art + }} @@ -1932,7 +1963,10 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__0_to_1__current_on_art + }} @@ -1951,7 +1985,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__1_to_9__current_on_art + }} @@ -1966,7 +2003,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__1_to_9__current_on_art + }} @@ -1985,7 +2025,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__1_to_9__current_on_art + }} @@ -2000,7 +2043,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__1_to_9__current_on_art + }} @@ -2019,7 +2065,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__gender__M__age_range__10_to_14__current_on_art + }} @@ -2034,7 +2083,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__gender__F__age_range__10_to_14__current_on_art + }} @@ -2053,7 +2105,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__gender__M__age_range__15_to_19__current_on_art + }} @@ -2068,7 +2123,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__gender__F__age_range__15_to_19__current_on_art + }} @@ -2087,7 +2145,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__gender__M__age_range__20_to_24__current_on_art + }} @@ -2102,7 +2163,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__gender__F__age_range__20_to_24__current_on_art + }} @@ -2121,7 +2185,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__gender__M__age_range__older_than_24__current_on_art + }} @@ -2136,7 +2203,10 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__gender__F__age_range__older_than_24__current_on_art + }} @@ -2159,7 +2229,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2178,7 +2248,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__15_to_19__screened_for_tb + }} @@ -2201,7 +2274,10 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__20_to_24__screened_for_tb + }} @@ -2220,7 +2296,10 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}{{ + reportData[0] + ?.dc__age_range__15_to_19__started_ipt + }} @@ -2243,7 +2322,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2262,7 +2341,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2281,7 +2360,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2300,7 +2379,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2328,7 +2407,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2347,7 +2426,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2366,7 +2445,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2385,7 +2464,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2404,7 +2483,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2423,7 +2502,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2445,7 +2524,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2464,7 +2543,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2483,7 +2562,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2502,7 +2581,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2521,7 +2600,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2540,7 +2619,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2562,7 +2641,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2581,7 +2660,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2600,7 +2679,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2619,7 +2698,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2638,7 +2717,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2657,7 +2736,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2679,7 +2758,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2698,7 +2777,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2717,7 +2796,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2736,7 +2815,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2755,7 +2834,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2774,7 +2853,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2807,7 +2886,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2826,7 +2905,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2845,7 +2924,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2864,7 +2943,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2883,7 +2962,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2918,7 +2997,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2937,7 +3016,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2956,7 +3035,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2975,7 +3054,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -2994,7 +3073,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -3013,7 +3092,7 @@ border-top: none; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -3035,9 +3114,7 @@ display: inline-block; border: 1px solid black; " - >{{ - reportData[0]?.started_PEP_occupational - }}0 @@ -3056,9 +3133,7 @@ border-top: none; border-top: none; " - >{{ - reportData[0]?.started_PEP_occupational - }}0 @@ -3081,9 +3156,7 @@ display: inline-block; border: 1px solid black; " - >{{ - reportData[0]?.started_PEP_occupational - }}0 @@ -3101,9 +3174,7 @@ border: 1px solid black; border-top: none; " - >{{ - reportData[0]?.started_PEP_occupational - }}0 @@ -3121,9 +3192,7 @@ border: 1px solid black; border-top: none; " - >{{ - reportData[0]?.started_PEP_occupational - }}0 @@ -3141,9 +3210,7 @@ border: 1px solid black; border-top: none; " - >{{ - reportData[0]?.started_PEP_occupational - }}0 @@ -3161,9 +3228,7 @@ border: 1px solid black; border-top: none; " - >{{ - reportData[0]?.started_PEP_occupational - }}0 @@ -3196,7 +3261,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -3214,7 +3279,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -3233,7 +3298,7 @@ display: inline-block; border: 1px solid black; " - >{{ reportData[0]?.started_PEP_occupational }}0 @@ -3251,7 +3316,7 @@ border: 1px solid black; border-top: none; " - >{{ reportData[0]?.started_PEP_occupational }}0 From c70dc7abee206b8bd17d03d6a24fe6fa548c4a67 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 9 May 2024 10:51:09 +0300 Subject: [PATCH 15/50] Updated PSW to FSW --- .../moh-731-report/moh-731-report-pdf-view.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html index ab1ea8330..87f17d9f7 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html @@ -558,7 +558,7 @@ >
- PSW + FSW
- PSW + FSW
Date: Tue, 14 May 2024 10:28:15 +0300 Subject: [PATCH 16/50] Sorted formatting --- .../moh-731-report/moh-731-report-pdf-view.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html index 87f17d9f7..ff3af87f5 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-report-pdf-view.component.html @@ -1091,7 +1091,7 @@ >
- Tested at PNC_>=6 weeks + Tested at PNC_> 6 weeks
Date: Thu, 30 May 2024 10:54:13 +0300 Subject: [PATCH 17/50] POC-743: MOH 406 PNC Register. --- .../pnc-register/pnc-register.component.css | 17 + .../pnc-register/pnc-register.component.html | 873 +++++++++++++++++- 2 files changed, 874 insertions(+), 16 deletions(-) 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 index e69de29bb..ab1f08146 100644 --- 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 @@ -0,0 +1,17 @@ +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; +} +th { + min-width: 70px; +} 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 index 40a18d212..6206fb58f 100644 --- 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 @@ -35,20 +35,861 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning.

-
- - - - - + +
+
+
+
+ Ministry Of Health +
+
+ MOH 406 Post Natal Register +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date of visitMaternity HistoryPostpartum VisitVital SignsPostnatal ExaminationsTB screeningHAART & Infant Prophylaxis and Treatment + Cervical Cancer
+ Screening
+ (VIA/VILLI/PAP
+ Smear/ND) +
+ Modern Post
+ Partum Family
+ Planning
+ (Y/N) +
+ Other Maternal
+ Complications +
+ Haematinics
+ (Y/N) +
RefferalsRemarks
+ Date of Visit
+ (dd/mm/yyyy) +
+ PNC Number
+ (New Visit) +
+ PNC Number/NUPI
+ (Revisit) +
+ Full Name(first name, middle and
+ surname) +
+ Date of Birth
+ (dd/mm/yyyy) +
+ County/
+ SubCounty +
Village/Estate/ Landmark + Date of Delivery
+ (dd/mm/yyyy) +
+ Place of
+ Delivery
+ 1)Facility
+ 2) Home
+ 3) BBA +
+ Mode of
+ Delivery
+ 1) SVD
+ 2) CS
+ 3) Breech
+ 4) AVD +
+ Timing
+ Mother +
Timing BabyTempPulse + Blood
+ Pressure +
+ Pallor
+ (Y/N) +
+ Breast
+ 1=normal
+ 2= cracked
+ nipple
+ 3=engorged
+ 4=mastitis +
+ Uterus
+ 1=
+ contracte d
+ 2= not
+ contracte d
+ 3= Others
+ Specify +
+ PPH
+ 1=present
+ 2=Absent +
+ C-Section Site
+ 1=Bleeding
+ 2=Normal
+ 3=Infected
+ 4=Gapping
+ 5=N/A +
+ Lochia
+ 1=Normal
+ 2=Foul
+ smelling
+ 3=Excessi
+ ve +
+ Episiotomy
+ 1=Repaired
+ 2=Gaping
+ 3=Infected
+ 4=Healed
+ 5=N/ +
+ Fistula
+ 1=VVF
+ 2=RVF
+ 3=VVR
+ 4=Non +
+ TB Screening
+ 1: Presumed TB
+ 2: No signs
+ 3: On TB treatment
+ 4: On TPT
+ 5: Not done +
Tested PNCHIV Test 1HIV Test 2HIV Test 3Results in PNC<=6wks>6wks + Results
+ 1=Normal,
+ 2=Suspected,
+ 3= Confirmed,
+ 4= Not done +
+ Counseled
+ Method received +
FromTo + Reasons for
+ referral
+ (specify) +
NUPIAge in YearsTelephone number + 1=no change,
+ 2=10 days to
+ 14 days;
+ 3=4 to 6
+ weeks;
+ 4=4 to 6
+ months +
+ 1=no change,
+ 2=10 days to
+ 14 days;
+ 3=4 to 6
+ weeks;
+ 4=4 to 6
+ months +
+ 1= mild;
+ 2= moderate;
+ 3= severe +
(I/R/ND/KP)Kit Name:Kit Name:Kit Name:<=6wks>6wksInfantMotherInfantMother + 1 = Community Unit
+ 2 = Another Health
+ Facility
+ 3 = Not Applicable +
+ 1 = Community Unit

+ 2 = Another Health
+ Facility
+ 3 = Not Applicable +
Lot No.Lot No.Lot No.(N/P/Ic/NA)(N/P/Ic/NA) + NVP +AZT
+ +CTX
+ or
+ NVP +CTX +
HAART + NVP +AZT
+ +CTX
+ or
+ NVP +CTX +
HAART
Expiry No. / /Expiry No. / /Expiry No. / /(Y/N/NA/R)(Y/N/NA/R)(Y/N/NA/R)(Y/N/NA/R)
(N,P,I,NA)(N,P,I,NA)(N,P,I,NA)
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(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)(ap)
+
From 1b5f6d66c4ed82a388e932c0bef6d87cc7f08853 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 16 May 2024 17:44:12 +0300 Subject: [PATCH 18/50] POC-730: Internal movement form, add Patient type with options Antenatal and Postnatal care programs under PMTCT program and validate --- .../hiv-referrals/hiv-referral.component.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts b/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts index 68507b90b..917ce9b4a 100644 --- a/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts +++ b/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts @@ -223,6 +223,45 @@ export class HivReferralComponent implements OnInit, OnChanges, OnDestroy { program: hivProgram.program.uuid }; } + + // if ( + // hivProgram.program.uuid === Programs.STANDARD_HIV_PROGRAM.uuid && + // this.referredHivProgram.uuid === Programs.ANC_PROGRAM.uuid + // ) { + // } + // if ( + // hivProgram.program.uuid === Programs.STANDARD_HIV_PROGRAM.uuid && + // this.referredHivProgram.uuid === Programs.PNC_PROGRAM.uuid + // ) { + // } + // if ( + // hivProgram.program.uuid === Programs.PNC_PROGRAM.uuid && + // this.referredHivProgram.uuid === Programs.ANC_PROGRAM.uuid + // ) { + // } + // if ( + // hivProgram.program.uuid === Programs.ANC_PROGRAM.uuid && + // this.referredHivProgram.uuid === Programs.PNC_PROGRAM.uuid + // ) { + // } else if ( + // hivProgram.program.uuid === Programs.ANC_PROGRAM.uuid && + // this.referredHivProgram.uuid === Programs.STANDARD_HIV_PROGRAM.uuid + // ) { + // referredToStandard = true; + // } + // else if ( + // hivProgram.program.uuid === Programs.PNC_PROGRAM.uuid && + // this.referredHivProgram.uuid === Programs.STANDARD_HIV_PROGRAM.uuid + // ) { + // referredToStandard = true; + // } else { + // return { + // location: this.referredHivProgram.locationUuid, + // patient: this.patient.uuid, + // dateEnrolled: moment().subtract(1, 'minutes').format(), + // program: hivProgram.program.uuid + // }; + // } } ); // Add the referred program in payload From 55cea12489310150832c158c5b96891d26ae413b Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 16 May 2024 17:51:19 +0300 Subject: [PATCH 19/50] POC-730: Internal movement form, add Patient type with options Antenatal and Postnatal care programs under PMTCT program and validate --- .../hiv-referrals/hiv-referral.component.ts | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts b/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts index 917ce9b4a..68507b90b 100644 --- a/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts +++ b/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts @@ -223,45 +223,6 @@ export class HivReferralComponent implements OnInit, OnChanges, OnDestroy { program: hivProgram.program.uuid }; } - - // if ( - // hivProgram.program.uuid === Programs.STANDARD_HIV_PROGRAM.uuid && - // this.referredHivProgram.uuid === Programs.ANC_PROGRAM.uuid - // ) { - // } - // if ( - // hivProgram.program.uuid === Programs.STANDARD_HIV_PROGRAM.uuid && - // this.referredHivProgram.uuid === Programs.PNC_PROGRAM.uuid - // ) { - // } - // if ( - // hivProgram.program.uuid === Programs.PNC_PROGRAM.uuid && - // this.referredHivProgram.uuid === Programs.ANC_PROGRAM.uuid - // ) { - // } - // if ( - // hivProgram.program.uuid === Programs.ANC_PROGRAM.uuid && - // this.referredHivProgram.uuid === Programs.PNC_PROGRAM.uuid - // ) { - // } else if ( - // hivProgram.program.uuid === Programs.ANC_PROGRAM.uuid && - // this.referredHivProgram.uuid === Programs.STANDARD_HIV_PROGRAM.uuid - // ) { - // referredToStandard = true; - // } - // else if ( - // hivProgram.program.uuid === Programs.PNC_PROGRAM.uuid && - // this.referredHivProgram.uuid === Programs.STANDARD_HIV_PROGRAM.uuid - // ) { - // referredToStandard = true; - // } else { - // return { - // location: this.referredHivProgram.locationUuid, - // patient: this.patient.uuid, - // dateEnrolled: moment().subtract(1, 'minutes').format(), - // program: hivProgram.program.uuid - // }; - // } } ); // Add the referred program in payload From ba7690e69be59ea2040d3fcae51e112cc702ecad Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Tue, 28 May 2024 17:04:01 +0300 Subject: [PATCH 20/50] mch bugfix --- src/app/build-version/build-version.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/build-version/build-version.component.ts b/src/app/build-version/build-version.component.ts index d1f229b80..c60a3b385 100644 --- a/src/app/build-version/build-version.component.ts +++ b/src/app/build-version/build-version.component.ts @@ -8,7 +8,7 @@ import { VERSION } from '../../environments/version'; }) export class BuildVersionComponent implements OnInit { public version: string; - public buildDate: Date; + public buildDate: any; public hash: string; constructor() {} @@ -20,7 +20,7 @@ export class BuildVersionComponent implements OnInit { try { this.version = VERSION.version; this.hash = VERSION.hash; - this.buildDate = new Date(VERSION.buildDate); + this.buildDate = 'Feb 15, 2024, 6:38:55 PM'; // new Date(VERSION.buildDate); } catch (e) {} } } From b17dfbaa42fceb1b468181cad021e895d2f7f42e Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Tue, 28 May 2024 16:37:07 +0300 Subject: [PATCH 21/50] POC-738: Initial commit --- .../anc-register/anc-register.component.css | 17 ++ .../anc-register/anc-register.component.html | 245 ++++++++++++++++-- 2 files changed, 246 insertions(+), 16 deletions(-) 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 index e69de29bb..ab1f08146 100644 --- 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 @@ -0,0 +1,17 @@ +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; +} +th { + min-width: 70px; +} 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 40a18d212..0f942d3e6 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 @@ -35,20 +35,233 @@

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 +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date of visit(New Client) + ANC
+ Number/NUPI
+ (Re Visit) +
+ Number of
+ Visits
+ (1st,2nd,3rd,
+ 4th ….) +
+ Full Name
+ (First, Middle, Surname) +
+ Date of Birth
+ (DD/MM/YYYY) +
Subcounty/ CountyVillage/Estate/ Landmark + Marital Status
+ NM=Never
+ Married/Single
+ MM=Married
+ Monogamous
+ MP=Married
+ Polygamous
+ W=Widowed
+ D=Divorced
+ S=Separated +
ParityGravidae + Date of Last Menstrual
+ Period (LMP) +
Expected Date of Delivery (EDD) + Gestation in
+ Weeks +
+ MUAC
+ 1= Green,
+ 2=Yellow,
+ 3=Red +
Height (cm)Weight (kg)Blood Pressure + Breast Exam
+ 1=normal
+ 2=abnormal +
FGM (Y/N)LaboratoryMaternal HAARTInfant ProphylaxisPartner HIV Testing
ANC NumberAgePhone Number(dd/mm/yyyy)(dd/mm/yyyy) + FGM associated
+ complications:
+ 1=Scarring
+ 2=Keloids
+ 3=Dyspaneuria
+ 4=UTI 5 = NA +
+ Haemoglobin
+ (Level/ ND/NA) +
+ Blood Sugar Testing
+ for Diabetes:
+ 1=RBS< 11.1
+ mmol/L, No
+ Diabetes,
+ 2=RBS>11.1
+ mmol/L, Has
+ Diabetes,
+ 3=No RBS done +
+ Blood group
+ and rhesus
+ (Y/N) +
+ Urinalysis
+ (Y/N) +
+ Type of Test
+ RPR/ VDRL/
+ Duo Test/ NA +
+ Hepatitis B virus
+ Sceening Result
+ (P/N/ND) +
+ TB Screening:
+ Codes (1-5) +
+ N = New on ART.
+ OA = On ART
+ NA = Not
+ Applicable +
+ AN = AZT&NVP
+ A = AZT
+ N = NVP
+ NA +
N/P/KP/NA
NUPI + Test Results
+ (P/N/NA) +
+ Treatment
+ (Y/N/NA) +
+ 1=Presumed TB
+ 2=No Signs
+ 3=On TB
+ Treatment
+ 4=On TPT
+ 5=Not Done +
+ HIV Testing
+ (Initial or Retest,
+ Known Poitive or
+ Revisit) +
HIV Test 1HIV Test 2HIV Test 3HIV Results
(I/R/KP/ND/Rev)Kit NameKit NameKit Name(N/P/Ic/U/N A)
Expiry / /Expiry / /Expiry / /
(N/P/I/NA)(N/P/I/NA)(N/P/I/NA)
+
From 650b04e12769436cf2c7a0cc9e25e0e17c63796c Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Wed, 29 May 2024 12:57:23 +0300 Subject: [PATCH 22/50] POC-738: MOH 405 ANC Register --- .../anc-register/anc-register.component.html | 905 ++++++++++++++++-- 1 file changed, 814 insertions(+), 91 deletions(-) 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 0f942d3e6..2cebf6cec 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 @@ -52,30 +52,30 @@

- - - + + - - - - - - + + - - - + + - - + - - - - - + + + - - - - - - + + + + + + + + + + + + + - - - - - - + + + + + - - - - - - - - - + - - - + + + + + + + + + + - - + - - - - - - - - + + + + + + + - - - - - - + + + + + - - - - + + + - - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date of visit(New Client) + Date of visit(New Client) ANC
Number/NUPI
(Re Visit)
+ Number of
Visits
(1st,2nd,3rd,
4th ….)
+ Full Name
(First, Middle, Surname)
+ Date of Birth
(DD/MM/YYYY)
Subcounty/ CountyVillage/Estate/ Landmark + Subcounty/ CountyVillage/Estate/ Landmark Marital Status
NM=Never
Married/Single
@@ -87,54 +87,52 @@

D=Divorced
S=Separated

ParityGravidae + ParityGravidae Date of Last Menstrual
Period (LMP)
Expected Date of Delivery (EDD) + Expected Date of Delivery (EDD) Gestation in
Weeks
+ MUAC
1= Green,
2=Yellow,
3=Red
Height (cm)Weight (kg)Blood Pressure + Height (cm)Weight (kg)Blood Pressure Breast Exam
1=normal
2=abnormal
FGM (Y/N)LaboratoryMaternal HAARTInfant ProphylaxisPartner HIV TestingFGM (Y/N)LaboratoryMaternal HAARTInfant ProphylaxisPartner HIV TestingOther Conditions and TreatmentDewormingIPT 1-3TT DoseSupplementationLLITNsReferrralsRemarks
ANC NumberAgePhone Number(dd/mm/yyyy)(dd/mm/yyyy) + ANC NumberAgePhone Number(dd/mm/yyyy)(dd/mm/yyyy) FGM associated
complications:
1=Scarring
@@ -142,11 +140,11 @@

3=Dyspaneuria
4=UTI 5 = NA

+ Haemoglobin
(Level/ ND/NA)
+ Blood Sugar Testing
for Diabetes:
1=RBS< 11.1
@@ -157,56 +155,96 @@

Diabetes,
3=No RBS done

+ Blood group
and rhesus
(Y/N)
+ Urinalysis
(Y/N)
+ Type of Test
RPR/ VDRL/
Duo Test/ NA
+ Hepatitis B virus
Sceening Result
(P/N/ND)
+ TB Screening:
Codes (1-5)
+ N = New on ART.
OA = On ART
NA = Not
Applicable
+ AN = AZT&NVP
A = AZT
N = NVP
NA
N/P/KP/NAN/P/KP/NA + 1=Hypertension;
+ 2=Diabetes;
+ 3=Epilepsy;
+ 4=Malaria in Pregnancy;
+ 5=STIs/RTI;
+ 6=Others (Specify)
+ 7=None
+ Record all that apply +
(Y/N/NA)(1,2,3,N,NA) + 1=TT Dose 1st
+ dose 2=2nd dose
+ 3=3rd dose
+ 4=4th dose
+ 5=5th dose
+ NA=None +
+ Given
+ Supplementation
+ 1=Combined IFAs
+ 2=Iron
+ 3=Folate
+ 4=Iron+Folate
+ Separately
+ 5=Calcium +
+ Received
+ LLITNs
+ (Y/N) +
FromTo + Reason for referral
+ (specify) +
NUPI + NUPI Test Results
(P/N/NA)
+ Treatment
(Y/N/NA)
+ 1=Presumed TB
2=No Signs
3=On TB
@@ -214,54 +252,739 @@

4=On TPT
5=Not Done

+ HIV Testing
(Initial or Retest,
Known Poitive or
Revisit)
HIV Test 1HIV Test 2HIV Test 3HIV ResultsHIV Test 1HIV Test 2HIV Test 3HIV ResultsTreatment (Y/N/NA) + 1=From
+ Community Unit
+ 2=Another
+ Health Facility
+ 3=Not Applicable +
+ 1=To Community
+ Unit
+ 2=HIV preventive
+ services
+ 3=Another Health
+ Facility 4=Not
+ Applicable +
(I/R/KP/ND/Rev)Kit NameKit NameKit Name(N/P/Ic/U/N A)(I/R/KP/ND/Rev)Kit NameKit NameKit Name(N/P/Ic/U/N A)
Expiry / /Expiry / /Expiry / /Expiry / /Expiry / /Expiry / /
(N/P/I/NA)(N/P/I/NA)(N/P/I/NA)(N/P/I/NA)(N/P/I/NA)(N/P/I/NA)
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(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)(ap)(aq)(ar)(as)

From 569bf5461bebfb9e214f2a4c07d5d337d81b2142 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Wed, 29 May 2024 14:10:54 +0300 Subject: [PATCH 23/50] POC-738: MOH 405 ANC Register --- .../anc-register/anc-register.component.html | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 2cebf6cec..2eae5cbdc 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 @@ -461,7 +461,7 @@

- + @@ -519,7 +519,7 @@

- + @@ -577,7 +577,7 @@

- + @@ -635,7 +635,7 @@

- + @@ -693,7 +693,7 @@

- + @@ -751,7 +751,7 @@

- + @@ -809,7 +809,7 @@

- + @@ -867,7 +867,7 @@

- + @@ -925,7 +925,7 @@

- + @@ -983,7 +983,7 @@

- + From 9376265f43cfaf8cec9a12c836de9dd9a9e187fa Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 30 May 2024 11:09:49 +0300 Subject: [PATCH 24/50] POC-738: MOH 405 ANC Register --- .../anc-register/anc-register.component.html | 66 +++---------------- 1 file changed, 9 insertions(+), 57 deletions(-) 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 2eae5cbdc..371af8220 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 @@ -391,63 +391,6 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -507,6 +450,7 @@

+ @@ -565,6 +509,7 @@

+ @@ -623,6 +568,7 @@

+ @@ -681,6 +627,7 @@

+ @@ -739,6 +686,7 @@

+ @@ -797,6 +745,7 @@

+ @@ -855,6 +804,7 @@

+ @@ -913,6 +863,7 @@

+ @@ -971,6 +922,7 @@

+ From 781f4956a8d184152f635fdcf9d61537a9a7cada Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Fri, 24 May 2024 15:29:39 +0300 Subject: [PATCH 25/50] POC-746: MOH 366 Care and Treatment Daily Activity --- .../cntdaily-register.component.html | 1012 +++++++++++++++++ 1 file changed, 1012 insertions(+) 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 e69de29bb..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 @@ -0,0 +1,1012 @@ +

+ {{ 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. +
+ +
+
+
+
+ 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)
+
+
From 49cecce055485407787b758b28e0272e037c5f14 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 23 May 2024 15:27:01 +0300 Subject: [PATCH 26/50] POC-739: MOH 408 HIV Exposed Infant Registers --- .../hei-register/hei-register.component.html | 336 +++++++++++++++++- 1 file changed, 320 insertions(+), 16 deletions(-) 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 40a18d212..abed1fc6c 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 @@ -35,20 +35,324 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning. -
- - - - - +
+
+
+
+ Ministry Of Health +
+
+ HIV EXPOSED INFANT REGISTER MOH 408 +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Cohort: Month/Year + (MMM-YYYY).........................../.............................................. +
Infant and Mother/Guardian Information + First HIV DNA PCR Test at Birth, 6 weeks or First Contact + Second HIV DNA PCR TesThird HIV DNA PCR TestHEI Outcomes at 12 monthsConfirmatory PCRAntibody test (18 to 24 months)HEI Outcomes at 24 monthsComments
Registration InformationInfant's informationParent's information
Serial No. + Date of Collected enrollment (DD/MM/YYYY) + HEI ID (MFL-YYYY-NNNN)Infant's NameDOB (DD/MM/YYYY)HeaderSex + Infant Prophylaxis 1=NVP, 2=AZT, 3=NVP &AZT, 4=None, + Father's/Mother's/Guardian's NameAge at Test (in wks) + Type of Test 1=At Birth 2=at 6 weeks 3=at First Contact + Date Sample CollectedAge at Test (in months)Date Sample CollectedAge at Test (in months)Date Sample CollectedInfant Feeding + 1=Infected 2= Uninfected 3=Lost to Follow 4=Transfer Out 5=Dead + Age at Test (in months)Date Sample CollectedAge at Test (in months)Date Sample CollectedInfant Feeding + 1=Infected 2= Uninfected 3=Lost to Follow 4=Transfer Out 5=Dead +
Client Unique Number (NUPI)(M/F)(M/F)Telephone numberTest result (P,N)Test result (P,N)Test result (P,N)BF=Breastfeeding NBF=Not BreastfeedingTest result (P,N)Test result (P,N)BF=Breastfeeding NBF=Not Breastfeeding
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y)
+
From f3756382afa2baa3e59b04e3e8134a2d06d5c74f Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 30 May 2024 14:41:12 +0300 Subject: [PATCH 27/50] POC-741: MOH 333 Maternity Register --- .../maternity-register.component.css | 17 + .../maternity-register.component.html | 1183 ++++++++++++++++- 2 files changed, 1184 insertions(+), 16 deletions(-) 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 index e69de29bb..ab1f08146 100644 --- 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 @@ -0,0 +1,17 @@ +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; +} +th { + min-width: 70px; +} 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 index 40a18d212..8ec57b795 100644 --- 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 @@ -35,20 +35,1171 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning.

-
- - - - - + +
+
+
+
+ Ministry Of Health +
+
+ MOH 333 Maternity Register +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Date of
+ Admission
+ (dd/mm/yyyy) +
Admission number (yyyy-mm-nnnn) + Full Name
+ (First, Middle, surname) +
+ Date of Birth
+ (dd/mm/yyyy) +
+ County/
+ Subcounty +
+ Village/
+ Estate/
+ Land mark +
+ Marital Status
+ 1 = Married
+ 2 = Widowed
+ 3 = Single
+ 4 = Divorced
+ 5 = Separated +
+ Parity
+ (X+Y) +
Gravidae + No. of
+ ANC
+ visits +
+ Date of Last
+ Menstrual
+ Period (LMP)
+ (dd/mm/yyyy) +
+ Estimated Date
+ of Delivery
+ (EDD)
+ (dd/mm/yyyy) +
DiagnosisDelivery + VDRL/
+ RPR
+ Results
+ (Specify
+ 1-VDRL
+ 2-RPR
+ 3-Duo
+ testing) +
Baby + Maternal
+ HAART +
+ Infant
+ Prophylaxis +
+ Partner
+ Tested for
+ HIV +
+ Counselled
+ on infant
+ feeding
+ (Y/N/NA) +
+ Delivery
+ Conducted by
+ (Enter Name) +
+ Birth
+ Notification
+ Number +
DischargeReferralComments
NUPIAgePhone number + Duration of
+ labour
+ (hours) +
+ Date of
+ Delivery
+ (dd/mm/yyyy) +
+ Time of
+ Delivery +
+ Gestation
+ at Birth
+ (wks) +
+ Mode of
+ Delivery
+ 1) SVD
+ 2) CS
+ 3) Breech
+ 4) AVD +
+ No.of babies
+ delivered +
+ Placenta
+ Complete
+ 1=Yes
+ 2=No
+ 3=BBA +
+ Uterotonic
+ given
+ 1=oxytocin
+ 2=Carbetocin
+ 3=Others
+ Specify
+ 4= None +
+ Vaginal
+ Examination
+ 1= Normal
+ 2=Episiotomy
+ 3=Vaginal tear
+ 4=FGM
+ 5=Vaginal warts +
+ Blood
+ loss
+ (mls) +
+ Mother's
+ status after
+ Delivery
+ (Alive/
+ Dead) +
+ Maternal deaths
+ Notified
+ (Y/N/NA) +
+ Delivery
+ Complications
+ 1=A.P.H. (Ante Partum
+ Haemorrhage);
+ 2=P.P.H. (Post Partum
+ Haemorrhage);
+ 3= Eclampsia;
+ 4=Ruptured Uterus;
+ 5=Obstructed labour;
+ 6=Sepsis
+ 7= NA +
+ APGAR
+ Score +
+ Birth
+ Outcome
+ (LB/FSB/
+ MSB) +
+ Birth
+ Weight
+ (grams) +
+ Sex
+ (M/F) +
+ Initiated on
+ BF in
+ < 1hr
+ (Y/N) +
+ TEO
+ given at
+ birth?
+ (Y/N) +
+ Chlorhexidine
+ applied on
+ cord stump
+ (Y/N) +
+ Birth with
+ deformity
+ (Y/N) +
+ Given
+ Vitamin
+ K
+ (Y/N) +
(P/N/ND)HIV Test 1HIV Test 2HIV Test 3 + HIV Result
+ Maternity
+ (N/P/Inc/U/NA) +
+ Start at
+ Maternity +
(Y/N/NA)(Y/N/NA) + Date
+ (dd/mm/yyyy) +
+ Status of
+ Baby
+ A= Alive
+ D= Dead +
FromToReason for referral
+ Date Death
+ notified +
+ Kangaroo
+ Mother
+ Care
+ (Y/N) +
+ 1- congenital
+ syphilis.
+ 2- spina bifida,
+ 3- Hydrocephalus,
+ 4- Talipes +
Kit Name:Kit Name:Kit Name: + Initial/Retest/
+ NA +
(Y/N/NA) + 1= From Community
+ Unit,
+ 2= From Another
+ Health Facility,
+ 3=Not Applicable +
+ 1= To Community
+ Unit,
+ 2=Referred to HIV
+ preventive services
+ 3=Another Health
+ Facility,
+ 4=Not Applicable +
Lot No.Lot No.Lot No.
Expiry / /Expiry / /Expiry / /
(N/P/I/NA)(N/P/I/NA)(N/P/I/NA)
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(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)(ap)(aq)(ar)(as)(at)(au)(av)(aw)(ax)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
From 873a555f53eef61e8df29c9e964d0df14a69d337 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Thu, 30 May 2024 17:41:39 +0300 Subject: [PATCH 28/50] POC-742: MOH 362 HTS Lab Refferal & Linkage Register. --- .../htsrefferallinkage-register.component.css | 17 + ...htsrefferallinkage-register.component.html | 639 +++++++++++++++++- 2 files changed, 640 insertions(+), 16 deletions(-) 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 index e69de29bb..ab1f08146 100644 --- 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 @@ -0,0 +1,17 @@ +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; +} +th { + min-width: 70px; +} 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 index 40a18d212..e5d188bea 100644 --- 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 @@ -35,20 +35,627 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning.

-
- - - - - + +
+
+
+
+ Ministry Of Health +
+
+ MOH 362 HTS LAB, REFERRAL AND LINKAGE REGISTER
+ MOH 362: HTS LAB REGISTER
+
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Serial
+ Number +
+ National
+ Identification
+ Number +
+ Date of visit
+ (DD/MM/YYYY) +
+ Client Name
+ (First, Middle, Last) +
Age + Sex
+ (M/F) +
Telephone Number + Marital
+ Status
+ 1=Married
+ 2=Widowed
+ 3=Single
+ 4=Divorced
+ 5=Separated +
+ Population Type
+ 1. Gen Pop
+ 2. Key and
+ Vulnerable Pop.
+ Codes for KVP
+ - DC
+ - MSM/MSW
+ - FSW
+ - PWID/PWUD
+ - VP +
+ Setting
+ (1=Facility
+ 2=Community) +
HIV Test 1HIV Test 2HIV Test 3 + Final HIV
+ Result +
+ Discordant
+ Couple +
+ Referred for
+ Prevention
+ Services
+ 1. PrEP
+ 2. PEP
+ 3. VMMC
+ 4. PMTCT
+ 5.NA +
+ HTS Provider
+ (Name) +
Remarks
+ National Unique
+ Patient Identifier
+ (NUPI) Number +
Kit Name:Kit Name:Kit Name:(N,P,Ic)(Y/N/NA)
Lot No.Lot No.Lot No.
Expiry Date / /Expiry Date / /Expiry Date / /
(N,P,I)(N,P,I,NA)(N,P,I,NA)
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)
+
+
+
+
+
+
+
+ Ministry Of Health +
+
+ MOH 362 HTS LAB, REFERRAL AND LINKAGE REGISTER
+ REFERRAL AND LINKAGE REGISTER
+
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Serial
+ Number +
+ National Identification
+ Number +
Client NamesTelephone Number + Identification
+ Strategy
+ (VCT/IT/HIVST
+ /SNS) +
Patient referred to + Handed over to:
+ (Indicate Name (upper cell)
+ and Cadre (lower cell) +
+ Date started on
+ ART +
CCC NumberRemarks
+ National Unique
+ Patient Identifier
+ (NUPI) Number +
Residence
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)
Totals Clients Linked
+
From ace9d149959b10dc473681fe2bbe5bbe305fad79 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Fri, 31 May 2024 12:02:31 +0300 Subject: [PATCH 29/50] POC-740: MOH 407 Nutrition Service RegisterMOH 407 Nutrition Service Register --- .../nutrition-register.component.css | 17 + .../nutrition-register.component.html | 784 +++++++++++++++++- 2 files changed, 785 insertions(+), 16 deletions(-) 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 index e69de29bb..ab1f08146 100644 --- 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 @@ -0,0 +1,17 @@ +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; +} +th { + min-width: 70px; +} 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 index 40a18d212..44301cd7a 100644 --- 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 @@ -35,20 +35,772 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning.

-
- - - - - + +
+
+
+
+ Ministry Of Health +
+
+ NUTRITION SERVICE REGISTER MOH 407 +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NO + Date:
+ (dd/mm/yyyy) +
+ National
+ Identification
+ Number +
CCC Number + Patient Names
+ (First/Middle/Last) +
+ Patient visit
+ type:
+ 1=New,
+ 2=Revisit +
+ Residence:
+ Village/Estate +
+ Sex:
+ M=Male,
+ F=Female +
AGE + Pregnant
+ and
+ Lactating
+ (Y/N/NA) +
+ Nutrition assessment
+ 1. Weight for Height (Under 5’s)
+ 2. Weight for Age (Under 5’s)
+ 3. MUAC (6-59months),
+ Pregnant, Lactating, and any
+ other bedridden client.
+ 4. BMI for Age(5-17Years)
+ 5. BMI Kg/m(18+Years) +
+ Nutrition
+ Status
+ (Indicate codes)
+ 1. SAM
+ 2. MAM
+ 3. Mild/At risk 4.
+ Normal
+ 5. Overweight
+ /Obese +
+ Serostatus
+ (N/P/HEI/U) +
+ Comorbidities
+ 1-TB
+ 2-Diabetes
+ 3-Hypertenstion
+ 4-Others specify
+ 5-None +
+ Food
+ Secure
+ 1-Yes
+ 2-No +
Remarks
+ Client Unique
+ Number
+ (NUPI) +
YearsMonths
ABCDEFGHIJKLMN
+
+
+
+
+
+
+
+ Ministry Of Health +
+
+ NUTRITION SERVICE REGISTER MOH 407 +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Client's follow up Register
Clients' DetailsOn Admission + Discharge/Transfer
+ Measurements +
Outcome
week1Week2week3week4week5week6week7week8week9week10week11week12
SNO. + Date:
+ dd/mm/yyyy +
+ National
+ Identification
+ Number +
CCC NumberClient's NameVillage/Estate/LandmarkMobile numberAGE + Sex
+ (M/F) +
+ Type of Admission
+ 1. new-admission
+ 2. relapse
+ 3. returned
+ defaulter +
Pregnant/ lactating (Y/N/NA) + Serostatus
+ (P/N/HEI/U) +
+ Admission
+ Criteria
+ 1. WFH Z-score
+ 2. MUAC
+ 3. BMI
+ for age
+ 4. BMI
+ kg/m2 +
+ Weight
+ (Kg) +
+ Height
+ (cm) +
+ W/H Zscore/BMI For Age/BMIKg/m2 (1-3) + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + Height/Length(cm) + + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + Height/Length(cm) + + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + Height/Length(cm) + + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + Weight(Kg) + Height/Length(cm) + + W/H Zscore/BMI For Age/BMIKg/m2 + MUAC + Nutrition Intervention + + Exit
+ dd/mm/yyyy +
+ Length of stay in days + + Exit Outcome
+ 1-Cured,
+ 2-Defaulter,
+ 3-Non -
+ Respondant,
+ 4-Referral ,
+ 5-Transfer,
+ 6- Death +
+ Client Unique
+ Number
+ (NUPI) +
YearsMonths
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(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)(ap)(aq)(ar)(as)(at)(au)(av)(aw)(ax)(ay)(az)(ba)(bb)(bc)(bd)(be)(bf)(bg)(bh)(bi)(bj)(bk)(bl)(bm)(bn)(bo)(bp)(bq)(br)(bs)(bt)(bu)(bv)(bw)(bx)
+
From 005bb21cb928ed0ffa4d0caa4e8ca11de79c0f9d Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Fri, 31 May 2024 12:08:12 +0300 Subject: [PATCH 30/50] POC-740: MOH 407 Nutrition Service RegisterMOH 407 Nutrition Service Register --- .../nutrition-register.component.html | 664 ++++++++++++++++++ 1 file changed, 664 insertions(+) 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 index 44301cd7a..aa9f35a0b 100644 --- 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 @@ -798,7 +798,671 @@

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 81793ef5cf3eb6aced85ad8c5bc5e95e39e724cd Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Wed, 12 Jun 2024 11:44:22 +0300 Subject: [PATCH 31/50] Updated registers --- .../cntdaily-register.component.html | 901 ++---------------- .../cntdaily-register.component.ts | 107 ++- .../defaultertracing-register.component.css | 14 + .../defaultertracing-register.component.html | 205 +++- .../defaultertracing-register.component.ts | 133 +-- .../hei-register/hei-register.component.html | 307 ++---- .../hei-register/hei-register.component.ts | 104 +- .../prepdaily-register.component.html | 5 +- .../prepdaily-register.component.ts | 27 +- 9 files changed, 621 insertions(+), 1182 deletions(-) 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 0dfc1180d..729a9afb1 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 @@ -36,7 +36,24 @@

This report is likely to change without warning.

-
+
+ +
+
+
@@ -177,836 +194,58 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Data element CODE - - - HV03-01 - HV03-02 - HV03-03 - HV03-04 - HV03-05 - HV03-06 - HV03-07 - HV03-08 - HV03-09 - HV03-10 - HV03-11 - HV03-12 - HV03-13 - HV03-14 - HV03-15 - HV03-16 - HV03-17 - HV03-18 - HV03-19 - HV03-20 - HV03-21 - HV03-22 - HV03-23 - HV03-24 - HV03-25 - HV03-26 - HV03-27 - HV03-28 - HV03-29 - HV03-30 - HV03-31 - HV03-32 - HV03-33 - HV03-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) - - - - - - - - - - - - - - - - - - - + + + {{ a + 1 }} + {{ data.DATE }} + {{ data.National_ID }} + + {{ data.CCC_Number }} + + {{ data.Age }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ data.NUPI }} + +

-
+
\ No newline at end of file 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 ac6aed7de..9b5fe26cd 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 @@ -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 { CareTreatmentResourceService } from 'src/app/etl-api/care-treatment-resource.service'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; @Component({ selector: 'app-cntdaily-register', templateUrl: './cntdaily-register.component.html', @@ -12,7 +23,7 @@ export class CntdailyRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public careTreatmentRegisterData: any = []; public columnDefs: any = []; public reportName = 'Care and Treatment Daily Activity'; public currentView = 'monthly'; @@ -22,6 +33,7 @@ export class CntdailyRegisterComponent implements OnInit { public quarter: string; public eDate: string; public sDate: string; + public jointLocationUuids: string; public statusError = false; public errorMessage = ''; @@ -32,6 +44,7 @@ export class CntdailyRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + @ViewChild('cntdarcontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; public get locationUuids(): Array { @@ -48,7 +61,13 @@ export class CntdailyRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + constructor( + public router: Router, + public route: ActivatedRoute, + public careTreatmentRegisterService: CareTreatmentResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -68,20 +87,26 @@ export class CntdailyRegisterComponent implements OnInit { } 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.careTreatmentRegisterData = []; + this.getCareTreatmentRegisterData(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).endOf('month').format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -89,31 +114,34 @@ export class CntdailyRegisterComponent 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 getCareTreatmentRegisterData(params: any) { + this.isLoading = true; + this.careTreatmentRegisterService + .getCareTreatmentRegister(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 { + console.log('Care&Treatment', data); + this.showInfoMessage = false; + this.columnDefs = data.sectionDefinitions; + this.careTreatmentRegisterData = data; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } public calculateTotalSummary() { const totalsRow = []; - if (this.txnewReportSummaryData.length > 0) { + if (this.careTreatmentRegisterData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.txnewReportSummaryData, (row) => { + _.each(this.careTreatmentRegisterData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { @@ -158,4 +186,21 @@ export class CntdailyRegisterComponent implements OnInit { 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 366 Care and Treatment Daily Activity.pdf'); + }); + } } 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 index e69de29bb..7d7e743ba 100644 --- 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 @@ -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/defaultertracing-register/defaultertracing-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.html index 40a18d212..596aa0a99 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 @@ -35,20 +35,193 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning.

-
- - - - - + +
+ × +

+ 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. +
+ +
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Defaulter Tracing Register
+ Enter all current clients that did not come for their scheduled + appointment +
Section ASection B
Client Tracking InformationDefaulter Tracing Outcomes
(a)(b)(c)(d)(e)(f)(g)(h)(i)
S/No. + Client Identification /
+ Number +
+ Client Name
+ (First,Middle,Last) +
+ Village/Estate/
+ Landmark +
Telephone number + Date of missed
+ appointment +
+ Return to Care/
+ Dead/
+ Transferred/
+ Stopped Treatment/
+ On follow up +
+ Date of outcome
+ (dd/mm/yyyy) +
Remarks
+ Unique Patient
+ Number (NUPI) +
+
+
+
+ No record found
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 83b012c91..c9a90b99e 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 @@ -1,7 +1,20 @@ -import { Component, OnInit, Output } from '@angular/core'; +import { DatePipe } from '@angular/common'; +import { + Component, + OnInit, + Output, + Input, + OnDestroy, + ViewChild, + ElementRef +} from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; import * as Moment from 'moment'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; +import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/services/data-analytics-dashboard.services'; @Component({ selector: 'app-defaultertracing-register', templateUrl: './defaultertracing-register.component.html', @@ -12,7 +25,7 @@ export class DefaultertracingRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public defaulterTracingRegisterData: any = []; public columnDefs: any = []; public reportName = 'Defaulter Tracing Register'; public currentView = 'monthly'; @@ -22,6 +35,7 @@ export class DefaultertracingRegisterComponent implements OnInit { public quarter: string; public eDate: string; public sDate: string; + public jointLocationUuids: string; public statusError = false; public errorMessage = ''; @@ -32,6 +46,9 @@ export class DefaultertracingRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + public generated = false; + @ViewChild('defaulterTracingcontentToSnapshot') + contentToSnapshot!: ElementRef; public _locationUuids: any = []; public get locationUuids(): Array { @@ -48,7 +65,13 @@ export class DefaultertracingRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + constructor( + public router: Router, + public route: ActivatedRoute, + public register: RegistersResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -68,20 +91,27 @@ export class DefaultertracingRegisterComponent implements OnInit { } 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.defaulterTracingRegisterData = []; + this.getPrEPRegisterReport(this.params); + this.generated = true; } - 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).endOf('month').format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -89,54 +119,22 @@ export class DefaultertracingRegisterComponent 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 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 getPrEPRegisterReport(params: any) { + this.isLoading = true; + this.register.getPrEPRegisterReport(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.defaulterTracingRegisterData = data; + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); } + public onIndicatorSelected(value) { this.router.navigate(['patient-list'], { relativeTo: this.route, @@ -158,4 +156,21 @@ export class DefaultertracingRegisterComponent implements OnInit { 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('Defaulter Tracing Register.pdf'); + }); + } } 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 abed1fc6c..8db3480f3 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 @@ -35,7 +35,25 @@

Viewing a Draft Version of the Report for the chosen month. This report is likely to change without warning.

-
+ +
+ +
+
+
@@ -79,10 +97,11 @@

Date of Collected enrollment (DD/MM/YYYY) - HEI ID (MFL-YYYY-NNNN) - Infant's Name - DOB (DD/MM/YYYY) - Header + Birth Certificate
+ Number + HEI ID (MFL-YYYY-NNNN) + Infant's Name + DOB (DD/MM/YYYY) Sex Infant Prophylaxis 1=NVP, 2=AZT, 3=NVP &AZT, 4=None, @@ -152,206 +171,84 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + {{ a + 1 }} + + {{ transformDate(data.date_enrolled) }} + + + {{ data.Birth_Certificate_number }} + + + {{ data.HEI_ID }} + + + {{ data.Infant_name }} + + + {{ transformDate(data.birth_date) }} + + Sex + {{ null }} + {{ data.parent_name }} + + {{ data.age_in_weeks_on_first_pcr }} + + + {{ date_enrolled }} + + {{ transformDate(data.first_pcr_date) }} + + {{ data.age_in_months_on_second_pcr }} + + {{ transformDate(data.second_pcr_date) }} + + {{ data.age_in_months_on_third_pcr }} + + {{ transformDate(data.third_pcr_date) }} + Infant Feeding + + {{ data.hei_outcome }} + + + {{ data.age_in_months_on_confirm_pcr }} + + {{ transformDate(data.confirm_pcr_date) }} + + {{ data.age_in_months_on_first_antibody }} + + + {{ transformDate(data.first_antibody_date) }} + + {{ null }} + {{ null }} + {{ null }} + + + {{ data.NUPI }} + {{ data.gender }} + {{ data.Phone_Number }} + + {{ data.results_pcr_first_pcr }} + + + {{ data.results_pcr_second_pcr }} + + + {{ data.results_pcr_third_pcr }} + + {{ data.infant_feeding }} + + {{ data.results_confirm_pcr }} + + + {{ data.results_first_antibody }} + + {{ null }} + {{ null }} + +

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 2a9de1b47..747442537 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 @@ -1,7 +1,19 @@ -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 { HeiRegisterResourceService } from 'src/app/etl-api/hei-register-resource.service'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; @Component({ selector: 'app-hei-register', templateUrl: './hei-register.component.html', @@ -12,7 +24,7 @@ export class HeiRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public heiRegisterData: any = []; public columnDefs: any = []; public reportName = 'HEI Register'; public currentView = 'monthly'; @@ -22,6 +34,7 @@ export class HeiRegisterComponent implements OnInit { public quarter: string; public eDate: string; public sDate: string; + public jointLocationUuids: string; public statusError = false; public errorMessage = ''; @@ -32,6 +45,7 @@ export class HeiRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + @ViewChild('heicontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; public get locationUuids(): Array { @@ -48,7 +62,13 @@ export class HeiRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + constructor( + public router: Router, + public route: ActivatedRoute, + public heiRegisterService: HeiRegisterResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -68,20 +88,26 @@ export class HeiRegisterComponent implements OnInit { } 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.heiRegisterData = []; + this.getHeiRegisterData(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).endOf('month').format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -89,31 +115,30 @@ export class HeiRegisterComponent 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 getHeiRegisterData(params: any) { + this.isLoading = true; + this.heiRegisterService.getHeiRegister(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.heiRegisterData = data; + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } public calculateTotalSummary() { const totalsRow = []; - if (this.txnewReportSummaryData.length > 0) { + if (this.heiRegisterData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.txnewReportSummaryData, (row) => { + _.each(this.heiRegisterData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { @@ -158,4 +183,21 @@ export class HeiRegisterComponent implements OnInit { 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 408 HIV Exposed Infant Register.pdf'); + }); + } } 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 11909e88a..6172fe377 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 @@ -65,7 +65,7 @@


@@ -209,3 +209,6 @@

+
+ No record found +
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 index 90cab6a0c..7bec31d46 100644 --- 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 @@ -14,6 +14,7 @@ import * as Moment from 'moment'; import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; import * as html2canvas from 'html2canvas'; import * as jsPDF from 'jspdf'; +import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/services/data-analytics-dashboard.services'; @Component({ selector: 'app-prepdaily-register', templateUrl: './prepdaily-register.component.html', @@ -34,6 +35,7 @@ export class PrepdailyRegisterComponent implements OnInit { public quarter: string; public eDate: string; public sDate: string; + public jointLocationUuids: string; public statusError = false; public errorMessage = ''; @@ -44,6 +46,7 @@ export class PrepdailyRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + public generated = false; @ViewChild('prepcontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; @@ -65,7 +68,8 @@ export class PrepdailyRegisterComponent implements OnInit { public router: Router, public route: ActivatedRoute, public register: RegistersResourceService, - private datePipe: DatePipe + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService ) { this.route.queryParams.subscribe((data) => { data.month === undefined @@ -86,20 +90,27 @@ export class PrepdailyRegisterComponent implements OnInit { } 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.prepRegisterData = []; this.getPrEPRegisterReport(this.params); + this.generated = true; } - 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).endOf('month').format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, From 73720ea89f3418a2fc71b68b3737b30f22fce26f Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Wed, 12 Jun 2024 11:52:08 +0300 Subject: [PATCH 32/50] Updated registers --- src/app/build-version/build-version.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/build-version/build-version.component.ts b/src/app/build-version/build-version.component.ts index c60a3b385..d1f229b80 100644 --- a/src/app/build-version/build-version.component.ts +++ b/src/app/build-version/build-version.component.ts @@ -8,7 +8,7 @@ import { VERSION } from '../../environments/version'; }) export class BuildVersionComponent implements OnInit { public version: string; - public buildDate: any; + public buildDate: Date; public hash: string; constructor() {} @@ -20,7 +20,7 @@ export class BuildVersionComponent implements OnInit { try { this.version = VERSION.version; this.hash = VERSION.hash; - this.buildDate = 'Feb 15, 2024, 6:38:55 PM'; // new Date(VERSION.buildDate); + this.buildDate = new Date(VERSION.buildDate); } catch (e) {} } } From e16d27e53a27fccc8798f8e5eaa6fdf43cbd7064 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Wed, 12 Jun 2024 13:06:43 +0300 Subject: [PATCH 33/50] Updated registers --- .../cntdaily-register.component.html | 2 +- .../defaultertracing-register.component.html | 311 +++++++++--------- .../hei-register/hei-register.component.html | 6 +- .../prepdaily-register.component.html | 2 +- 4 files changed, 164 insertions(+), 157 deletions(-) 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 729a9afb1..bea9419a2 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 @@ -248,4 +248,4 @@

-
\ No newline at end of file +
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 596aa0a99..5b49af7a1 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 @@ -67,161 +67,166 @@


-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Defaulter Tracing Register
- Enter all current clients that did not come for their scheduled - appointment -
Section ASection B
Client Tracking InformationDefaulter Tracing Outcomes
(a)(b)(c)(d)(e)(f)(g)(h)(i)
S/No. - Client Identification /
- Number -
- Client Name
- (First,Middle,Last) -
- Village/Estate/
- Landmark -
Telephone number - Date of missed
- appointment -
- Return to Care/
- Dead/
- Transferred/
- Stopped Treatment/
- On follow up -
- Date of outcome
- (dd/mm/yyyy) -
Remarks
- Unique Patient
- Number (NUPI) -
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Defaulter Tracing Register
+ Enter all current clients that did not come for their scheduled + appointment +
Section ASection B
Client Tracking InformationDefaulter Tracing Outcomes
(a)(b)(c)(d)(e)(f)(g)(h)(i)
S/No. + Client Identification /
+ Number +
+ Client Name
+ (First,Middle,Last) +
+ Village/Estate/
+ Landmark +
Telephone number + Date of missed
+ appointment +
+ Return to Care/
+ Dead/
+ Transferred/
+ Stopped Treatment/
+ On follow up +
+ Date of outcome
+ (dd/mm/yyyy) +
Remarks
+ Unique Patient
+ Number (NUPI) +
+
+
+
+ No record found
-
-
- No record found
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 8db3480f3..8f90e37ae 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 @@ -97,8 +97,10 @@

Date of Collected enrollment (DD/MM/YYYY) - Birth Certificate
- Number + + Birth Certificate
+ Number + HEI ID (MFL-YYYY-NNNN) Infant's Name DOB (DD/MM/YYYY) 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 6172fe377..5ff82d48e 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 @@ -210,5 +210,5 @@

- No record found + No record found
From f09f9cbeadb1effe0600962d343d166885260d64 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Fri, 25 Oct 2024 12:30:26 +0300 Subject: [PATCH 34/50] POC-737: Initial commit --- .../anc-register/anc-register.component.html | 674 +++--------------- .../anc-register/anc-register.component.ts | 117 ++- .../cntdaily-register.component.html | 30 +- .../cntdaily-register.component.ts | 13 +- .../defaultertracing-register.component.html | 92 +-- .../defaultertracing-register.component.ts | 19 +- .../hei-register/hei-register.component.html | 10 +- .../hei-register/hei-register.component.ts | 13 +- .../prepdaily-register.component.html | 12 +- .../prepdaily-register.component.ts | 13 +- .../etl-api/anc-register-resource.service.ts | 37 + .../care-treatment-resource.service.ts | 2 +- .../etl-api/hei-register-resource.service.ts | 2 +- src/app/etl-api/registers-resource.service.ts | 22 +- .../report-filters.component.html | 2 +- 15 files changed, 275 insertions(+), 783 deletions(-) create mode 100644 src/app/etl-api/anc-register-resource.service.ts 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 @@
- + Date: Fri, 25 Oct 2024 13:12:44 +0300 Subject: [PATCH 35/50] POC-737: Initial commit --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60ad180a8..665845d9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,4 +48,4 @@ jobs: # - name: Run headless tests # uses: GabrielBB/xvfb-action@v1 # with: - # run: npm run test + # run: npm run test \ No newline at end of file From 5abdcd1604663776027ad296fdbd848dbb33a538 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Fri, 25 Oct 2024 13:15:00 +0300 Subject: [PATCH 36/50] POC-737: Initial commit updated github workflows main.yaml file upload-artifact to version 4 --- .github/workflows/main.yml | 2 +- .../hiv/data-analytics-hiv.module.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 665845d9b..60ad180a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,4 +48,4 @@ jobs: # - name: Run headless tests # uses: GabrielBB/xvfb-action@v1 # with: - # run: npm run test \ No newline at end of file + # run: npm run test 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 d370a3a9e..41cebb599 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 @@ -54,6 +54,8 @@ import { PncRegisterComponent } from './registers/pnc-register/pnc-register.comp 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'; +import { OtzRegisterComponent } from './registers/otz-register/otz-register.component'; +import { Moh731RegisterComponent } from './registers/moh731-register/moh731-register.component'; @NgModule({ imports: [ @@ -117,7 +119,9 @@ import { CntdailyRegisterComponent } from './registers/cntdaily-register/cntdail PncRegisterComponent, DefaultertracingRegisterComponent, PrepdailyRegisterComponent, - CntdailyRegisterComponent + CntdailyRegisterComponent, + OtzRegisterComponent, + Moh731RegisterComponent ], providers: [ DataAnalyticsDashboardService, From 84c25933960fb646ad32b70a606d85e3606544b7 Mon Sep 17 00:00:00 2001 From: Alfred-Mutai Date: Fri, 25 Oct 2024 13:28:40 +0300 Subject: [PATCH 37/50] POC-737: Initial commit --- .../anc-register/anc-register.component.html | 148 ++++++++++-------- .../cntdaily-register.component.html | 18 ++- .../defaultertracing-register.component.html | 34 ++-- .../hei-register/hei-register.component.html | 2 +- 4 files changed, 117 insertions(+), 85 deletions(-) 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 644e6514e..cddb9adfb 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 @@ -359,68 +359,92 @@

(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}} - + + + + {{ 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/cntdaily-register/cntdaily-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.html index 9fa86f769..037df4e32 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 @@ -195,13 +195,15 @@

> {{ a + 1 }} - {{ data.date | date:'dd/MM/yyyy' }} + + {{ data.date | date: 'dd/MM/yyyy' }} + {{ data.national_id_number }} {{ data.ccc_number }} {{ data.age }} - {{data.started_on_art}} + {{ data.started_on_art }} @@ -215,11 +217,11 @@

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

- {{data.dsd_status}} - {{data.dsd_type}} - {{data.remarks}} + {{ data.dsd_status }} + {{ data.dsd_type }} + {{ data.remarks }} {{ data.NUPI }} 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 cfb6026be..267576e6e 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 @@ -147,20 +147,26 @@

- - {{ 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 }} - + + {{ 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/hei-register/hei-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html index 8f305ccc1..b7bd1a5a7 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 @@ -178,7 +178,7 @@

{{ data.Birth_Certificate_number }} - + {{ data.HEI_ID }} From ffe6b89d9fc6d6e0b5f44befd95608736a3877d2 Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 14 May 2025 10:30:36 +0300 Subject: [PATCH 38/50] POC-737: Updated registers --- .../anc-register/anc-register.component.html | 3 +- .../anc-register/anc-register.component.ts | 23 +- .../cntdaily-register.component.html | 235 +++++++++++++++--- .../cntdaily-register.component.ts | 24 +- .../defaultertracing-register.component.html | 4 +- .../defaultertracing-register.component.ts | 23 +- .../hei-register/hei-register.component.html | 3 +- .../hei-register/hei-register.component.ts | 24 +- .../maternity-register.component.html | 3 +- .../maternity-register.component.ts | 24 +- .../prepdaily-register.component.html | 13 +- .../prepdaily-register.component.ts | 27 +- .../etl-api/anc-register-resource.service.ts | 2 +- .../care-treatment-resource.service.ts | 2 +- .../etl-api/hei-register-resource.service.ts | 2 +- src/app/etl-api/registers-resource.service.ts | 4 +- 16 files changed, 357 insertions(+), 59 deletions(-) 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 cddb9adfb..aaaf31c18 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 @@ -12,7 +12,8 @@

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 c90889c56..31628171c 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 @@ -40,7 +40,7 @@ export class AncRegisterComponent implements OnInit { public showInfoMessage = false; public isLoading = false; public reportHead: any; - public enabledControls = 'locationControl,dayControl'; + public enabledControls = 'datesControl, locationControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; @@ -61,6 +61,24 @@ export class AncRegisterComponent implements OnInit { this._locationUuids = locationUuids; } + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + constructor( public router: Router, public route: ActivatedRoute, @@ -103,7 +121,8 @@ export class AncRegisterComponent implements OnInit { public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).format('YYYY-MM-DD') + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, 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 037df4e32..3cd1ffdce 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 @@ -12,7 +12,8 @@

@@ -203,38 +204,206 @@

{{ data.ccc_number }} {{ data.age }} - {{ data.started_on_art }} - - - - - - - - - - - - - - {{ data.screened_for_tb }} - - {{ data.started_on_tpt }} - - {{ data.current_on_art }} - - - - - - - - - - - - - + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.started_on_art }} + + + + + {{ data.screened_for_tb }} + + + + + {{ data.screened_for_tb }} + + + + + {{ data.started_on_tpt }} + + + + + {{ data.started_on_tpt }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + + + + {{ data.current_on_art }} + + {{ data.dsd_status }} {{ data.dsd_type }} {{ data.remarks }} 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 f94ae500f..76fa461a1 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,dayControl'; + public enabledControls = 'datesControl, locationControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; @@ -61,6 +61,24 @@ export class CntdailyRegisterComponent implements OnInit { this._locationUuids = locationUuids; } + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + constructor( public router: Router, public route: ActivatedRoute, @@ -103,7 +121,9 @@ export class CntdailyRegisterComponent implements OnInit { public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).format('YYYY-MM-DD') + month: Moment(this._month).format('YYYY-MM-DD'), + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, 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 267576e6e..5c7c15274 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 @@

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 f7666f45f..7e2df3c06 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,dayControl'; + public enabledControls = 'datesControl, locationControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; @@ -65,6 +65,24 @@ export class DefaultertracingRegisterComponent implements OnInit { this._locationUuids = locationUuids; } + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + constructor( public router: Router, public route: ActivatedRoute, @@ -108,7 +126,8 @@ export class DefaultertracingRegisterComponent implements OnInit { public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).format('YYYY-MM-DD') + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, 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 b7bd1a5a7..537282819 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 @@ -12,7 +12,8 @@

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 06a7aceb8..4425dd303 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,dayControl'; + public enabledControls = 'datesControl, locationControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; @@ -62,6 +62,24 @@ export class HeiRegisterComponent implements OnInit { this._locationUuids = locationUuids; } + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + constructor( public router: Router, public route: ActivatedRoute, @@ -104,7 +122,8 @@ export class HeiRegisterComponent implements OnInit { public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).format('YYYY-MM-DD') + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -122,6 +141,7 @@ export class HeiRegisterComponent implements OnInit { } else { this.showInfoMessage = false; this.columnDefs = data.sectionDefinitions; + console.log('HEI DATA IS: ' + JSON.stringify(data)); this.heiRegisterData = data; this.isLoading = false; this.showDraftReportAlert(this._month); 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 index 8ec57b795..369418be5 100644 --- 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 @@ -11,7 +11,8 @@

{ data.month === undefined @@ -81,7 +99,9 @@ export class MaternityRegisterComponent implements OnInit { _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') + _date: Moment(this._month).format('DD-MM-YYYY'), + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, 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 03028642c..fcf355c8a 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 @@ -10,9 +10,9 @@

@@ -201,6 +201,11 @@

-
- No record found +
+ No record found
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 index 4ef32df74..d7f4e3081 100644 --- 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 @@ -42,11 +42,30 @@ export class PrepdailyRegisterComponent implements OnInit { public showInfoMessage = false; public isLoading = false; public reportHead: any; - public enabledControls = 'locationControl,dayControl'; + public enabledControls = 'datesControl, locationControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; public generated = false; + + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + @ViewChild('prepcontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; @@ -107,7 +126,9 @@ export class PrepdailyRegisterComponent implements OnInit { public storeParamsInUrl() { this.params = { locationUuids: this.jointLocationUuids, - month: Moment(this._month).format('YYYY-MM-DD') + month: Moment(this._month).format('YYYY-MM-DD'), + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -117,6 +138,7 @@ export class PrepdailyRegisterComponent implements OnInit { public getPrEPRegisterReport(params: any) { this.isLoading = true; + console.log('PREP PARAMS ARE: ' + JSON.stringify(params)); this.register.getPrEPRegisterReport(params).subscribe((data) => { if (data.error) { this.showInfoMessage = true; @@ -125,6 +147,7 @@ export class PrepdailyRegisterComponent implements OnInit { } else { this.showInfoMessage = false; this.prepRegisterData = data; + console.log('PREP DATA IS: ' + JSON.stringify(data)); this.isLoading = false; this.showDraftReportAlert(this._month); } diff --git a/src/app/etl-api/anc-register-resource.service.ts b/src/app/etl-api/anc-register-resource.service.ts index 7e966f10a..aa8910e07 100644 --- a/src/app/etl-api/anc-register-resource.service.ts +++ b/src/app/etl-api/anc-register-resource.service.ts @@ -18,7 +18,7 @@ export class ANCRegisterResourceService { public getANCRegisterRegister(params: any): Observable { return this.http .get( - `${this.url}registers/ancregister?endDate=${params.month}&locationUuids=${params.locationUuids}` + `${this.url}registers/ancregister?startDate=${params.startDate}&endDate=${params.endDate}&locationUuids=${params.locationUuids}` ) .pipe( catchError((err: any) => { diff --git a/src/app/etl-api/care-treatment-resource.service.ts b/src/app/etl-api/care-treatment-resource.service.ts index a4708492d..6e251fd2f 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}registers/cntregister?endDate=${params.month}&locationUuids=${params.locationUuids}` + `${this.url}registers/cntregister?startDate=${params.startDate}&endDate=${params.endDate}&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 b16ee1913..b699baef3 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}registers/heiregister?endDate=${params.month}&locationUuids=${params.locationUuids}` + `${this.url}registers/heiregister?startDate=${params.startDate}&endDate=${params.endDate}&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 50b28d775..c8f664c53 100644 --- a/src/app/etl-api/registers-resource.service.ts +++ b/src/app/etl-api/registers-resource.service.ts @@ -18,7 +18,7 @@ export class RegistersResourceService { public getPrEPRegisterReport(params: any): Observable { return this.http .get( - `${this.url}registers/prepregisterdata?month=${params.month}&locationUuids=${params.locationUuids}` + `${this.url}registers/prepregisterdata?month=${params.month}&startDate=${params.startDate}&endDate=${params.endDate}&locationUuids=${params.locationUuids}` ) .pipe( catchError((err: any) => { @@ -37,7 +37,7 @@ export class RegistersResourceService { public getDefaulterTracingRegister(params: any): Observable { return this.http .get( - `${this.url}registers/defaultertracing?month=${params.month}&locationUuids=${params.locationUuids}` + `${this.url}registers/defaultertracing?month=${params.month}&startDate=${params.startDate}&endDate=${params.endDate}&locationUuids=${params.locationUuids}` ) .pipe( catchError((err: any) => { From 41736163e1b0de7988016e78b2825aca3a338444 Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Thu, 15 May 2025 10:51:14 +0300 Subject: [PATCH 39/50] POC-737: MOH Registers --- ...htsrefferallinkage-register.component.html | 464 +++--------------- .../htsrefferallinkage-register.component.ts | 200 ++++++-- .../etl-api/hts-refferal-linkage.service.ts | 38 ++ 3 files changed, 267 insertions(+), 435 deletions(-) create mode 100644 src/app/etl-api/hts-refferal-linkage.service.ts 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 index e5d188bea..37503c28a 100644 --- 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 @@ -11,7 +11,8 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + {{ item.serialNumber }} + {{ item.nupiNumber }} + {{ item.visitDate }} + {{ item.clientName }} + {{ item.age }} + {{ item.sex }} + {{ item.telephoneNumber }} + {{ item.maritalStatus }} + {{ item.populationType }} + {{ item.setting }} + {{ item.hivTest1.kitName }} + {{ item.hivTest2.kitName }} + {{ item.hivTest3.kitName }} + {{ item.finalHivResult }} + {{ item.discordantCouple }} + + {{ item.referredForPrevention }} + + {{ item.htsProvider }} + {{ item.remarks }} + + + {{ item.nationalId }} + {{ item.hivTest1.lotNumber }} + {{ item.hivTest2.lotNumber }} + {{ item.hivTest3.lotNumber }} + + + + {{ item.hivTest1.expiryDate }} + {{ item.hivTest2.expiryDate }} + {{ item.hivTest3.expiryDate }} + + + + {{ item.hivTest1.result }} + {{ item.hivTest2.result }} + {{ item.hivTest3.result }} + +

@@ -495,165 +298,28 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + {{ item.serialNumber }} + {{ item.nupiNumber }} + {{ item.clientName }} + {{ item.telephoneNumber }} + {{ item.identificationStrategy }} + {{ item.patientReferredTo }} + {{ item.handedOverTo }} + {{ item.artStartDate }} + {{ item.cccNumber }} + {{ item.remarks }} + + + {{ item.nationalId }} + {{ item.residence }} + {{ item.cadre }} + + + Totals Clients Linked - + {{ pinnedBottomRowData[0].totalLinked }} 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 index 503ec25fc..dbe08a045 100644 --- 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 @@ -2,6 +2,10 @@ import { Component, OnInit, Output } 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 { HtsrefferallinkageRegisterService } from './htsrefferallinkage-register.service'; +import { HtsReferralLinkageService } from 'src/app/etl-api/hts-refferal-linkage.service'; + @Component({ selector: 'app-htsrefferallinkage-register', templateUrl: './htsrefferallinkage-register.component.html', @@ -12,7 +16,8 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public htsLabData: any; + public htsLinkageData: any; public columnDefs: any = []; public reportName = 'HTS Lab Refferal & Linkage Register'; public currentView = 'monthly'; @@ -22,13 +27,15 @@ export class HtsrefferallinkageRegisterComponent 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,monthControl'; + public enabledControls = 'datesControl, locationControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; @@ -48,7 +55,30 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + + constructor( + public router: Router, + public route: ActivatedRoute, + private htsService: HtsReferralLinkageService, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -67,21 +97,11 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { 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) { + 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, + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -89,31 +109,138 @@ export class HtsrefferallinkageRegisterComponent 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 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(); + }); + this.htsLabData = []; + this.htsLinkageData = []; + this.getHtsReferralLinkageReport(this.params); + // this.generated = true; + } + + public getHtsReferralLinkageReport(params: any) { + this.isLoading = true; + this.htsService.getHtsReferralLinkageReport(params).subscribe( + (data) => { + console.log('HTS RESULTS ARE: ' + JSON.stringify(data)); + console.log('data', data.result); + if (data.error) { + console.log('---error---', data.error); + this.showInfoMessage = true; + this.errorMessage = `There has been an error while loading the report, please retry again`; + this.isLoading = false; + } else { + this.isLoading = false; + this.showInfoMessage = false; + const transformedData = this.transformApiData(data.result); + this.htsLabData = transformedData.htsLabData || []; + this.htsLinkageData = transformedData.htsLinkageData || []; + this.pinnedBottomRowData = transformedData.pinnedBottomRowData || []; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }, + (error) => { + this.showInfoMessage = true; + this.errorMessage = `There has been an error while loading the report, please retry again`; + this.isLoading = false; + } + ); + } + + public transformApiData(apiData: any[]) { + return { + htsLabData: apiData.map((item) => ({ + serialNumber: item.serial_number || '', + nupiNumber: item.nupi || '', + nationalId: item.id_number || '', + visitDate: item.date_of_visit + ? new Date(item.date_of_visit).toISOString().split('T')[0] + : '', + clientName: `${item.first_name || ''} ${item.middle_name || ''} ${ + item.last_name || '' + }`.trim(), + age: item.age || '', + sex: item.sex || '', + telephoneNumber: item.telephone || '', + maritalStatus: '', // Not available in API data + populationType: item.population_type || '', + setting: item.setting || '', + hivTest1: { + kitName: item.kit1_name || '', + lotNumber: item.lot1 || '', + expiryDate: item.expiry1 + ? new Date(item.expiry1).toISOString().split('T')[0] + : '', + result: item.hiv_test1 || '' + }, + hivTest2: { + kitName: item.kit2_name || '', + lotNumber: item.lot2 || '', + expiryDate: item.expiry2 + ? new Date(item.expiry2).toISOString().split('T')[0] + : '', + result: item.hiv_test2 || '' + }, + hivTest3: { + kitName: item.kit3_name || '', + lotNumber: item.lot3 || '', + expiryDate: item.expiry3 + ? new Date(item.expiry3).toISOString().split('T')[0] + : '', + result: item.hiv_test3 || '' + }, + finalHivResult: item.final_result || '', + discordantCouple: '', // Not available in API data + referredForPrevention: item.referral_services || '', + htsProvider: item.hts_provider || '', + remarks: item.initial_remarks || '' + })), + htsLinkageData: apiData.map((item) => ({ + serialNumber: item.serial_number || '', + nupiNumber: item.nupi || '', + nationalId: item.id_number || '', + clientName: `${item.first_name || ''} ${item.middle_name || ''} ${ + item.last_name || '' + }`.trim(), + telephoneNumber: item.telephone || '', + residence: '', // Not available in API data + identificationStrategy: item.client_tested_as || '', + patientReferredTo: item.referral_to || '', + handedOverTo: item.handed_to || '', + cadre: '', // Not available in API data + artStartDate: item.art_start_date + ? new Date(item.art_start_date).toISOString().split('T')[0] + : '', + cccNumber: item.ccc_number || '', + remarks: item.screening_remarks || '' + })), + pinnedBottomRowData: [ + { + totalLinked: apiData.filter((item) => item.art_start_date).length + } + ] + }; + } public calculateTotalSummary() { const totalsRow = []; - if (this.txnewReportSummaryData.length > 0) { + if (this.htsLinkageData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.txnewReportSummaryData, (row) => { + _.each(this.htsLinkageData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { @@ -137,6 +264,7 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { this.pinnedBottomRowData = totalsRow; } } + public onIndicatorSelected(value) { this.router.navigate(['patient-list'], { relativeTo: this.route, diff --git a/src/app/etl-api/hts-refferal-linkage.service.ts b/src/app/etl-api/hts-refferal-linkage.service.ts new file mode 100644 index 000000000..d7a65f6d3 --- /dev/null +++ b/src/app/etl-api/hts-refferal-linkage.service.ts @@ -0,0 +1,38 @@ +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 HtsReferralLinkageService { + public get url(): string { + return this.appSettingsService.getEtlRestbaseurl().trim(); + } + constructor( + public http: HttpClient, + public appSettingsService: AppSettingsService + ) {} + + public getHtsReferralLinkageReport(params: any): Observable { + return this.http + .get( + `${this.url}registers/hts-register?startDate=${params.startDate}&endDate=${params.endDate}&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; + }) + ); + } +} From cd08058e82596e218a250add6288abeec561f6ea Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Thu, 15 May 2025 11:54:26 +0300 Subject: [PATCH 40/50] Combined all registers --- .../htsrefferallinkage-register.component.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 index dbe08a045..b9368f3f3 100644 --- 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 @@ -132,17 +132,14 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { this.isLoading = true; this.htsService.getHtsReferralLinkageReport(params).subscribe( (data) => { - console.log('HTS RESULTS ARE: ' + JSON.stringify(data)); - console.log('data', data.result); if (data.error) { - console.log('---error---', data.error); this.showInfoMessage = true; this.errorMessage = `There has been an error while loading the report, please retry again`; this.isLoading = false; } else { this.isLoading = false; this.showInfoMessage = false; - const transformedData = this.transformApiData(data.result); + const transformedData = this.transformApiData(data); this.htsLabData = transformedData.htsLabData || []; this.htsLinkageData = transformedData.htsLinkageData || []; this.pinnedBottomRowData = transformedData.pinnedBottomRowData || []; From 8916d5619d1b362a9a014d008d2ea131e73a48ae Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Tue, 21 Oct 2025 07:47:30 +0300 Subject: [PATCH 41/50] POC-874: MoH 731 Facility Summary Reporting Tool --- .../moh731-register.component.css | 68 + .../moh731-register.component.html | 1761 +++++++++++++++++ .../moh731-register.component.spec.ts | 24 + .../moh731-register.component.ts | 222 +++ src/app/etl-api/registers-resource.service.ts | 96 + 5 files changed, 2171 insertions(+) create mode 100644 src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.ts diff --git a/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.css b/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.css new file mode 100644 index 000000000..69247e43a --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.css @@ -0,0 +1,68 @@ +.table { + border: 2px solid #000; +} + +.border { + background-color: #f2f2f2; + border-bottom: 2px solid #000; + width: 100%; +} +.border2 { + background-color: #f2f2f2; + border-top: 2px solid #000; + border-bottom: 2px solid #000; + width: 100%; +} + +.border3 { + border-top: 2px solid #000; + border-right: 2px dotted #000; + width: 78.5%; +} + +.flex-column { + display: flex; + flex-direction: column; + margin: 1%; +} + +.flex-row { + display: flex; + justify-content: space-between; +} +.rectangle { + width: 50px; + height: 20px; + border: 2px solid #000; + display: inline-block; + margin-left: 5px; +} +.text-box { + display: flex; + align-items: center; + gap: 8px; +} +.text-box2 { + margin-left: 10px; +} +.space-after { + padding-right: 6vw; +} +.border-right { + border-right: 2px dotted #000; + padding-right: 4vw; +} +.border-left { + border-left: 2px dotted #000; + padding-left: 1vw; +} + +.review-section { + display: grid; + grid-template-columns: repeat(5, 1fr); /* 5 even columns */ + column-gap: 20px; /* space between columns */ + text-align: center; + font-size: 14px; + margin-top: 10px; + font-weight: bold; +} diff --git a/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.html b/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.html new file mode 100644 index 000000000..e2c509a64 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.html @@ -0,0 +1,1761 @@ +

+ {{ reportName }} +

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

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

+

+ {{ errorMessage }} +

+
+
+
+
+ Ministry Of Health +
+
+ Ver. July 2023 +
+
+
+ + + + +
+ National AIDS & STI Control Program- NASCOP
+ Comprehensive HIV/ AIDS reporting form +
+ (MOH 731-Ver. July 2023) +
+
+
+ + + + +
+ County______________________SubCounty___________________Facility___________________MFL_______Month______year______ +
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Reviewed by:
+
Name
+
Designation
+
Signature
+
Date
+ +
+
_______________________________________
+
______________________
+
_____________
+
____________
+
+ +
1. HIV Testing & Pre exposure Prophylaxis
1.1 HIV Tests
MaleFemale(Including PMTCT)
Tests + HV01-01 +
{{ MOH731RegisterData.hiv_male }}
+
+
+ HV01-02 +
{{ MOH731RegisterData.hiv_female }}
+
+
Tests_Facility + HV01-03 +
+ {{ MOH731RegisterData.hiv_setting_facility }} +
+
Tests_Community + HV01-04 +
+ {{ MOH731RegisterData.hiv_setting_community }} +
+
Tested KVP + HV01-05 +
+ {{ MOH731RegisterData.hiv_setting_kvp }} +
+
+ 1.3 No. Initiated on PrEP(NEW) +
MaleFemale
General popn + HV01-19 +
+ {{ MOH731RegisterData.prep_new_male_general_pop }} +
+
+
+ HV01-20 +
+ {{ MOH731RegisterData.prep_new_female_general_pop }} +
+
+
MSM/MSW + HV01-21 +
{{ MOH731RegisterData.prep_new_msm }}
+
FSW +
+ HV01-22 +
+ {{ MOH731RegisterData.prep_new_fsw }} +
+
+
PWID/PWUD + HV01-23 +
+ {{ MOH731RegisterData.prep_new_pwud_male }} +
+
+
+ HV01-24 +
+ {{ MOH731RegisterData.prep_new_pwud_female }} +
+
+
Discordant Couple + HV01-25 +
+ {{ MOH731RegisterData.prep_new_discordant_male }} +
+
+
+ HV01-26 +
+ {{ MOH731RegisterData.prep_new_discordant_female }} +
+
+
Vulnerable Pop. + HV01-27 +
+ {{ MOH731RegisterData.prep_new_vulnerable_male }} +
+
+
+ HV01-28 +
+ {{ MOH731RegisterData.prep_new_vulnerable_female }} +
+
+
AYP (10-24yrs) + HV01-29 +
{{ MOH731RegisterData.prep_new_ayp }}
+
+
+ HV01-30 +
+ {{ MOH731RegisterData.prep_new_ayp }} +
+
+
Pregnant and breastfeeding women +
+ HV01-31 +
+ {{ MOH731RegisterData.prep_new_preg_breastfeeding }} +
+
+
+ 1.5 No. Seroconverted while on PrEP +
MaleFemale
HIV Positive + HV01-45 +
+ {{ MOH731RegisterData.seroconverted_male }} +
+
+
+ HV01-46 +
+ {{ MOH731RegisterData.seroconverted_female }} +
+
+
+ 1.2 HIV Positive Results +
MaleFemale
Positive_2-9 + HV01-06 +
{{ MOH731RegisterData.male_2_9 }}
+
+
+ HV01-07 +
{{ MOH731RegisterData.female_2_9 }}
+
+
Positive_10-14 + HV01-08 +
{{ MOH731RegisterData.male_10_14 }}
+
+
+ HV01-09 +
+ {{ MOH731RegisterData.female_10_14 }} +
+
+
Positive_15-19 + HV01-10 +
{{ MOH731RegisterData.male_15_19 }}
+
+
+ HV01-11 +
+ {{ MOH731RegisterData.female_15_19 }} +
+
+
Positive_20-24 + HV01-12 +
{{ MOH731RegisterData.male_20_24 }}
+
+
+ HV01-13 +
+ {{ MOH731RegisterData.female_20_24 }} +
+
+
Positive_25+ + HV01-14 +
+ {{ MOH731RegisterData.male_25_above }} +
+
+
+ HV01-15 +
+ {{ MOH731RegisterData.female_25_above }} +
+
+
Positive_KVP + HV01-16 +
+
Discordant + HV01-17 +
+
+
+ HV01-18 +
+
+
Inconclusive Test Results + HV01-47 +
+
+
+ HV01-48 +
+
+
+ 1.4 No. on PrEP Diagnosed with STI +
MaleFemale
General popn + HV01-32 +
+ {{ MOH731RegisterData.prep_sti_male_general_pop }} +
+
+
+ HV01-33 +
+ {{ MOH731RegisterData.prep_sti_female_general_pop }} +
+
+
MSM/MSW + HV01-34 +
{{ MOH731RegisterData.prep_sti_msm }}
+
FSW + HV01-35 +
{{ MOH731RegisterData.prep_sti_fsw }}
+
PWID/PWUD + HV01-36 +
+ {{ MOH731RegisterData.prep_sti_pwud_male }} +
+
+
+ HV01-37 +
+ {{ MOH731RegisterData.prep_sti_pwud_female }} +
+
+
Discordant Couple + HV01-38 +
+ {{ MOH731RegisterData.prep_sti_discordant_male }} +
+
+
+ HV01-39 +
+ {{ MOH731RegisterData.prep_sti_discordant_female }} +
+
+
Vulnerable Pop. + HV01-40 +
+ {{ MOH731RegisterData.prep_sti_vulnerable_male }} +
+
+
+ HV01-41 +
+ {{ MOH731RegisterData.prep_sti_vulnerable_female }} +
+
+
AYP(10-24 yrs) + HV01-42 +
{{ MOH731RegisterData.prep_sti_ayp }}
+
+
+ HV01-43 +
+ {{ MOH731RegisterData.prep_sti_ayp }} +
+
+
Pregnant and breastfeeding women +
+ HV01-44 +
+ {{ MOH731RegisterData.prep_sti_preg_breastfeeding }} +
+
+
+ 2. Elimination of Mother-to-Child Transmission(EMTCT) +
+ 2.1 Maternal HIV Testing +
Known Positive at 1st ANC + HV02-01 +
+ {{ MOH731RegisterData.known_positive_1st_anc }} +
+
InitialRetest
Tested at ANC + HV02-02 +
+ {{ MOH731RegisterData.initial_test_anc }} +
+
+
+ HV02-03 +
{{ MOH731RegisterData.retest_anc }}
+
+
Tested at L&D + HV02-04 +
+ {{ MOH731RegisterData.initial_test_LD }} +
+
+
+ HV02-05 +
{{ MOH731RegisterData.retest_LD }}
+
+
Tested at PNC_<=6weeks + HV02-06 +
+ {{ MOH731RegisterData.initial_test_pnc_less_6_weeks }} +
+
+
+ HV02-07 +
+ {{ MOH731RegisterData.retest_pnc_less_6_weeks }} +
+
+
Tested at PNC_>6weeks + HV02-08 +
+ {{ MOH731RegisterData.initial_test_pnc_greater_6_weeks }} +
+
+
+ HV02-09 +
+ {{ MOH731RegisterData.retest_pnc_greater_6_weeks }} +
+
+
+ 2.2 HIV Positive Results +
Tested at ANC + HV02-10 +
{{ MOH731RegisterData.positive_anc }}
+
Tested at L&D + HV02-11 +
{{ MOH731RegisterData.positive_LD }}
+
Tested at PNC_<=6weeks + HV02-12 +
+ {{ MOH731RegisterData.positive_pnc_less_6_weeks }} +
+
Tested at PNC_>6weeks + HV02-13 +
+ {{ MOH731RegisterData.positive_pnc_greater_6_weeks }} +
+
+ 2.3 Maternal HAART +
On HAART at 1st ANC + HV02-14 +
+ {{ MOH731RegisterData.maternal_haart_1st_anc }} +
+
Start HAART_ANC + HV02-15 +
+ {{ MOH731RegisterData.start_maternal_haart_1st_anc }} +
+
Start HAART_L&D + HV02-16 +
+ {{ MOH731RegisterData.start_maternal_haart_LD }} +
+
Start HAART_PNC_< =6weeks + HV02-17 +
+ {{ MOH731RegisterData.maternal_haart_less_6_weeks }} +
+
Start HAART_PNC_>6weeks + HV02-18 +
+ {{ MOH731RegisterData.maternal_haart_more_6_weeks }} +
+
+ 2.4 HBV Screening at ANC +
Screened_HBV_ANC + HV02-19 +
+
HBV Screened_Positive + HV02-20 +
+ {{ MOH731RegisterData.hbv_screened_positive_anc }} +
+
+ 2.5 Adolescents girls & Young Women (10-24 Yrs)
+ testing & results +
10-19yrs20-24yrs
1st ANC KP + HV02-21 +
+ {{ MOH731RegisterData.known_positive_anc_10_19 }} +
+
+
+ HV02-22 +
+ {{ MOH731RegisterData.known_positive_anc_20_24 }} +
+
+
New HIV Positive + HV02-23 +
+ {{ MOH731RegisterData.positive_anc_ld_pnc_10_19 }} +
+
+
+ HV02-24 +
+ {{ MOH731RegisterData.positive_anc_ld_pnc_20_24 }} +
+
+
On HAART 1st ANC KP + HV02-25 +
+ {{ MOH731RegisterData.on_art_anc_10_19 }} +
+
+
+ HV02-26 +
+ {{ MOH731RegisterData.on_art_anc_20_24 }} +
+
+
Started HAART New + HV02-27 +
+ {{ MOH731RegisterData.start_art_10_19 }} +
+
+
+ HV02-28 +
+ {{ MOH731RegisterData.start_art_20_24 }} +
+
+
+ 2.6 Infant Prophylaxis +
Infant ARV Prophylaxis_ANC + HV02-29 +
+ {{ MOH731RegisterData.infant_arv_anc }} +
+
Infant ARV Prophylaxis_L&D + HV02-30 +
+ {{ MOH731RegisterData.infant_arv_ld }} +
+
Infant ARV Prophylaxis_L&PNC + HV02-31 +
+ {{ MOH731RegisterData.infant_arv_pnc }} +
+
+ 2.7 Infant Feeding +
Below 6 months
Exclusive Breastfeeding (EBF) + HV02-32 +
{{ MOH731RegisterData.exclusive_bf }}
+
6 to 24 months
Breastfeeding (BF) + HV02-33 +
{{ MOH731RegisterData.bf }}
+
Not Breastfeeding (NBF) + HV02-34 +
{{ MOH731RegisterData.weaning }}
+
3. HIV and TB treatment
+ 3.1 Starting ART +
Start ART_<1 + (M) HV03-01 +
+ {{ MOH731RegisterData.art_new_less_1_male }} +
+
+
+ (F) HV03-02 +
+ {{ MOH731RegisterData.art_new_less_1_female }} +
+
+
Start ART 1-4 + (M) HV03-03 +
+ {{ MOH731RegisterData.art_new_1_4_male }} +
+
+
+ (F) HV03-04 +
+ {{ MOH731RegisterData.art_new_1_4_female }} +
+
+
Start ART 5-9 + (M) HV03-05 +
+ {{ MOH731RegisterData.art_new_5_9_male }} +
+
+
+ (F) HV03-06 +
+ {{ MOH731RegisterData.art_new_5_9_female }} +
+
+
Start ART 10-14 + (M) HV03-07 +
+ {{ MOH731RegisterData.art_new_10_14_male }} +
+
+
+ (F) HV03-08 +
+ {{ MOH731RegisterData.art_new_10_14_female }} +
+
+
Start ART 15-19 + (M) HV03-09 +
+ {{ MOH731RegisterData.art_new_15_19_male }} +
+
+
+ (F) HV03-10 +
+ {{ MOH731RegisterData.art_new_15_19_female }} +
+
+
Start ART 20-24 + (M) HV03-11 +
+ {{ MOH731RegisterData.art_new_20_24_male }} +
+
+
+ (F) HV03-12 +
+ {{ MOH731RegisterData.art_new_20_24_female }} +
+
+
Start ART 25+ + (M) HV03-013 +
+ {{ MOH731RegisterData.art_new_25_above_male }} +
+
+
+ (F) HV03-014 +
+ {{ MOH731RegisterData.art_new_25_above_female }} +
+
+
+ 3.2 Curently on ART ([ALL]) +
On ART_<1 + (M) HV03-015 +
+ {{ MOH731RegisterData.on_art_less_1_male }} +
+
+
+ (F) HV03-016 +
+ {{ MOH731RegisterData.on_art_less_1_female }} +
+
+
On ART 1-4 + (M) HV03-017 +
+ {{ MOH731RegisterData.on_art_1_4_male }} +
+
+
+ (F) HV03-018 +
+ {{ MOH731RegisterData.on_art_1_4_female }} +
+
+
On ART 5-9 + (M) HV03-019 +
+ {{ MOH731RegisterData.on_art_5_9_male }} +
+
+
+ (F) HV03-020 +
+ {{ MOH731RegisterData.on_art_5_9_female }} +
+
+
On ART 10-14 + (M) HV03-021 +
+ {{ MOH731RegisterData.on_art_10_14_male }} +
+
+
+ (F) HV03-022 +
+ {{ MOH731RegisterData.on_art_10_14_female }} +
+
+
On ART 15-19 + (M) HV03-023 +
+ {{ MOH731RegisterData.on_art_15_19_male }} +
+
+
+ (F) HV03-024 +
+ {{ MOH731RegisterData.on_art_15_19_female }} +
+
+
On ART 20-24 + (M) HV03-025 +
+ {{ MOH731RegisterData.on_art_20_24_male }} +
+
+
+ (F) HV03-026 +
+ {{ MOH731RegisterData.on_art_20_24_female }} +
+
+
On ART 25+ + (M) HV03-027 +
+ {{ MOH731RegisterData.on_art_25_above_male }} +
+
+
+ (F) HV03-028 +
+ {{ MOH731RegisterData.on_art_25_above_female }} +
+
+
+ 3.3 TB Screening +
Screened for TB_<15 + HV03-029 +
+ {{ MOH731RegisterData.screened_tb_less_15 }} +
+
Screened for TB_15+ + HV03-030 +
+ {{ MOH731RegisterData.screened_tb_greater_15 }} +
+
+ 3.4 Starting TPT +
Start TPT_<15 + HV03-031 +
+ {{ MOH731RegisterData.start_tpt_less_15 }} +
+
Start TPT_15+ + HV03-032 +
+ {{ MOH731RegisterData.start_tpt_greater_15 }} +
+
+ 3.5 Differentiated Service Delivery +
Established + HV03-033 +
{{ MOH731RegisterData.established }}
+
Not Established + HV03-034 +
+ {{ MOH731RegisterData.not_established }} +
+
Community + HV03-035 +
{{ MOH731RegisterData.community }}
+
Facility + HV03-036 +
{{ MOH731RegisterData.facility }}
+
+ 3.6 Nutrition and HIV +
Number SAM +
0-5Months + HV03-037 +
+ {{ MOH731RegisterData.has_sam_0_5_months }} +
+
6-59Months + HV03-038 +
+ {{ MOH731RegisterData.has_sam_6_59_months }} +
+
5-9Years + HV03-039 +
+ {{ MOH731RegisterData.has_sam_5_9_years }} +
+
10-17Years + HV03-040 +
+ {{ MOH731RegisterData.has_sam_10_17_years }} +
+
18+Years + HV03-041 +
+ {{ MOH731RegisterData.has_sam_18_and_above_years }} +
+
Pregnant & Lactating + HV03-042 +
+
Number MAM +
0-5Months + HV03-043 +
+ {{ MOH731RegisterData.has_smm_0_5_months }} +
+
6-59Months + HV03-044 +
+ {{ MOH731RegisterData.has_smm_6_59_months }} +
+
5-9Years + HV03-045 +
+ {{ MOH731RegisterData.has_smm_5_9_years }} +
+
10-17Years + HV03-046 +
+ {{ MOH731RegisterData.has_smm_10_17_years }} +
+
18+Years + HV03-047 +
+ {{ MOH731RegisterData.has_smm_18_and_above_years }} +
+
Pregnant & Lactating + HV03-048 +
+
Number SAM + receiving therapeutic foods
0-5Months + HV03-049 +
+ {{ MOH731RegisterData.severe_acute_supp_0_5_months }} +
+
6-59Months + HV03-050 +
+ {{ MOH731RegisterData.severe_acute_supp_6_59_months }} +
+
5-9Years + HV03-051 +
+ {{ MOH731RegisterData.severe_acute_supp_5_9_years }} +
+
10-17Years + HV03-052 +
+ {{ MOH731RegisterData.severe_acute_supp_10_17_years }} +
+
18+Years + HV03-053 +
+ {{ MOH731RegisterData.severe_acute_supp_18_and_above_years }} +
+
Pregnant & Lactating + HV03-054 +
+
Number MAM + receiving Supplimental foods
0-5Months + HV03-055 +
+ {{ MOH731RegisterData.severe_moderate_supp_0_5_months }} +
+
6-59Months + HV03-056 +
+ {{ MOH731RegisterData.severe_moderate_supp_6_59_months }} +
+
5-9Years + HV03-057 +
+ {{ MOH731RegisterData.severe_moderate_supp_5_9_years }} +
+
10-17Years + HV03-058 +
+ {{ MOH731RegisterData.severe_moderate_supp_10_17_years }} +
+
18+Years + HV03-059 +
+ {{ MOH731RegisterData.severe_moderate_supp_18_and_above_years }} +
+
Pregnant & Lactating + HV03-060 +
+
+ 3.7 HIV in TB Clinic +
TB cases_New + HV03-061 +
{{ MOH731RegisterData.start_tb }}
+
+ TB_New_Known HIV
+ Positive(KPs) +
+ HV03-062 +
+ {{ MOH731RegisterData.start_tb_known_positive }} +
+
TB_New HIV Positive + HV03-063 +
+ {{ MOH731RegisterData.start_tb_positive }} +
+
+ TB_New_Known HIV
+ Positive(KP) on HAART +
+ HV03-064 +
+ {{ MOH731RegisterData.start_tb_on_art }} +
+
TB New_Start_HAART + HV03-065 +
+ {{ MOH731RegisterData.start_tb_art_new }} +
+
4. Medical Male Circumcision
+ 4.1 Number circumcised +
Circumcised_0-60 days + HV04-01 +
+
Circumcised_61 days -9 yrs days + HV04-02 +
+
Circumcised_10-14 + HV04-03 +
+
Circumcised_15 + + HV04-04 +
+
Tested_ HIV+ + HV04-05 +
+
Tested_ HIV- + HV04-06 +
+
+ 4.2 Type of circumcission +
Surgical + HV04-07 +
+
Devices + HV04-08 +
+
+ 4.3 Circumcission Adverse Events +
AE_During_Moderate + HV04-09 +
+
AE_During_Severe + HV04-10 +
+
AE_Post_Moderate + HV04-11 +
+
AE_Post_Severe + HV04-12 +
+
Follow up visit < 14d + HV04-13 +
+
5. Post Exposure Prophylaxis
Exposed_Occupational + HV05-01 +
+ {{ MOH731RegisterData.exposed_occupational }} +
+
Exposed Other + HV05-02 +
+ {{ MOH731RegisterData.exposed_non_occupational }} +
+
PEP_Occupational + HV05-03 +
+ {{ MOH731RegisterData.pep_occupational }} +
+
PEP_Other + HV05-04 +
+ {{ MOH731RegisterData.pep_non_occupational }} +
+
+
diff --git a/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.spec.ts new file mode 100644 index 000000000..4d7cbbea4 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Moh731RegisterComponent } from './moh731-register.component'; + +describe('Moh731RegisterComponent', () => { + let component: Moh731RegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [Moh731RegisterComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(Moh731RegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.ts b/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.ts new file mode 100644 index 000000000..6d150761c --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/moh731-register/moh731-register.component.ts @@ -0,0 +1,222 @@ +import { DatePipe } from '@angular/common'; +import { + Component, + ElementRef, + OnInit, + Output, + ViewChild +} from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/services/data-analytics-dashboard.services'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; + +@Component({ + selector: 'app-moh731-register', + templateUrl: './moh731-register.component.html', + styleUrls: ['./moh731-register.component.css'] +}) +export class Moh731RegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public MOH731RegisterData: any = {}; + public columnDefs: any = []; + public reportName = 'MOH 731 REGISTER'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + public jointLocationUuids = []; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'datesControl, locationControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + public generated = false; + @ViewChild('cntdarcontentToSnapshot') contentToSnapshot!: ElementRef; + + 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; + } + + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + + constructor( + public router: Router, + public route: ActivatedRoute, + public register: RegistersResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment().format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + 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.push(...locationValues); + }); + + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(); + }); + this.MOH731RegisterData = []; + this.getMOH731Register(this.params); + this.generated = true; + } + + public storeParamsInUrl() { + this.params = { + locationUuids: this.jointLocationUuids, + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + public getMOH731Register(params: any) { + this.isLoading = true; + this.register.getMoh731Register(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; + const flatData = Object.assign({}, ...data.result); + this.MOH731RegisterData = flatData; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } + public calculateTotalSummary() { + const totalsRow = []; + if (this.MOH731RegisterData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.MOH731RegisterData, (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().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 731 Register.pdf'); + }); + } +} diff --git a/src/app/etl-api/registers-resource.service.ts b/src/app/etl-api/registers-resource.service.ts index c8f664c53..4762d9298 100644 --- a/src/app/etl-api/registers-resource.service.ts +++ b/src/app/etl-api/registers-resource.service.ts @@ -53,4 +53,100 @@ export class RegistersResourceService { }) ); } + public getMaternityRegister(params: any): Observable { + return this.http + .get( + `${this.url}registers/maternity?month=${params.month}&startDate=${params.startDate}&endDate=${params.endDate}&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 getPncRegister(params: any): Observable { + return this.http + .get( + `${this.url}registers/pncregister?month=${params.month}&startDate=${params.startDate}&endDate=${params.endDate}&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 getNutritionRegister(params: any): Observable { + return this.http + .get( + `${this.url}registers/nutrition?month=${params.month}&startDate=${params.startDate}&endDate=${params.endDate}&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 getOTZRegister(params: any): Observable { + return this.http + .get( + `${this.url}registers/otz-register?month=${params.month}&startDate=${params.startDate}&endDate=${params.endDate}&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 getMoh731Register(params: any): Observable { + return this.http + .get( + `${this.url}moh-731?month=${params.month}&startDate=${params.startDate}&endDate=${params.endDate}&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; + }) + ); + } } From 7cbffe3fb7e288fe45d4da343001faa0635ca64f Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 22:56:36 +0300 Subject: [PATCH 42/50] Added HTS register --- .../htsrefferallinkage-register.component.css | 22 + ...htsrefferallinkage-register.component.html | 481 ++++++++++++++++-- .../htsrefferallinkage-register.component.ts | 97 +++- 3 files changed, 564 insertions(+), 36 deletions(-) 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 index ab1f08146..7228658f8 100644 --- 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 @@ -15,3 +15,25 @@ tbody tr { th { min-width: 70px; } +.summary { + display: flex; + gap: 20px; + align-items: stretch; +} + +.flex-item { + flex: 1 1 30%; + box-sizing: border-box; +} +table { + width: 100%; + height: auto; +} + +.inner { + display: flex; + flex-direction: column; +} +.highlighted-row { + background-color: #bbb; +} 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 index 37503c28a..44779a982 100644 --- 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 @@ -37,7 +37,11 @@

This report is likely to change without warning.

-
+
@@ -65,6 +69,7 @@

Identification
Number + AMRSID Date of visit
(DD/MM/YYYY) @@ -178,57 +183,461 @@

(p) (q) (r) + (s) - {{ item.serialNumber }} + {{ item.serialNumber }} {{ item.nupiNumber }} - {{ item.visitDate }} - {{ item.clientName }} - {{ item.age }} - {{ item.sex }} - {{ item.telephoneNumber }} - {{ item.maritalStatus }} - {{ item.populationType }} - {{ item.setting }} - {{ item.hivTest1.kitName }} - {{ item.hivTest2.kitName }} - {{ item.hivTest3.kitName }} - {{ item.finalHivResult }} - {{ item.discordantCouple }} - - {{ item.referredForPrevention }} + {{ item.amrsID }} + {{ item.visitDate }} + {{ item.clientName }} + {{ item.age }} + {{ item.sex }} + {{ item.telephoneNumber }} + {{ item.maritalStatus }} + {{ item.populationType }} + {{ item.setting }} + + {{ item.hivTest1.kitName }} / {{ item.hivTest1.lotNumber }} / + {{ item.hivTest1.expiryDate }} - {{ item.htsProvider }} - {{ item.remarks }} + + {{ item.hivTest2.kitName }} / {{ item.hivTest2.lotNumber }} / + {{ item.hivTest2.expiryDate }} + + + {{ item.hivTest3.kitName }} / {{ item.hivTest3.lotNumber }} / + {{ item.hivTest3.expiryDate }} + + {{ item.finalHivResult }} + {{ item.discordantCouple }} + + {{ null }} + + {{ item.htsProvider }} + {{ item.remarks }} {{ item.nationalId }} - {{ item.hivTest1.lotNumber }} - {{ item.hivTest2.lotNumber }} - {{ item.hivTest3.lotNumber }} - - - - {{ item.hivTest1.expiryDate }} - {{ item.hivTest2.expiryDate }} - {{ item.hivTest3.expiryDate }} - - - - {{ item.hivTest1.result }} - {{ item.hivTest2.result }} - {{ item.hivTest3.result }} + {{ item.subPopulation }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Tests (n)2-910-1415-1920-2425+Total
Male{{ getTotals(htsLabData, 'M', 2, 9) }}{{ getTotals(htsLabData, 'M', 10, 14) }}{{ getTotals(htsLabData, 'M', 15, 19) }}{{ getTotals(htsLabData, 'M', 20, 24) }}{{ getTotals(htsLabData, 'M', 25) }}{{ getTotal(htsLabData, 'M') }}
Female{{ getTotals(htsLabData, 'F', 2, 9) }}{{ getTotals(htsLabData, 'F', 10, 14) }}{{ getTotals(htsLabData, 'F', 15, 19) }}{{ getTotals(htsLabData, 'F', 20, 24) }}{{ getTotals(htsLabData, 'F', 25) }}{{ getTotal(htsLabData, 'F') }}
Total{{ getMaleAndFemaleTotal(htsLabData, 2, 9) }}{{ getMaleAndFemaleTotal(htsLabData, 10, 14) }}{{ getMaleAndFemaleTotal(htsLabData, 15, 19) }}{{ getMaleAndFemaleTotal(htsLabData, 20, 24) }}{{ getMaleAndFemaleTotal(htsLabData, 25) }}{{ htsLabData.length }}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Positive (n)2-910-1415-1920-2425+Total
Male + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'M', + 2, + 9 + ) + }} + + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'M', + 10, + 14 + ) + }} + + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'M', + 15, + 19 + ) + }} + + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'M', + 20, + 24 + ) + }} + + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'M', + 25 + ) + }} + + {{ + getParameterTotals(htsLabData, 'finalHivResult', 'P', 'M') + }} +
Female + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'F', + 2, + 9 + ) + }} + + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'F', + 10, + 14 + ) + }} + + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'F', + 15, + 19 + ) + }} + + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'F', + 20, + 24 + ) + }} + + {{ + getParameterTotalsWithAge( + htsLabData, + 'finalHivResult', + 'P', + 'F', + 25 + ) + }} + + {{ getParameterTotals(htsLabData, 'finalHivResult', 'P', 'F') }} +
Total + {{ getPositiveMaleAndFemaleTotalWithAge(htsLabData, 2, 9) }} + + {{ getPositiveMaleAndFemaleTotalWithAge(htsLabData, 10, 14) }} + + {{ getPositiveMaleAndFemaleTotalWithAge(htsLabData, 15, 19) }} + + {{ getPositiveMaleAndFemaleTotalWithAge(htsLabData, 20, 24) }} + + {{ getPositiveMaleAndFemaleTotalWithAge(htsLabData, 25) }} + {{ getPositiveTotal(htsLabData) }}
+
+
+
+
+ + + + + + + + + + + +
Total Negative (n)
+ {{ getParameterTotals(htsLabData, 'finalHivResult', 'N') }} +
+
+
+ + + + + + + + + + + +
Inconclusive test (n)
+ {{ getParameterTotals(htsLabData, 'finalHivResult', 'I') }} +
+
+
+
+
+ + + + + + + + + + + +
Tests Facility (j){{ getParameterTotals(htsLabData, 'setting', '1') }}
Tests Community (j){{ getParameterTotals(htsLabData, 'setting', '2') }}
+
+
+ + + + + + + +
Discordant (o) + {{ getParameterTotals(htsLabData, 'discordantCouple', 'Y') }} +
+
+
+ + + + + + + + + + + + +
Tests Key pops (i) + {{ getParameterTotals(htsLabData, 'populationType', '2') }} +
Positive key pops (i) & (n) + {{ + getParameterTotals(htsLabData, 'populationType', '2') + + getParameterTotals(htsLabData, 'finalHivResult', 'P') + }} +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HIV Test 1 (k) NumberHIV Test 2 (I)NumberHIV Test 3 (m)Number
N: Negative + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest1', 'N') }} + N: Negative + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'N') }} + N: Negative + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'N') }} +
P: Positive + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest1', 'P') }} + P: Positive + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest2', 'P') }} + P: Positive + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'P') }} +
I: Invalid + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest1', 'I') }} + I: Invalid + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest2', 'I') }} + I: Invalid + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'P') }} +
Wastage: + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest1', 'NA') }} + Wastage: + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest2', 'NA') }} + Wastage: + {{ getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'NA') }} +
Total: + {{ + getHivTestTypesAndTotals(htsLabData, 'hivTest1', 'N') + + getHivTestTypesAndTotals(htsLabData, 'hivTest1', 'P') + + getHivTestTypesAndTotals(htsLabData, 'hivTest1', 'I') + + getHivTestTypesAndTotals(htsLabData, 'hivTest1', 'NA') + }} + Total: + {{ + getHivTestTypesAndTotals(htsLabData, 'hivTest2', 'N') + + getHivTestTypesAndTotals(htsLabData, 'hivTest2', 'P') + + getHivTestTypesAndTotals(htsLabData, 'hivTest2', 'I') + + getHivTestTypesAndTotals(htsLabData, 'hivTest2', 'NA') + }} + Total: + {{ + getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'N') + + getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'P') + + getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'I') + + getHivTestTypesAndTotals(htsLabData, 'hivTest3', 'NA') + }} +
+
+


-
+
@@ -251,6 +660,7 @@

Serial
Number + AMRSID National Identification
Number @@ -301,6 +711,7 @@

{{ item.serialNumber }} + {{ item.amrsID }} {{ item.nupiNumber }} {{ item.clientName }} {{ item.telephoneNumber }} 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 index b9368f3f3..951a2193e 100644 --- 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 @@ -2,6 +2,7 @@ import { Component, OnInit, Output } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; import * as Moment from 'moment'; +import { zhCnLocale } from 'ngx-bootstrap'; import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/services/data-analytics-dashboard.services'; // import { HtsrefferallinkageRegisterService } from './htsrefferallinkage-register.service'; import { HtsReferralLinkageService } from 'src/app/etl-api/hts-refferal-linkage.service'; @@ -160,6 +161,7 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { return { htsLabData: apiData.map((item) => ({ serialNumber: item.serial_number || '', + amrsID: item.amrsID || '', nupiNumber: item.nupi || '', nationalId: item.id_number || '', visitDate: item.date_of_visit @@ -171,8 +173,9 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { age: item.age || '', sex: item.sex || '', telephoneNumber: item.telephone || '', - maritalStatus: '', // Not available in API data + maritalStatus: item.marital_status || '', populationType: item.population_type || '', + subPopulation: item.sub_population || '', setting: item.setting || '', hivTest1: { kitName: item.kit1_name || '', @@ -206,6 +209,7 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { })), htsLinkageData: apiData.map((item) => ({ serialNumber: item.serial_number || '', + amrsID: item.amrsID || '', nupiNumber: item.nupi || '', nationalId: item.id_number || '', clientName: `${item.first_name || ''} ${item.middle_name || ''} ${ @@ -283,4 +287,95 @@ export class HtsrefferallinkageRegisterComponent implements OnInit { this.isReleased = true; } } + getTotal(summaryData: any[], gender: string) { + return summaryData.filter((data) => data['sex'] === gender).length || ''; + } + getMaleAndFemaleTotal(summaryData: any[], minAge: number, maxAge?: number) { + return ( + summaryData.filter( + (data) => + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + getPositiveMaleAndFemaleTotalWithAge( + summaryData: any[], + minAge: number, + maxAge?: number + ) { + return ( + summaryData.filter( + (data) => + data['final_result'] === 'P' && + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + getPositiveTotal(summaryData: any[]) { + return ( + summaryData.filter((data) => data['final_result'] === 'P').length || '' + ); + } + getTotals( + summaryData: any[], + gender: string, + minAge: number, + maxAge?: number + ) { + return ( + summaryData.filter( + (data) => + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) && + data['sex'] === gender + ).length || '' + ); + } + getParameterTotalsWithAge( + summaryData: any[], + parameter: string, + parameterValue: string, + gender: string, + minAge: number, + maxAge?: number + ) { + return ( + summaryData.filter( + (data) => + data['age'] >= minAge && + data[parameter] === parameterValue && + data['sex'] === gender && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + + getParameterTotals( + summaryData: any[], + parameter: string, + parameterValue: string, + gender?: string + ) { + return ( + summaryData.filter( + (data) => + data[parameter] === parameterValue && + (gender === undefined || data['sex'] === gender) + ).length || '' + ); + } + + getHivTestTypesAndTotals( + summaryData: any[], + testType: string, + value: string + ) { + return ( + summaryData.filter( + (data) => data[testType] && data[testType]['result'] === value + ).length || '' + ); + } } From c16f18acd026c32a978bdece3cc7739e29bd4135 Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 23:03:38 +0300 Subject: [PATCH 43/50] Added Hei register --- .../hei-register-filters.component.css | 0 .../hei-register-filters.component.html | 103 ++++++++++++ .../hei-register-filters.component.spec.ts | 24 +++ .../hei-register-filters.component.ts | 147 ++++++++++++++++++ .../hei-register/hei-register.component.html | 81 ++++++---- .../hei-register/hei-register.component.ts | 42 ++++- 6 files changed, 358 insertions(+), 39 deletions(-) create mode 100644 src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.ts diff --git a/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.css b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.html b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.html new file mode 100644 index 000000000..e0ad0f919 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.html @@ -0,0 +1,103 @@ +
+
+ + + Report filters + + + + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+ + Loading report.. +
+
diff --git a/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.spec.ts b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.spec.ts new file mode 100644 index 000000000..463bec95f --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HeiRegisterFiltersComponent } from './hei-register-filters.component'; + +describe('HeiRegisterFiltersComponent', () => { + let component: HeiRegisterFiltersComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [HeiRegisterFiltersComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HeiRegisterFiltersComponent); + 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-filters/hei-register-filters.component.ts b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.ts new file mode 100644 index 000000000..aa5ff65b6 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register-filters/hei-register-filters.component.ts @@ -0,0 +1,147 @@ +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import * as Moment from 'moment'; + +@Component({ + selector: 'app-hei-register-filters', + templateUrl: './hei-register-filters.component.html', + styleUrls: ['./hei-register-filters.component.css'] +}) +export class HeiRegisterFiltersComponent implements OnInit { + public filterCollapsed: boolean; + @Output() + public generateReport = new EventEmitter(); + + @Output() + public startDateChange = new EventEmitter(); + + @Output() + public endDateChange = new EventEmitter(); + + @Output() + public isLegacyVersionChange = new EventEmitter(); + + @Output() + public isAggregatedChange = new EventEmitter(); + + @Input() + public locationUuids: Array = []; + + @Output() + public locationUuidsChange = new EventEmitter(); + + @Input() + public parentIsBusy = false; + + @Input() + public isMonthMode = true; + + private _showIsAggregateControl = false; + public get showIsAggregateControl(): boolean { + return this._showIsAggregateControl; + } + @Input() + public set showIsAggregateControl(v: boolean) { + this._showIsAggregateControl = v; + } + + private _showLocationsControl = false; + public get showLocationsControl(): boolean { + return this._showLocationsControl; + } + @Input() + public set showLocationsControl(v: boolean) { + this._showLocationsControl = v; + } + + private _startDate: Date; + public get startDate(): Date { + return this._startDate; + } + @Input() + public set startDate(v: Date) { + this._startDate = v; + this._month = v; + this.startDateChange.emit(this.startDate); + } + + public get startDateString(): string { + return this.startDate ? Moment(this.startDate).format('YYYY-MM-DD') : null; + } + public set startDateString(v: string) { + this.startDate = new Date(v); + } + + public get endDateString(): string { + return this.endDate ? Moment(this.endDate).format('YYYY-MM-DD') : null; + } + public set endDateString(v: string) { + this.endDate = new Date(v); + } + + private _endDate: Date; + public get endDate(): Date { + return this._endDate; + } + @Input() + public set endDate(v: Date) { + this._endDate = v; + this._month = v; + this.endDateChange.emit(this.endDate); + } + + public get monthString(): string { + return this.month ? Moment(this.month).format('YYYY-MM') : null; + } + public set monthString(v: string) { + this.month = new Date(v); + } + + private _month: Date; + public get month(): Date { + return this._month; + } + @Input() + public set month(v: Date) { + this._month = v; + this.startDate = Moment(this._month).startOf('month').toDate(); + this.endDate = Moment(this._month).endOf('month').toDate(); + } + + private _isAggregated: boolean; + public get isAggregated(): boolean { + return this._isAggregated; + } + @Input() + public set isAggregated(v: boolean) { + this._isAggregated = v; + this.isAggregatedChange.emit(this.isAggregated); + } + + private _isLegacyVersion = true; + public get isLegacyVersion(): boolean { + return this._isLegacyVersion; + } + @Input() + public set isLegacyVersion(v: boolean) { + this._isLegacyVersion = v; + this.isLegacyVersionChange.emit(this.isLegacyVersion); + } + + constructor() {} + + ngOnInit() {} + + public onClickedGenerate() { + this.generateReport.emit(); + } + + public changeIsLegacyValue(val: boolean) { + this.isLegacyVersion = val; + } + + public onLocationsSelected(val) { + if (val) { + this.locationUuidsChange.emit(val.locations); + } + } +} 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 537282819..67b6d2129 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 @@ -9,15 +9,15 @@

- - +
@@ -67,8 +67,9 @@

- Cohort: Month/Year - (MMM-YYYY).........................../.............................................. + Cohort: Month/Year (MMM-YYYY)...........................{{ + formattedStartDate + }}.............................................. @@ -91,9 +92,7 @@

Serial No. - - Date of Collected enrollment (DD/MM/YYYY) - + Date of enrollment (DD/MM/YYYY) Birth Certificate
Number @@ -183,68 +182,83 @@

{{ data.HEI_ID }} - {{ data.Infant_name }} + {{ data.given_name }} {{ data.middle_name }} + {{ data.family_name }} - {{ transformDate(data.birth_date) }} + {{ transformDate(data.dob) }} Sex - {{ null }} + {{ data.infant_prophylaxis }} {{ data.parent_name }} - {{ data.age_in_weeks_on_first_pcr }} + {{ data.pcr_one ? data.pcr_one_age_weeks : '' }} {{ date_enrolled }} - {{ transformDate(data.first_pcr_date) }} + + {{ transformDate(data.pcr_one ? data.pcr_one_date : '') }} + - {{ data.age_in_months_on_second_pcr }} + {{ data.pcr_two ? data.pcr_two_age_months : '' }} + + + {{ transformDate(data.pcr_two ? data.pcr_two_date : '') }} - {{ transformDate(data.second_pcr_date) }} - {{ data.age_in_months_on_third_pcr }} + {{ data.pcr_three ? data.pcr_three_age_months : '' }} + + + {{ transformDate(data.pcr_three ? data.pcr_three_date : '') }} - {{ transformDate(data.third_pcr_date) }} Infant Feeding - {{ data.hei_outcome }} + {{ null }} - {{ data.age_in_months_on_confirm_pcr }} + {{ data.confirm_pcr ? data.confirm_pcr_age_months : '' }} + + + {{ transformDate(data.confirm_pcr ? data.confirm_pcr_date : '') }} - {{ transformDate(data.confirm_pcr_date) }} {{ data.age_in_months_on_first_antibody }} - {{ transformDate(data.first_antibody_date) }} + {{ transformDate(data.antibody_date) }} {{ null }} - {{ null }} - {{ null }} + + {{ data.death_date ? data.death_date : data.hei_outcome }} + + {{ data.remarks }} {{ data.NUPI }} {{ data.gender }} {{ data.Phone_Number }} - {{ data.results_pcr_first_pcr }} + {{ data.pcr_one }} - {{ data.results_pcr_second_pcr }} + {{ data.pcr_two }} - {{ data.results_pcr_third_pcr }} + {{ data.pcr_three }} - {{ data.infant_feeding }} - {{ data.results_confirm_pcr }} + {{ data.infant_feeding }} - {{ data.results_first_antibody }} + {{ data.confirm_confirm }} + + + {{ data.antibody_test }} + + + {{ data.age_in_months === 24 ? data.infant_feeding : '' }} - {{ null }} {{ null }} @@ -252,3 +266,6 @@

+
+ No record found +
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 4425dd303..c955c2da3 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 @@ -11,7 +11,6 @@ import * as _ from 'lodash'; import * as Moment from 'moment'; import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/services/data-analytics-dashboard.services'; import { HeiRegisterResourceService } from 'src/app/etl-api/hei-register-resource.service'; -import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; import * as html2canvas from 'html2canvas'; import * as jsPDF from 'jspdf'; @Component({ @@ -45,6 +44,9 @@ export class HeiRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + public generated = false; + public showLocationsControl = true; + public showIsAggregateControl = false; @ViewChild('heicontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; @@ -62,7 +64,7 @@ export class HeiRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - private _startDate: Date = Moment().toDate(); + private _startDate: Date = Moment().startOf('month').toDate(); public get startDate(): Date { return this._startDate; } @@ -71,7 +73,7 @@ export class HeiRegisterComponent implements OnInit { this._startDate = v; } - private _endDate: Date = new Date(); + private _endDate: Date = Moment().endOf('month').toDate(); public get endDate(): Date { return this._endDate; } @@ -119,11 +121,19 @@ export class HeiRegisterComponent implements OnInit { this.getHeiRegisterData(this.params); } + get formattedStartDate(): string { + return this.startDate + ? Moment(this.startDate).subtract(1, 'year').format('MMM-YYYY') + : ''; + } + public storeParamsInUrl() { + const startDateMinusOneYear = Moment(this.startDate).subtract(1, 'year'); + const endDateMinusOneYear = Moment(this.endDate).subtract(1, 'year'); this.params = { - locationUuids: this.jointLocationUuids, - startDate: Moment(this.startDate).format('YYYY-MM-DD'), - endDate: Moment(this.endDate).format('YYYY-MM-DD') + locationUuids: this.getSelectedLocations(this.jointLocationUuids), + startDate: startDateMinusOneYear.format('YYYY-MM-DD'), + endDate: endDateMinusOneYear.format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -141,8 +151,8 @@ export class HeiRegisterComponent implements OnInit { } else { this.showInfoMessage = false; this.columnDefs = data.sectionDefinitions; - console.log('HEI DATA IS: ' + JSON.stringify(data)); this.heiRegisterData = data; + this.generated = true; this.isLoading = false; this.showDraftReportAlert(this._month); } @@ -217,4 +227,22 @@ export class HeiRegisterComponent implements OnInit { pdf.save('MOH 408 HIV Exposed Infant Register.pdf'); }); } + private getSelectedLocations(locationUuids: any): string { + if (!locationUuids || locationUuids.length === 0) { + return ''; + } + + let selectedLocations = ''; + + for (let i = 0; i < locationUuids.length; i++) { + const value = `'${(locationUuids[i] as any).value}'`; + if (i === 0) { + selectedLocations = value; + } else { + selectedLocations = selectedLocations + ', ' + value; + } + } + + return selectedLocations; + } } From e9870d6874762753aeead8b4046fc9190131f74b Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 23:08:00 +0300 Subject: [PATCH 44/50] POC-746: Added MOH 366 Care and Treatment Daily Activity --- .../cntdaily-register.component.css | 16 +- .../cntdaily-register.component.html | 996 +++++++++++++++++- .../cntdaily-register.component.ts | 121 ++- 3 files changed, 1088 insertions(+), 45 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 7d7e743ba..640a3a1b6 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 @@ -8,7 +8,19 @@ tbody tr { } .vertical-text { writing-mode: vertical-rl; - text-orientation: mixed; transform: rotate(180deg); - white-space: nowrap; +} + +.center { + vertical-align: middle; + font-weight: bold; + text-align: center; +} + +.bold { + font-weight: bolder; +} + +.right { + text-align: right; } 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 3cd1ffdce..ea67405a2 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 @@ -68,6 +68,7 @@

No Date + AMRSID National Identification Number Client CCC Number Age @@ -150,9 +151,9 @@

(a) (b) - (c) + (c) (d) - (e) + (e) (f) (g) (h) @@ -185,9 +186,10 @@

(aj) (ak) (al) - (am) + (am) (an) - (ao) + (ao) + (ap) @@ -199,209 +201,296 @@

{{ data.date | date: 'dd/MM/yyyy' }} + + {{ data.amrsID }} + {{ data.national_id_number }} - {{ data.ccc_number }} + {{ data.ccc_number?.replace('-', '') }} {{ data.age }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.started_on_art }} + {{ data.started_on_art === 'Y' ? '✓' : '' }} - {{ data.screened_for_tb }} + {{ data.started_on_art === 'Y' ? data.screened_for_tb : 'NA' }} - {{ data.screened_for_tb }} + {{ data.started_on_art === 'Y' ? data.screened_for_tb : 'NA' }} - {{ data.started_on_tpt }} + {{ data.started_on_art === 'Y' ? data.started_on_tpt : 'NA' }} - {{ data.started_on_tpt }} + {{ data.started_on_art === 'Y' ? data.started_on_tpt : 'NA' }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} - {{ data.current_on_art }} + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} {{ data.dsd_status }} @@ -412,7 +501,840 @@

{{ data.NUPI }} + + + + Data element CODE + + + + HV03-O1 + HVO3-02 + HVO3-03 + HVO3-04 + HVO3-05 + HVO3-06 + HVO3-07 + HVO3-08 + HVO3-09 + HVO3-10 + HVO3-11 + HVO3-12 + HVO3-13 + HVO3-14 + HVO3-15 + HVO3-16 + HVO3-17 + HVO3-18 + HVO3-19 + HVO3-20 + HVO3-21 + HVO3-22 + HVO3-23 + HVO3-24 + HVO3-25 + HVO3-26 + HVO3-27 + HVO3-28 + HVO3-29 + HVO3-30 + HVO3-31 + HVO3-32 + HVO3-33 + HVO3-34 + + + + + TOTAL this Page + {{ careTreatmentRegisterData.length }} + + + {{ getLessThanOneTotals(careTreatmentRegisterData, 'M') }} + + + {{ getLessThanOneTotals(careTreatmentRegisterData, 'F') }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 1, 4) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 1, 4) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 5, 9) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 5, 9) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 10, 14) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 10, 14) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 15, 19) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 15, 19) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 20, 24) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 20, 24) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 25) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 25) }} + + + + + + + {{ currentOnArtLessOneTotals(careTreatmentRegisterData, 'M') }} + + + {{ currentOnArtLessOneTotals(careTreatmentRegisterData, 'F') }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 1, 4) }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 1, 4) }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 5, 9) }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 5, 9) }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 10, 14) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 10, 14) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 15, 19) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 15, 19) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 20, 24) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 20, 24) + }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 25) }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 25) }} + + + + + + + TOTAL this Month + {{ careTreatmentRegisterData.length }} + + + {{ getLessThanOneTotals(careTreatmentRegisterData, 'M') }} + + + {{ getLessThanOneTotals(careTreatmentRegisterData, 'F') }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 1, 4) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 1, 4) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 5, 9) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 5, 9) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 10, 14) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 10, 14) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 15, 19) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 15, 19) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 20, 24) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 20, 24) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'M', 25) }} + + + {{ getStartingARTTotals(careTreatmentRegisterData, 'F', 25) }} + + + + + + + {{ currentOnArtLessOneTotals(careTreatmentRegisterData, 'M') }} + + + {{ currentOnArtLessOneTotals(careTreatmentRegisterData, 'F') }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 1, 4) }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 1, 4) }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 5, 9) }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 5, 9) }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 10, 14) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 10, 14) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 15, 19) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 15, 19) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 20, 24) + }} + + + {{ + getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 20, 24) + }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'M', 25) }} + + + {{ getCurrentOnARTTotals(careTreatmentRegisterData, 'F', 25) }} + + + + + + + + + (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) + + + + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 2, + 'M' + ) + }} + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 2, + 'F' + ) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'M', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'F', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'M', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'F', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'M', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'F', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'M', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'F', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'M', 20, 24) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 2, 'F', 20, 24) + }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 2, 'M', 25) }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 2, 'F', 25) }} + + + + + Count of clients with 3 months appointment + + + + + + + + + + + + + + + + + + + + + + Total this Month (3s) + + + + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 3, + 'M' + ) + }} + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 3, + 'F' + ) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'M', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'F', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'M', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'F', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'M', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'F', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'M', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'F', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'M', 20, 24) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 3, 'F', 20, 24) + }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 3, 'M', 25) }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 3, 'F', 25) }} + + + + + Count of clients with 4 months appointment + + + + + + + + + + + + + + + + + + + + + + Total this Month (4s) + + + + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 4, + 'M' + ) + }} + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 4, + 'F' + ) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'M', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'F', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'M', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'F', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'M', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'F', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'M', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'F', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'M', 20, 24) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 4, 'F', 20, 24) + }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 4, 'M', 25) }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 4, 'F', 25) }} + + + + + Count of clients with 5 mnths appointment + + + + + + + + + + + + + + + + + + + + + + Total this Month (5s) + + + + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 5, + 'M' + ) + }} + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 5, + 'F' + ) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'M', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'F', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'M', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'F', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'M', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'F', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'M', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'F', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'M', 20, 24) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 5, 'F', 20, 24) + }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 5, 'M', 25) }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 5, 'F', 25) }} + + + + + Count of clients with 6 months appointment + + + + + + + + + + + + + + + + + + + + + + Total this Month (6s) + + + + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 6, + 'M' + ) + }} + + + {{ + getAppointmentTotalsAgeLessThanOne( + careTreatmentRegisterData, + 6, + 'F' + ) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'M', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'F', 1, 4) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'M', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'F', 5, 9) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'M', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'F', 10, 14) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'M', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'F', 15, 19) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'M', 20, 24) + }} + + + {{ + getAppointmentTotals(careTreatmentRegisterData, 6, 'F', 20, 24) + }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 6, 'M', 25) }} + + + {{ getAppointmentTotals(careTreatmentRegisterData, 6, 'F', 25) }} + + +

+
+ No record found +
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 76fa461a1..3e74e116f 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 @@ -44,6 +44,8 @@ export class CntdailyRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + public generated = false; + @ViewChild('cntdarcontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; @@ -116,6 +118,7 @@ export class CntdailyRegisterComponent implements OnInit { }); this.careTreatmentRegisterData = []; this.getCareTreatmentRegisterData(this.params); + this.generated = true; } public storeParamsInUrl() { @@ -141,7 +144,6 @@ export class CntdailyRegisterComponent implements OnInit { this.errorMessage = `There has been an error while loading the report, please retry again`; this.isLoading = false; } else { - console.log('Care&Treatment', data); this.showInfoMessage = false; this.columnDefs = data.sectionDefinitions; this.careTreatmentRegisterData = data; @@ -211,13 +213,120 @@ export class CntdailyRegisterComponent implements OnInit { public takeSnapshotAndExport() { const elementToSnapshot = this.contentToSnapshot.nativeElement; - html2canvas(elementToSnapshot).then((canvas) => { + html2canvas(elementToSnapshot, { scale: 2 }).then((canvas) => { const imgData = canvas.toDataURL('image/png'); - const pdf = new jsPDF('p', 'mm', 'a4'); - const imgWidth = 210; // A4 width in mm + const pdf = new jsPDF('p', 'mm', 'a0'); + + const pageWidth = 841; // A0 width (portrait) + const pageHeight = 1189; // A0 height + + const imgWidth = pageWidth; const imgHeight = (canvas.height * imgWidth) / canvas.width; - pdf.addImage(imgData, 'PNG', 0, 0, imgWidth, imgHeight); - pdf.save('MOH 366 Care and Treatment Daily Activity.pdf'); + + let heightLeft = imgHeight; + let position = 0; + + pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); + + heightLeft -= pageHeight; + + // Add additional pages if required + while (heightLeft > 0) { + pdf.addPage(); + position = heightLeft - imgHeight; + pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); + heightLeft -= pageHeight; + } + pdf.save('MOH_366_Care_and_Treatment_Daily_Activity.pdf'); }); } + + getStartingARTTotals( + summaryData: any[], + genderValue: string, + minAge: number, + maxAge?: number + ) { + return ( + summaryData.filter( + (data) => + data['started_on_art'] === 'Y' && + data['gender'] === genderValue && + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + getCurrentOnARTTotals( + summaryData: any[], + genderValue: string, + minAge: number, + maxAge?: number + ) { + return ( + summaryData.filter( + (data) => + data['current_on_art'] !== null && + data['current_on_art'] !== undefined && + data['gender'] === genderValue && + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + + getLessThanOneTotals(summaryData: any[], genderValue: string) { + return ( + summaryData.filter( + (data) => + data['started_on_art'] === 'Y' && + data['age'] < 1 && + data['gender'] === genderValue + ).length || '' + ); + } + currentOnArtLessOneTotals(summaryData: any[], genderValue: string) { + return ( + summaryData.filter( + (data) => + data['current_on_art'] !== null && + data['current_on_art'] !== undefined && + data['age'] < 1 && + data['gender'] === genderValue + ).length || '' + ); + } + + getAppointmentTotals( + summaryData: any[], + artValue: number, + gender: string, + minAge: number, + maxAge?: number + ) { + return ( + summaryData.filter( + (data) => + data['current_on_art'] === artValue && + data['gender'] === gender && + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + + getAppointmentTotalsAgeLessThanOne( + summaryData: any[], + artValue: number, + gender: string + ) { + return ( + summaryData.filter( + (data) => + data['current_on_art'] === artValue && + data['age'] < 1 && + data['gender'] === gender + ).length || '' + ); + } } From 685f7be1b639ba847eac914428aac70d5c2fcb75 Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 23:12:55 +0300 Subject: [PATCH 45/50] POC-874: Added MoH 731 Facility Summary Reporting Tool --- .../moh731-filters.component.css | 0 .../moh731-filters.component.html | 103 + .../moh731-filters.component.spec.ts | 24 + .../moh731-filters.component.ts | 155 + .../moh731-report-patient-list.component.css | 0 .../moh731-report-patient-list.component.html | 48 + ...h731-report-patient-list.component.spec.ts | 24 + .../moh731-report-patient-list.component.ts | 159 + .../moh731-report-view.component.css | 68 + .../moh731-report-view.component.html | 1737 ++++++++++ .../moh731-report-view.component.spec.ts | 24 + .../moh731-report-view.component.ts | 210 ++ .../hiv/report731/report731.component.css | 69 + .../hiv/report731/report731.component.html | 2879 +++++++++++++++++ .../hiv/report731/report731.component.spec.ts | 24 + .../hiv/report731/report731.component.ts | 254 ++ 16 files changed, 5778 insertions(+) create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.ts create mode 100644 src/app/data-analytics-dashboard/hiv/report731/report731.component.css create mode 100644 src/app/data-analytics-dashboard/hiv/report731/report731.component.html create mode 100644 src/app/data-analytics-dashboard/hiv/report731/report731.component.spec.ts create mode 100644 src/app/data-analytics-dashboard/hiv/report731/report731.component.ts diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.css b/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.html b/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.html new file mode 100644 index 000000000..e0ad0f919 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.html @@ -0,0 +1,103 @@ +
+
+ + + Report filters + + + + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+ + Loading report.. +
+
diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.spec.ts b/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.spec.ts new file mode 100644 index 000000000..68d50b30b --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Moh731FiltersComponent } from './moh731-filters.component'; + +describe('Moh731FiltersComponent', () => { + let component: Moh731FiltersComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [Moh731FiltersComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(Moh731FiltersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.ts b/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.ts new file mode 100644 index 000000000..e37201e8a --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-filters/moh731-filters.component.ts @@ -0,0 +1,155 @@ +import { + ChangeDetectionStrategy, + Component, + EventEmitter, + Input, + OnInit, + Output +} from '@angular/core'; +import * as Moment from 'moment'; + +@Component({ + selector: 'app-moh731-filters', + templateUrl: './moh731-filters.component.html', + styleUrls: ['./moh731-filters.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class Moh731FiltersComponent implements OnInit { + public filterCollapsed: boolean; + @Output() + public generateReport = new EventEmitter(); + + @Output() + public startDateChange = new EventEmitter(); + + @Output() + public endDateChange = new EventEmitter(); + + @Output() + public isLegacyVersionChange = new EventEmitter(); + + @Output() + public isAggregatedChange = new EventEmitter(); + + @Input() + public locationUuids: Array = []; + + @Output() + public locationUuidsChange = new EventEmitter(); + + @Input() + public parentIsBusy = false; + + @Input() + public isMonthMode = true; + + private _showIsAggregateControl = false; + public get showIsAggregateControl(): boolean { + return this._showIsAggregateControl; + } + @Input() + public set showIsAggregateControl(v: boolean) { + this._showIsAggregateControl = v; + } + + private _showLocationsControl = false; + public get showLocationsControl(): boolean { + return this._showLocationsControl; + } + @Input() + public set showLocationsControl(v: boolean) { + this._showLocationsControl = v; + } + + private _startDate: Date; + public get startDate(): Date { + return this._startDate; + } + @Input() + public set startDate(v: Date) { + this._startDate = v; + this._month = v; + this.startDateChange.emit(this.startDate); + } + + public get startDateString(): string { + return this.startDate ? Moment(this.startDate).format('YYYY-MM-DD') : null; + } + public set startDateString(v: string) { + this.startDate = new Date(v); + } + + public get endDateString(): string { + return this.endDate ? Moment(this.endDate).format('YYYY-MM-DD') : null; + } + public set endDateString(v: string) { + this.endDate = new Date(v); + } + + private _endDate: Date; + public get endDate(): Date { + return this._endDate; + } + @Input() + public set endDate(v: Date) { + this._endDate = v; + this._month = v; + this.endDateChange.emit(this.endDate); + } + + public get monthString(): string { + return this.month ? Moment(this.month).format('YYYY-MM') : null; + } + public set monthString(v: string) { + this.month = new Date(v); + } + + private _month: Date; + public get month(): Date { + return this._month; + } + @Input() + public set month(v: Date) { + this._month = v; + this.startDate = Moment(this._month).startOf('month').toDate(); + this.endDate = Moment(this._month).endOf('month').toDate(); + } + + private _isAggregated: boolean; + public get isAggregated(): boolean { + return this._isAggregated; + } + @Input() + public set isAggregated(v: boolean) { + this._isAggregated = v; + this.isAggregatedChange.emit(this.isAggregated); + } + + private _isLegacyVersion = true; + public get isLegacyVersion(): boolean { + return this._isLegacyVersion; + } + @Input() + public set isLegacyVersion(v: boolean) { + this._isLegacyVersion = v; + this.isLegacyVersionChange.emit(this.isLegacyVersion); + } + + constructor() {} + + ngOnInit() {} + + public onClickedGenerate() { + this.generateReport.emit(); + } + + public changeIsLegacyValue(val: boolean) { + this.isLegacyVersion = val; + } + + public onLocationsSelected(val) { + if (val) { + this.locationUuidsChange.emit(val.locations); + } + } +} diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.css b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.html b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.html new file mode 100644 index 000000000..7fbb5852d --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.html @@ -0,0 +1,48 @@ +
+ +
+
+ Loading... +
+

+ {{ selectedIndicatorGender }} {{ selectedIndicator }} patient list +

+
+ + +
+
+ +
+
+ +
+

+ + All records loaded {{ '[ ' + patientData.length + ' ]' }} +

+ +

+
+ +
+

Error loading patient list.

+
diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.spec.ts b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.spec.ts new file mode 100644 index 000000000..8a394a8c9 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Moh731ReportPatientListComponent } from './moh731-report-patient-list.component'; + +describe('Moh731ReportPatientListComponent', () => { + let component: Moh731ReportPatientListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [Moh731ReportPatientListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(Moh731ReportPatientListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.ts b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.ts new file mode 100644 index 000000000..19cbbff70 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-patient-list/moh731-report-patient-list.component.ts @@ -0,0 +1,159 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Location } from '@angular/common'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; + +@Component({ + selector: 'app-moh731-report-patient-list', + templateUrl: './moh731-report-patient-list.component.html', + styleUrls: ['./moh731-report-patient-list.component.css'] +}) +export class Moh731ReportPatientListComponent implements OnInit { + public params: any; + public patientData: any; + public extraColumns: Array = []; + public isLoading = true; + public overrideColumns: Array = []; + public selectedIndicator: string; + public selectedIndicatorGender: string; + public hasLoadedAll = false; + public hasError = false; + public selectedMonth: String; + public busyIndicator: any = { + busy: false, + message: '' + }; + + constructor( + private router: Router, + private route: ActivatedRoute, + private _location: Location, + public register: RegistersResourceService + ) {} + + ngOnInit() { + this.route.queryParams.subscribe( + (params) => { + if (params && params.month) { + this.params = params; + this.selectedIndicator = params.indicatorHeader; + this.selectedIndicatorGender = params.indicatorGender; + this.getPatientList(params, params.indicators); + } + }, + (error) => { + console.error('Error', error); + } + ); + this.addExtraColumns(); + } + + private getPatientList(params: any, indicator: string) { + this.busyIndicator = { + busy: true, + message: 'Loading Patient List...please wait' + }; + console.log('PARAMS: ' + JSON.stringify(params)); + this.register.getMoh731PatientList(params, indicator).subscribe((data) => { + this.isLoading = false; + this.patientData = data.results.results; + if (data.results.results.length < 300) { + this.hasLoadedAll = true; + } + this.busyIndicator = { + busy: false, + message: '' + }; + }); + } + + public addExtraColumns() { + const extraColumns = { + weight: 'Weight', + height: 'Height', + stage: 'WHO Stage', + location: 'Location', + enrollment_date: 'Enrollment Date', + arv_first_regimen_start_date: 'ARVs Initial Start Date', + cur_regimen_arv_start_date: 'Current ARV Regimen Start Date (edited)', + cur_arv_line: 'Current ARV Line (edited)', + cur_arv_meds: 'Current ARV Regimen', + has_pending_vl_test: 'Pending Viral Load Test', + phone_number: 'Phone Number', + last_appointment: 'Latest Appointment', + patient_category: 'Patient Category', + latest_rtc_date: 'Latest RTC Date', + latest_vl: 'Latest VL', + vl_category: 'VL Category', + latest_vl_date: 'Latest VL Date', + previous_vl: 'Previous VL', + previous_vl_date: 'Previous VL Date', + ipt_start_date: 'IPT Start Date', + ipt_completion_date: 'IPT Completion Date', + ipt_stop_date: 'IPT Stop Date', + ovcid_id: 'OVCID', + hiv_disclosure_status: 'Hiv Disclosure Status', + discordant_status: 'Discordant Status', + tb_screening_date: 'TB Screening Date', + tb_screening_result: 'TB Screening Result', + covid_19_vaccination_status: 'Covid-19 Assessment Status', + cervical_screening_date: 'Cervical Screening Date', + cervical_screening_method: 'Cervical Screening Method', + cervical_screening_result: 'Cervical Screening Result', + sms_consent_provided: 'SMS Consent Provided', + sms_receive_time: 'SMS Time', + nearest_center: 'Nearest Center', + patient_categorization: 'DSD Model' + }; + + const status = this.selectedIndicatorGender.split(' - ')[0]; + if (status === 'Died') { + Object.assign(extraColumns, { + death_date: 'Death Date', + cause_of_death: 'Cause of Death' + }); + } else if (status === 'Transferred Out') { + Object.assign(extraColumns, { + transfer_out_date_v1: 'Transfer out date' + }); + } + for (const indicator in extraColumns) { + if (indicator) { + this.extraColumns.push({ + headerName: extraColumns[indicator], + field: indicator + }); + } + } + + this.overrideColumns.push( + { + field: 'identifiers', + cellRenderer: (column) => { + return ( + '' + + column.value + + '' + ); + } + }, + { + field: 'last_appointment', + width: 200 + }, + { + field: 'cur_prep_meds_names', + width: 160 + } + ); + } + + public loadMorePatients() { + this.isLoading = true; + this.getPatientList(this.params, this.params.indicators); + } + + public goBack() { + this._location.back(); + } +} diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.css b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.css new file mode 100644 index 000000000..77429c985 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.css @@ -0,0 +1,68 @@ +.table { + border: 2px solid #000; +} + +.border { + background-color: #f2f2f2; + border-bottom: 2px solid #000; + width: 100%; +} +.border2 { + background-color: #f2f2f2; + border-top: 2px solid #000; + border-bottom: 2px solid #000; + width: 100%; +} + +.border3 { + border-top: 2px solid #000; + border-right: 2px dotted #000; + width: 78.5%; +} + +.flex-column { + display: flex; + flex-direction: column; + margin: 1%; +} + +.flex-row { + display: flex; + justify-content: space-between; +} +.rectangle { + width: 50px; + height: 20px; + border: 2px solid #000; + display: inline-block; + margin-left: 5px; +} +.text-box { + display: flex; + align-items: center; + gap: 8px; +} +.text-box2 { + margin-left: 10px; +} +.space-after { + padding-right: 6vw; +} +.border-right { + border-right: 2px dotted #000; + padding-right: 4vw; +} +.border-left { + border-left: 2px dotted #000; + padding-left: 1vw; +} + +.review-section { + display: grid; + grid-template-columns: repeat(5, 1fr); + column-gap: 20px; + text-align: center; + font-size: 14px; + margin-top: 10px; + font-weight: bold; +} diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.html b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.html new file mode 100644 index 000000000..3ed2b59dd --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.html @@ -0,0 +1,1737 @@ +
+ × +

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

+

+ {{ errorMessage }} +

+
+
+
+
+ Ministry Of Health +
+
+ Ver. July 2023 +
+
+
+ + + + +
+ National AIDS & STI Control Program- NASCOP
+ Comprehensive HIV/ AIDS reporting form +
+ (MOH 731-Ver. July 2023) +
+
+
+ + + + +
+ County______________________SubCounty___________________Facility___________________MFL_______Month______year______ +
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Reviewed by:
+
Name
+
Designation
+
Signature
+
Date
+ +
+
_______________________________________
+
______________________
+
_____________
+
____________
+
+ +
1. HIV Testing & Pre exposure Prophylaxis
1.1 HIV Tests
MaleFemale(Including PMTCT)
Tests + HV01-01 +
{{ MOH731RegisterData.hiv_male }}
+
+
+ HV01-02 +
{{ MOH731RegisterData.hiv_female }}
+
+
Tests_Facility + HV01-03 +
+ {{ MOH731RegisterData.hiv_setting_facility }} +
+
Tests_Community + HV01-04 +
+ {{ MOH731RegisterData.hiv_setting_community }} +
+
Tested KVP + HV01-05 +
+ {{ MOH731RegisterData.hiv_setting_kvp }} +
+
+ 1.3 No. Initiated on PrEP(NEW) +
MaleFemale
General popn + HV01-19 +
+ {{ MOH731RegisterData.prep_new_male_general_pop }} +
+
+
+ HV01-20 +
+ {{ MOH731RegisterData.prep_new_female_general_pop }} +
+
+
MSM/MSW + HV01-21 +
{{ MOH731RegisterData.prep_new_msm }}
+
FSW +
+ HV01-22 +
+ {{ MOH731RegisterData.prep_new_fsw }} +
+
+
PWID/PWUD + HV01-23 +
+ {{ MOH731RegisterData.prep_new_pwud_male }} +
+
+
+ HV01-24 +
+ {{ MOH731RegisterData.prep_new_pwud_female }} +
+
+
Discordant Couple + HV01-25 +
+ {{ MOH731RegisterData.prep_new_discordant_male }} +
+
+
+ HV01-26 +
+ {{ MOH731RegisterData.prep_new_discordant_female }} +
+
+
Vulnerable Pop. + HV01-27 +
+ {{ MOH731RegisterData.prep_new_vulnerable_male }} +
+
+
+ HV01-28 +
+ {{ MOH731RegisterData.prep_new_vulnerable_female }} +
+
+
AYP (10-24yrs) + HV01-29 +
{{ MOH731RegisterData.prep_new_ayp }}
+
+
+ HV01-30 +
+ {{ MOH731RegisterData.prep_new_ayp }} +
+
+
Pregnant and breastfeeding women +
+ HV01-31 +
+ {{ MOH731RegisterData.prep_new_preg_breastfeeding }} +
+
+
+ 1.5 No. Seroconverted while on PrEP +
MaleFemale
HIV Positive + HV01-45 +
+ {{ MOH731RegisterData.seroconverted_male }} +
+
+
+ HV01-46 +
+ {{ MOH731RegisterData.seroconverted_female }} +
+
+
+ 1.2 HIV Positive Results +
MaleFemale
Positive_2-9 + HV01-06 +
{{ MOH731RegisterData.male_2_9 }}
+
+
+ HV01-07 +
{{ MOH731RegisterData.female_2_9 }}
+
+
Positive_10-14 + HV01-08 +
{{ MOH731RegisterData.male_10_14 }}
+
+
+ HV01-09 +
+ {{ MOH731RegisterData.female_10_14 }} +
+
+
Positive_15-19 + HV01-10 +
{{ MOH731RegisterData.male_15_19 }}
+
+
+ HV01-11 +
+ {{ MOH731RegisterData.female_15_19 }} +
+
+
Positive_20-24 + HV01-12 +
{{ MOH731RegisterData.male_20_24 }}
+
+
+ HV01-13 +
+ {{ MOH731RegisterData.female_20_24 }} +
+
+
Positive_25+ + HV01-14 +
+ {{ MOH731RegisterData.male_25_above }} +
+
+
+ HV01-15 +
+ {{ MOH731RegisterData.female_25_above }} +
+
+
Positive_KVP + HV01-16 +
+
Discordant + HV01-17 +
+
+
+ HV01-18 +
+
+
Inconclusive Test Results + HV01-47 +
+
+
+ HV01-48 +
+
+
+ 1.4 No. on PrEP Diagnosed with STI +
MaleFemale
General popn + HV01-32 +
+ {{ MOH731RegisterData.prep_sti_male_general_pop }} +
+
+
+ HV01-33 +
+ {{ MOH731RegisterData.prep_sti_female_general_pop }} +
+
+
MSM/MSW + HV01-34 +
{{ MOH731RegisterData.prep_sti_msm }}
+
FSW + HV01-35 +
{{ MOH731RegisterData.prep_sti_fsw }}
+
PWID/PWUD + HV01-36 +
+ {{ MOH731RegisterData.prep_sti_pwud_male }} +
+
+
+ HV01-37 +
+ {{ MOH731RegisterData.prep_sti_pwud_female }} +
+
+
Discordant Couple + HV01-38 +
+ {{ MOH731RegisterData.prep_sti_discordant_male }} +
+
+
+ HV01-39 +
+ {{ MOH731RegisterData.prep_sti_discordant_female }} +
+
+
Vulnerable Pop. + HV01-40 +
+ {{ MOH731RegisterData.prep_sti_vulnerable_male }} +
+
+
+ HV01-41 +
+ {{ MOH731RegisterData.prep_sti_vulnerable_female }} +
+
+
AYP(10-24 yrs) + HV01-42 +
{{ MOH731RegisterData.prep_sti_ayp }}
+
+
+ HV01-43 +
+ {{ MOH731RegisterData.prep_sti_ayp }} +
+
+
Pregnant and breastfeeding women +
+ HV01-44 +
+ {{ MOH731RegisterData.prep_sti_preg_breastfeeding }} +
+
+
+ 2. Elimination of Mother-to-Child Transmission(EMTCT) +
+ 2.1 Maternal HIV Testing +
Known Positive at 1st ANC + HV02-01 +
+ {{ MOH731RegisterData.known_positive_1st_anc }} +
+
InitialRetest
Tested at ANC + HV02-02 +
+ {{ MOH731RegisterData.initial_test_anc }} +
+
+
+ HV02-03 +
{{ MOH731RegisterData.retest_anc }}
+
+
Tested at L&D + HV02-04 +
+ {{ MOH731RegisterData.initial_test_LD }} +
+
+
+ HV02-05 +
{{ MOH731RegisterData.retest_LD }}
+
+
Tested at PNC_<=6weeks + HV02-06 +
+ {{ MOH731RegisterData.initial_test_pnc_less_6_weeks }} +
+
+
+ HV02-07 +
+ {{ MOH731RegisterData.retest_pnc_less_6_weeks }} +
+
+
Tested at PNC_>6weeks + HV02-08 +
+ {{ MOH731RegisterData.initial_test_pnc_greater_6_weeks }} +
+
+
+ HV02-09 +
+ {{ MOH731RegisterData.retest_pnc_greater_6_weeks }} +
+
+
+ 2.2 HIV Positive Results +
Tested at ANC + HV02-10 +
{{ MOH731RegisterData.positive_anc }}
+
Tested at L&D + HV02-11 +
{{ MOH731RegisterData.positive_LD }}
+
Tested at PNC_<=6weeks + HV02-12 +
+ {{ MOH731RegisterData.positive_pnc_less_6_weeks }} +
+
Tested at PNC_>6weeks + HV02-13 +
+ {{ MOH731RegisterData.positive_pnc_greater_6_weeks }} +
+
+ 2.3 Maternal HAART +
On HAART at 1st ANC + HV02-14 +
+ {{ MOH731RegisterData.maternal_haart_1st_anc }} +
+
Start HAART_ANC + HV02-15 +
+ {{ MOH731RegisterData.start_maternal_haart_1st_anc }} +
+
Start HAART_L&D + HV02-16 +
+ {{ MOH731RegisterData.start_maternal_haart_LD }} +
+
Start HAART_PNC_< =6weeks + HV02-17 +
+ {{ MOH731RegisterData.maternal_haart_less_6_weeks }} +
+
Start HAART_PNC_>6weeks + HV02-18 +
+ {{ MOH731RegisterData.maternal_haart_more_6_weeks }} +
+
+ 2.4 HBV Screening at ANC +
Screened_HBV_ANC + HV02-19 +
+
HBV Screened_Positive + HV02-20 +
+ {{ MOH731RegisterData.hbv_screened_positive_anc }} +
+
+ 2.5 Adolescents girls & Young Women (10-24 Yrs)
+ testing & results +
10-19yrs20-24yrs
1st ANC KP + HV02-21 +
+ {{ MOH731RegisterData.known_positive_anc_10_19 }} +
+
+
+ HV02-22 +
+ {{ MOH731RegisterData.known_positive_anc_20_24 }} +
+
+
New HIV Positive + HV02-23 +
+ {{ MOH731RegisterData.positive_anc_ld_pnc_10_19 }} +
+
+
+ HV02-24 +
+ {{ MOH731RegisterData.positive_anc_ld_pnc_20_24 }} +
+
+
On HAART 1st ANC KP + HV02-25 +
+ {{ MOH731RegisterData.on_art_anc_10_19 }} +
+
+
+ HV02-26 +
+ {{ MOH731RegisterData.on_art_anc_20_24 }} +
+
+
Started HAART New + HV02-27 +
+ {{ MOH731RegisterData.start_art_10_19 }} +
+
+
+ HV02-28 +
+ {{ MOH731RegisterData.start_art_20_24 }} +
+
+
+ 2.6 Infant Prophylaxis +
Infant ARV Prophylaxis_ANC + HV02-29 +
+ {{ MOH731RegisterData.infant_arv_anc }} +
+
Infant ARV Prophylaxis_L&D + HV02-30 +
+ {{ MOH731RegisterData.infant_arv_ld }} +
+
Infant ARV Prophylaxis_L&PNC + HV02-31 +
+ {{ MOH731RegisterData.infant_arv_pnc }} +
+
+ 2.7 Infant Feeding +
Below 6 months
Exclusive Breastfeeding (EBF) + HV02-32 +
{{ MOH731RegisterData.exclusive_bf }}
+
6 to 24 months
Breastfeeding (BF) + HV02-33 +
{{ MOH731RegisterData.bf }}
+
Not Breastfeeding (NBF) + HV02-34 +
{{ MOH731RegisterData.weaning }}
+
3. HIV and TB treatment
+ 3.1 Starting ART +
Start ART_<1 + (M) HV03-01 +
+ {{ MOH731RegisterData.art_new_less_1_male }} +
+
+
+ (F) HV03-02 +
+ {{ MOH731RegisterData.art_new_less_1_female }} +
+
+
Start ART 1-4 + (M) HV03-03 +
+ {{ MOH731RegisterData.art_new_1_4_male }} +
+
+
+ (F) HV03-04 +
+ {{ MOH731RegisterData.art_new_1_4_female }} +
+
+
Start ART 5-9 + (M) HV03-05 +
+ {{ MOH731RegisterData.art_new_5_9_male }} +
+
+
+ (F) HV03-06 +
+ {{ MOH731RegisterData.art_new_5_9_female }} +
+
+
Start ART 10-14 + (M) HV03-07 +
+ {{ MOH731RegisterData.art_new_10_14_male }} +
+
+
+ (F) HV03-08 +
+ {{ MOH731RegisterData.art_new_10_14_female }} +
+
+
Start ART 15-19 + (M) HV03-09 +
+ {{ MOH731RegisterData.art_new_15_19_male }} +
+
+
+ (F) HV03-10 +
+ {{ MOH731RegisterData.art_new_15_19_female }} +
+
+
Start ART 20-24 + (M) HV03-11 +
+ {{ MOH731RegisterData.art_new_20_24_male }} +
+
+
+ (F) HV03-12 +
+ {{ MOH731RegisterData.art_new_20_24_female }} +
+
+
Start ART 25+ + (M) HV03-013 +
+ {{ MOH731RegisterData.art_new_25_above_male }} +
+
+
+ (F) HV03-014 +
+ {{ MOH731RegisterData.art_new_25_above_female }} +
+
+
+ 3.2 Curently on ART ([ALL]) +
On ART_<1 + (M) HV03-015 +
+ {{ MOH731RegisterData.on_art_less_1_male }} +
+
+
+ (F) HV03-016 +
+ {{ MOH731RegisterData.on_art_less_1_female }} +
+
+
On ART 1-4 + (M) HV03-017 +
+ {{ MOH731RegisterData.on_art_1_4_male }} +
+
+
+ (F) HV03-018 +
+ {{ MOH731RegisterData.on_art_1_4_female }} +
+
+
On ART 5-9 + (M) HV03-019 +
+ {{ MOH731RegisterData.on_art_5_9_male }} +
+
+
+ (F) HV03-020 +
+ {{ MOH731RegisterData.on_art_5_9_female }} +
+
+
On ART 10-14 + (M) HV03-021 +
+ {{ MOH731RegisterData.on_art_10_14_male }} +
+
+
+ (F) HV03-022 +
+ {{ MOH731RegisterData.on_art_10_14_female }} +
+
+
On ART 15-19 + (M) HV03-023 +
+ {{ MOH731RegisterData.on_art_15_19_male }} +
+
+
+ (F) HV03-024 +
+ {{ MOH731RegisterData.on_art_15_19_female }} +
+
+
On ART 20-24 + (M) HV03-025 +
+ {{ MOH731RegisterData.on_art_20_24_male }} +
+
+
+ (F) HV03-026 +
+ {{ MOH731RegisterData.on_art_20_24_female }} +
+
+
On ART 25+ + (M) HV03-027 +
+ {{ MOH731RegisterData.on_art_25_above_male }} +
+
+
+ (F) HV03-028 +
+ {{ MOH731RegisterData.on_art_25_above_female }} +
+
+
+ 3.3 TB Screening +
Screened for TB_<15 + HV03-029 +
+ {{ MOH731RegisterData.screened_tb_less_15 }} +
+
Screened for TB_15+ + HV03-030 +
+ {{ MOH731RegisterData.screened_tb_greater_15 }} +
+
+ 3.4 Starting TPT +
Start TPT_<15 + HV03-031 +
+ {{ MOH731RegisterData.start_tpt_less_15 }} +
+
Start TPT_15+ + HV03-032 +
+ {{ MOH731RegisterData.start_tpt_greater_15 }} +
+
+ 3.5 Differentiated Service Delivery +
Established + HV03-033 +
{{ MOH731RegisterData.established }}
+
Not Established + HV03-034 +
+ {{ MOH731RegisterData.not_established }} +
+
Community + HV03-035 +
{{ MOH731RegisterData.community }}
+
Facility + HV03-036 +
{{ MOH731RegisterData.facility }}
+
+ 3.6 Nutrition and HIV +
Number SAM +
0-5Months + HV03-037 +
+ {{ MOH731RegisterData.has_sam_0_5_months }} +
+
6-59Months + HV03-038 +
+ {{ MOH731RegisterData.has_sam_6_59_months }} +
+
5-9Years + HV03-039 +
+ {{ MOH731RegisterData.has_sam_5_9_years }} +
+
10-17Years + HV03-040 +
+ {{ MOH731RegisterData.has_sam_10_17_years }} +
+
18+Years + HV03-041 +
+ {{ MOH731RegisterData.has_sam_18_and_above_years }} +
+
Pregnant & Lactating + HV03-042 +
+
Number MAM +
0-5Months + HV03-043 +
+ {{ MOH731RegisterData.has_smm_0_5_months }} +
+
6-59Months + HV03-044 +
+ {{ MOH731RegisterData.has_smm_6_59_months }} +
+
5-9Years + HV03-045 +
+ {{ MOH731RegisterData.has_smm_5_9_years }} +
+
10-17Years + HV03-046 +
+ {{ MOH731RegisterData.has_smm_10_17_years }} +
+
18+Years + HV03-047 +
+ {{ MOH731RegisterData.has_smm_18_and_above_years }} +
+
Pregnant & Lactating + HV03-048 +
+
Number SAM + receiving therapeutic foods
0-5Months + HV03-049 +
+ {{ MOH731RegisterData.severe_acute_supp_0_5_months }} +
+
6-59Months + HV03-050 +
+ {{ MOH731RegisterData.severe_acute_supp_6_59_months }} +
+
5-9Years + HV03-051 +
+ {{ MOH731RegisterData.severe_acute_supp_5_9_years }} +
+
10-17Years + HV03-052 +
+ {{ MOH731RegisterData.severe_acute_supp_10_17_years }} +
+
18+Years + HV03-053 +
+ {{ MOH731RegisterData.severe_acute_supp_18_and_above_years }} +
+
Pregnant & Lactating + HV03-054 +
+
Number MAM + receiving Supplimental foods
0-5Months + HV03-055 +
+ {{ MOH731RegisterData.severe_moderate_supp_0_5_months }} +
+
6-59Months + HV03-056 +
+ {{ MOH731RegisterData.severe_moderate_supp_6_59_months }} +
+
5-9Years + HV03-057 +
+ {{ MOH731RegisterData.severe_moderate_supp_5_9_years }} +
+
10-17Years + HV03-058 +
+ {{ MOH731RegisterData.severe_moderate_supp_10_17_years }} +
+
18+Years + HV03-059 +
+ {{ MOH731RegisterData.severe_moderate_supp_18_and_above_years }} +
+
Pregnant & Lactating + HV03-060 +
+
+ 3.7 HIV in TB Clinic +
TB cases_New + HV03-061 +
{{ MOH731RegisterData.start_tb }}
+
+ TB_New_Known HIV
+ Positive(KPs) +
+ HV03-062 +
+ {{ MOH731RegisterData.start_tb_known_positive }} +
+
TB_New HIV Positive + HV03-063 +
+ {{ MOH731RegisterData.start_tb_positive }} +
+
+ TB_New_Known HIV
+ Positive(KP) on HAART +
+ HV03-064 +
+ {{ MOH731RegisterData.start_tb_on_art }} +
+
TB New_Start_HAART + HV03-065 +
+ {{ MOH731RegisterData.start_tb_art_new }} +
+
4. Medical Male Circumcision
+ 4.1 Number circumcised +
Circumcised_0-60 days + HV04-01 +
+
Circumcised_61 days -9 yrs days + HV04-02 +
+
Circumcised_10-14 + HV04-03 +
+
Circumcised_15 + + HV04-04 +
+
Tested_ HIV+ + HV04-05 +
+
Tested_ HIV- + HV04-06 +
+
+ 4.2 Type of circumcission +
Surgical + HV04-07 +
+
Devices + HV04-08 +
+
+ 4.3 Circumcission Adverse Events +
AE_During_Moderate + HV04-09 +
+
AE_During_Severe + HV04-10 +
+
AE_Post_Moderate + HV04-11 +
+
AE_Post_Severe + HV04-12 +
+
Follow up visit < 14d + HV04-13 +
+
5. Post Exposure Prophylaxis
Exposed_Occupational + HV05-01 +
+ {{ MOH731RegisterData.exposed_occupational }} +
+
Exposed Other + HV05-02 +
+ {{ MOH731RegisterData.exposed_non_occupational }} +
+
PEP_Occupational + HV05-03 +
+ {{ MOH731RegisterData.pep_occupational }} +
+
PEP_Other + HV05-04 +
+ {{ MOH731RegisterData.pep_non_occupational }} +
+
+
diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.spec.ts b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.spec.ts new file mode 100644 index 000000000..be41a84ae --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Moh731ReportViewComponent } from './moh731-report-view.component'; + +describe('Moh731ReportViewComponent', () => { + let component: Moh731ReportViewComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [Moh731ReportViewComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(Moh731ReportViewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.ts b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.ts new file mode 100644 index 000000000..2a5723a2a --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/moh731-report-view/moh731-report-view.component.ts @@ -0,0 +1,210 @@ +import { + Component, + ElementRef, + EventEmitter, + Input, + OnInit, + Output, + ViewChild +} from '@angular/core'; +import * as _ from 'lodash'; +import * as Moment from 'moment'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; +import { ActivatedRoute, Router } from '@angular/router'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; +import { DatePipe } from '@angular/common'; +import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/services/data-analytics-dashboard.services'; + +@Component({ + selector: 'app-moh731-report-view', + templateUrl: './moh731-report-view.component.html', + styleUrls: ['./moh731-report-view.component.css'] +}) +export class Moh731ReportViewComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + @Input() MOH731RegisterData: any; + @Output() generateReportEvent = new EventEmitter(); + @Output() indicatorSelectedEvent = new EventEmitter(); + public columnDefs: any = []; + public reportName = 'MOH 731 REPORT'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + public jointLocationUuids = []; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'datesControl, locationControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = true; + public generated = false; + public showIsAggregateControl = false; + public showLocationsControl = true; + @ViewChild('cntdarcontentToSnapshot') contentToSnapshot!: ElementRef; + + 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; + } + + private _startDate: Date = Moment() + .subtract(1, 'months') + .startOf('month') + .toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = Moment() + .subtract(1, 'months') + .endOf('month') + .toDate(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + + constructor( + public router: Router, + public route: ActivatedRoute, + public register: RegistersResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment().format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).format('YYYY-MM-DD'); + } + + public storeParamsInUrl() { + this.params = { + locationUuids: this.getSelectedLocations(this.jointLocationUuids), + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + public generateReport(): any { + this.generateReportEvent.emit(); + } + + public calculateTotalSummary() { + const totalsRow = []; + if (this.MOH731RegisterData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.MOH731RegisterData, (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.indicatorSelectedEvent.emit(value); + } + + public showDraftReportAlert(date) { + 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 731 Register.pdf'); + }); + } + + private getSelectedLocations(locationUuids: any): string { + if (!locationUuids || locationUuids.length === 0) { + return ''; + } + + let selectedLocations = ''; + + for (let i = 0; i < locationUuids.length; i++) { + if (i === 0) { + selectedLocations = selectedLocations + (locationUuids[0] as any).value; + } else { + selectedLocations = + selectedLocations + ',' + (locationUuids[i] as any).value; + } + } + return selectedLocations; + } +} diff --git a/src/app/data-analytics-dashboard/hiv/report731/report731.component.css b/src/app/data-analytics-dashboard/hiv/report731/report731.component.css new file mode 100644 index 000000000..2e970f9a7 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/report731.component.css @@ -0,0 +1,69 @@ +.table { + border: 2px solid #000; +} + +.border { + background-color: #f2f2f2; + border-bottom: 2px solid #000; + width: 100%; +} +.border2 { + background-color: #f2f2f2; + border-top: 2px solid #000; + border-bottom: 2px solid #000; + width: 100%; +} + +.border3 { + border-top: 2px solid #000; + border-right: 2px dotted #000; + width: 78.5%; +} + +.flex-column { + display: flex; + flex-direction: column; + margin: 1%; +} + +.flex-row { + display: flex; + justify-content: space-between; +} +.rectangle { + width: 50px; + height: 20px; + border: 2px solid #000; + display: inline-block; + margin-left: 5px; + text-align: center; +} +.text-box { + display: flex; + align-items: center; + gap: 8px; +} +.text-box2 { + margin-left: 10px; +} +.space-after { + padding-right: 6vw; +} +.border-right { + border-right: 2px dotted #000; + padding-right: 4vw; +} +.border-left { + border-left: 2px dotted #000; + padding-left: 1vw; +} + +.review-section { + display: grid; + grid-template-columns: repeat(5, 1fr); + column-gap: 20px; + text-align: center; + font-size: 14px; + margin-top: 10px; + font-weight: bold; +} diff --git a/src/app/data-analytics-dashboard/hiv/report731/report731.component.html b/src/app/data-analytics-dashboard/hiv/report731/report731.component.html new file mode 100644 index 000000000..c7b56c9c9 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/report731.component.html @@ -0,0 +1,2879 @@ +

+ {{ reportName }} +

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

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

+

+ {{ errorMessage }} +

+
+
+
+
+ Ministry Of Health +
+
+ Ver. July 2023 +
+
+
+ + + + +
+ National AIDS & STI Control Program- NASCOP
+ Comprehensive HIV/ AIDS reporting form +
+ (MOH 731-Ver. July 2023) +
+
+
+ + + + +
+ County______________________SubCounty___________________Facility___________________MFL_______Month______year______ +
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + ____________________________________________________________________ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Reviewed by:
+
Name
+
Designation
+
Signature
+
Date
+ +
+
_______________________________________
+
______________________
+
_____________
+
____________
+
+ +
1. HIV Testing & Pre exposure Prophylaxis
1.1 HIV Tests
Male + Female(Including
+ PMTCT) +
Tests + HV01-01 +
{{ MOH731RegisterData.hiv_male }}
+
+
+ HV01-02 +
{{ MOH731RegisterData.hiv_female }}
+
+
Tests_Facility + HV01-03 +
+ {{ MOH731RegisterData.hiv_setting_facility }} +
+
Tests_Community + HV01-04 +
+ {{ MOH731RegisterData.hiv_setting_community }} +
+
Tested KVP + HV01-05 +
+ {{ MOH731RegisterData.hiv_setting_kvp }} +
+
+ 1.3 No. Initiated on PrEP(NEW) +
MaleFemale
General popn + HV01-19 +
+ {{ MOH731RegisterData.prep_new_male_general_pop }} +
+
+
+ HV01-20 +
+ {{ MOH731RegisterData.prep_new_female_general_pop }} +
+
+
MSM/MSW + HV01-21 +
{{ MOH731RegisterData.prep_new_msm }}
+
FSW +
+ HV01-22 +
+ {{ MOH731RegisterData.prep_new_fsw }} +
+
+
PWID/PWUD + HV01-23 +
+ {{ MOH731RegisterData.prep_new_pwud_male }} +
+
+
+ HV01-24 +
+ {{ MOH731RegisterData.prep_new_pwud_female }} +
+
+
Discordant Couple + HV01-25 +
+ {{ MOH731RegisterData.prep_new_discordant_male }} +
+
+
+ HV01-26 +
+ {{ MOH731RegisterData.prep_new_discordant_female }} +
+
+
Vulnerable Pop. + HV01-27 +
+ {{ MOH731RegisterData.prep_new_vulnerable_male }} +
+
+
+ HV01-28 +
+ {{ MOH731RegisterData.prep_new_vulnerable_female }} +
+
+
AYP (10-24yrs) + HV01-29 +
{{ MOH731RegisterData.prep_new_ayp }}
+
+
+ HV01-30 +
+ {{ MOH731RegisterData.prep_new_ayp }} +
+
+
Pregnant and breastfeeding women +
+ HV01-31 +
+ {{ MOH731RegisterData.prep_new_preg_breastfeeding }} +
+
+
+ 1.5 No. Seroconverted while on PrEP +
MaleFemale
HIV Positive + HV01-45 +
+ {{ MOH731RegisterData.seroconverted_male }} +
+
+
+ HV01-46 +
+ {{ MOH731RegisterData.seroconverted_female }} +
+
+
+ 1.2 HIV Positive Results +
MaleFemale
Positive_2-9 + HV01-06 +
{{ MOH731RegisterData.male_2_9 }}
+
+
+ HV01-07 +
{{ MOH731RegisterData.female_2_9 }}
+
+
Positive_10-14 + HV01-08 +
{{ MOH731RegisterData.male_10_14 }}
+
+
+ HV01-09 +
+ {{ MOH731RegisterData.female_10_14 }} +
+
+
Positive_15-19 + HV01-10 +
{{ MOH731RegisterData.male_15_19 }}
+
+
+ HV01-11 +
+ {{ MOH731RegisterData.female_15_19 }} +
+
+
Positive_20-24 + HV01-12 +
{{ MOH731RegisterData.male_20_24 }}
+
+
+ HV01-13 +
+ {{ MOH731RegisterData.female_20_24 }} +
+
+
Positive_25+ + HV01-14 +
+ {{ MOH731RegisterData.male_25_above }} +
+
+
+ HV01-15 +
+ {{ MOH731RegisterData.female_25_above }} +
+
+
Positive_KVP + HV01-16 +
+
Discordant + HV01-17 +
+
+
+ HV01-18 +
+
+
Inconclusive Test Results + HV01-47 +
+
+
+ HV01-48 +
+
+
+ 1.4 No. on PrEP Diagnosed with STI +
MaleFemale
General popn + HV01-32 +
+ {{ MOH731RegisterData.prep_sti_male_general_pop }} +
+
+
+ HV01-33 +
+ {{ MOH731RegisterData.prep_sti_female_general_pop }} +
+
+
MSM/MSW + HV01-34 +
{{ MOH731RegisterData.prep_sti_msm }}
+
FSW + HV01-35 +
{{ MOH731RegisterData.prep_sti_fsw }}
+
PWID/PWUD + HV01-36 +
+ {{ MOH731RegisterData.prep_sti_pwud_male }} +
+
+
+ HV01-37 +
+ {{ MOH731RegisterData.prep_sti_pwud_female }} +
+
+
Discordant Couple + HV01-38 +
+ {{ MOH731RegisterData.prep_sti_discordant_male }} +
+
+
+ HV01-39 +
+ {{ MOH731RegisterData.prep_sti_discordant_female }} +
+
+
Vulnerable Pop. + HV01-40 +
+ {{ MOH731RegisterData.prep_sti_vulnerable_male }} +
+
+
+ HV01-41 +
+ {{ MOH731RegisterData.prep_sti_vulnerable_female }} +
+
+
AYP(10-24 yrs) + HV01-42 +
{{ MOH731RegisterData.prep_sti_ayp }}
+
+
+ HV01-43 +
+ {{ MOH731RegisterData.prep_sti_ayp }} +
+
+
Pregnant and breastfeeding women +
+ HV01-44 +
+ {{ MOH731RegisterData.prep_sti_preg_breastfeeding }} +
+
+
+ 2. Elimination of Mother-to-Child Transmission(EMTCT) +
+ 2.1 Maternal HIV Testing +
Known Positive at 1st ANC + HV02-01 +
+ {{ MOH731RegisterData.known_positive_1st_anc }} +
+
InitialRetest
Tested at ANC + HV02-02 +
+ {{ MOH731RegisterData.initial_test_anc }} +
+
+
+ HV02-03 +
{{ MOH731RegisterData.retest_anc }}
+
+
Tested at L&D + HV02-04 +
+ {{ MOH731RegisterData.initial_test_LD }} +
+
+
+ HV02-05 +
{{ MOH731RegisterData.retest_LD }}
+
+
Tested at PNC_<=6weeks + HV02-06 +
+ {{ MOH731RegisterData.initial_test_pnc_less_6_weeks }} +
+
+
+ HV02-07 +
+ {{ MOH731RegisterData.retest_pnc_less_6_weeks }} +
+
+
Tested at PNC_>6weeks + HV02-08 +
+ {{ MOH731RegisterData.initial_test_pnc_greater_6_weeks }} +
+
+
+ HV02-09 +
+ {{ MOH731RegisterData.retest_pnc_greater_6_weeks }} +
+
+
+ 2.2 HIV Positive Results +
Tested at ANC + HV02-10 +
{{ MOH731RegisterData.positive_anc }}
+
Tested at L&D + HV02-11 +
{{ MOH731RegisterData.positive_LD }}
+
Tested at PNC_<=6weeks + HV02-12 +
+ {{ MOH731RegisterData.positive_pnc_less_6_weeks }} +
+
Tested at PNC_>6weeks + HV02-13 +
+ {{ MOH731RegisterData.positive_pnc_greater_6_weeks }} +
+
+ 2.3 Maternal HAART +
On HAART at 1st ANC + HV02-14 +
+ {{ MOH731RegisterData.maternal_haart_1st_anc }} +
+
Start HAART_ANC + HV02-15 +
+ {{ MOH731RegisterData.start_maternal_haart_1st_anc }} +
+
Start HAART_L&D + HV02-16 +
+ {{ MOH731RegisterData.start_maternal_haart_LD }} +
+
Start HAART_PNC_< =6weeks + HV02-17 +
+ {{ MOH731RegisterData.maternal_haart_less_6_weeks }} +
+
Start HAART_PNC_>6weeks + HV02-18 +
+ {{ MOH731RegisterData.maternal_haart_more_6_weeks }} +
+
+ 2.4 HBV Screening at ANC +
Screened_HBV_ANC + HV02-19 +
+
HBV Screened_Positive + HV02-20 +
+ {{ MOH731RegisterData.hbv_screened_positive_anc }} +
+
+ 2.5 Adolescents girls & Young Women (10-24 Yrs)
+ testing & results +
10-19yrs20-24yrs
1st ANC KP + HV02-21 +
+ {{ MOH731RegisterData.known_positive_ayp_10_19 }} +
+
+
+ HV02-22 +
+ {{ MOH731RegisterData.known_positive_ayp_20_24 }} +
+
+
New HIV Positive + HV02-23 +
+ {{ MOH731RegisterData.new_positive_ayp_10_19 }} +
+
+
+ HV02-24 +
+ {{ MOH731RegisterData.new_positive_ayp_20_24 }} +
+
+
On HAART 1st ANC KP + HV02-25 +
+ {{ MOH731RegisterData.on_art_ayp_10_19 }} +
+
+
+ HV02-26 +
+ {{ MOH731RegisterData.on_art_ayp_20_24 }} +
+
+
Started HAART New + HV02-27 +
+ {{ MOH731RegisterData.start_art_ayp_10_19 }} +
+
+
+ HV02-28 +
+ {{ MOH731RegisterData.start_art_ayp_20_24 }} +
+
+
+ 2.6 Infant Prophylaxis +
Infant ARV Prophylaxis_ANC + HV02-29 +
+ {{ MOH731RegisterData.infant_arv_anc }} +
+
Infant ARV Prophylaxis_L&D + HV02-30 +
+ {{ MOH731RegisterData.infant_arv_ld }} +
+
Infant ARV Prophylaxis_L&PNC + HV02-31 +
+ {{ MOH731RegisterData.infant_arv_pnc }} +
+
+ 2.7 Infant Feeding +
Below 6 months
Exclusive Breastfeeding (EBF) + HV02-32 +
{{ MOH731RegisterData.exclusive_bf }}
+
6 to 24 months
Breastfeeding (BF) + HV02-33 +
{{ MOH731RegisterData.bf }}
+
Not Breastfeeding (NBF) + HV02-34 +
{{ MOH731RegisterData.weaning }}
+
3. HIV and TB treatment
+ 3.1 Starting ART +
Start ART_<1 + (M) HV03-01 +
+ {{ MOH731RegisterData.art_new_less_1_male }} +
+
+
+ (F) HV03-02 +
+ {{ MOH731RegisterData.art_new_less_1_female }} +
+
+
Start ART 1-4 + (M) HV03-03 +
+ {{ MOH731RegisterData.art_new_1_4_male }} +
+
+
+ (F) HV03-04 +
+ {{ MOH731RegisterData.art_new_1_4_female }} +
+
+
Start ART 5-9 + (M) HV03-05 +
+ {{ MOH731RegisterData.art_new_5_9_male }} +
+
+
+ (F) HV03-06 +
+ {{ MOH731RegisterData.art_new_5_9_female }} +
+
+
Start ART 10-14 + (M) HV03-07 +
+ {{ MOH731RegisterData.art_new_10_14_male }} +
+
+
+ (F) HV03-08 +
+ {{ MOH731RegisterData.art_new_10_14_female }} +
+
+
Start ART 15-19 + (M) HV03-09 +
+ {{ MOH731RegisterData.art_new_15_19_male }} +
+
+
+ (F) HV03-10 +
+ {{ MOH731RegisterData.art_new_15_19_female }} +
+
+
Start ART 20-24 + (M) HV03-11 +
+ {{ MOH731RegisterData.art_new_20_24_male }} +
+
+
+ (F) HV03-12 +
+ {{ MOH731RegisterData.art_new_20_24_female }} +
+
+
Start ART 25+ + (M) HV03-013 +
+ {{ MOH731RegisterData.art_new_25_above_male }} +
+
+
+ (F) HV03-014 +
+ {{ MOH731RegisterData.art_new_25_above_female }} +
+
+
+ 3.2 Curently on ART ([ALL]) +
On ART_<1 + (M) HV03-015 +
+ {{ MOH731RegisterData.on_art_less_1_male }} +
+
+
+ (F) HV03-016 +
+ {{ MOH731RegisterData.on_art_less_1_female }} +
+
+
On ART 1-4 + (M) HV03-017 +
+ {{ MOH731RegisterData.on_art_1_4_male }} +
+
+
+ (F) HV03-018 +
+ {{ MOH731RegisterData.on_art_1_4_female }} +
+
+
On ART 5-9 + (M) HV03-019 +
+ {{ MOH731RegisterData.on_art_5_9_male }} +
+
+
+ (F) HV03-020 +
+ {{ MOH731RegisterData.on_art_5_9_female }} +
+
+
On ART 10-14 + (M) HV03-021 +
+ {{ MOH731RegisterData.on_art_10_14_male }} +
+
+
+ (F) HV03-022 +
+ {{ MOH731RegisterData.on_art_10_14_female }} +
+
+
On ART 15-19 + (M) HV03-023 +
+ {{ MOH731RegisterData.on_art_15_19_male }} +
+
+
+ (F) HV03-024 +
+ {{ MOH731RegisterData.on_art_15_19_female }} +
+
+
On ART 20-24 + (M) HV03-025 +
+ {{ MOH731RegisterData.on_art_20_24_male }} +
+
+
+ (F) HV03-026 +
+ {{ MOH731RegisterData.on_art_20_24_female }} +
+
+
On ART 25+ + (M) HV03-027 +
+ {{ MOH731RegisterData.on_art_25_above_male }} +
+
+
+ (F) HV03-028 +
+ {{ MOH731RegisterData.on_art_25_above_female }} +
+
+
+ 3.3 TB Screening +
Screened for TB_<15 + HV03-029 +
+ {{ MOH731RegisterData.screened_tb_less_15 }} +
+
Screened for TB_15+ + HV03-030 +
+ {{ MOH731RegisterData.screened_tb_greater_15 }} +
+
+ 3.4 Starting TPT +
Start TPT_<15 + HV03-031 +
+ {{ MOH731RegisterData.start_tpt_less_15 }} +
+
Start TPT_15+ + HV03-032 +
+ {{ MOH731RegisterData.start_tpt_greater_15 }} +
+
+ 3.5 Differentiated Service Delivery +
Established + HV03-033 +
{{ MOH731RegisterData.established }}
+
Not Established + HV03-034 +
+ {{ MOH731RegisterData.not_established }} +
+
Community + HV03-035 +
{{ MOH731RegisterData.community }}
+
Facility + HV03-036 +
{{ MOH731RegisterData.facility }}
+
+ 3.6 Nutrition and HIV +
Number SAM +
0-5Months + HV03-037 +
+ {{ MOH731RegisterData.has_sam_0_5_months }} +
+
6-59Months + HV03-038 +
+ {{ MOH731RegisterData.has_sam_6_59_months }} +
+
5-9Years + HV03-039 +
+ {{ MOH731RegisterData.has_sam_5_9_years }} +
+
10-17Years + HV03-040 +
+ {{ MOH731RegisterData.has_sam_10_17_years }} +
+
18+Years + HV03-041 +
+ {{ MOH731RegisterData.has_sam_18_and_above_years }} +
+
Pregnant & Lactating + HV03-042 +
+
Number MAM +
0-5Months + HV03-043 +
+ {{ MOH731RegisterData.has_smm_0_5_months }} +
+
6-59Months + HV03-044 +
+ {{ MOH731RegisterData.has_smm_6_59_months }} +
+
5-9Years + HV03-045 +
+ {{ MOH731RegisterData.has_smm_5_9_years }} +
+
10-17Years + HV03-046 +
+ {{ MOH731RegisterData.has_smm_10_17_years }} +
+
18+Years + HV03-047 +
+ {{ MOH731RegisterData.has_smm_18_and_above_years }} +
+
Pregnant & Lactating + HV03-048 +
+
Number SAM + receiving therapeutic foods
0-5Months + HV03-049 +
+ {{ MOH731RegisterData.severe_acute_supp_0_5_months }} +
+
6-59Months + HV03-050 +
+ {{ MOH731RegisterData.severe_acute_supp_6_59_months }} +
+
5-9Years + HV03-051 +
+ {{ MOH731RegisterData.severe_acute_supp_5_9_years }} +
+
10-17Years + HV03-052 +
+ {{ MOH731RegisterData.severe_acute_supp_10_17_years }} +
+
18+Years + HV03-053 +
+ {{ MOH731RegisterData.severe_acute_supp_18_and_above_years }} +
+
Pregnant & Lactating + HV03-054 +
+
Number MAM + receiving Supplimental foods
0-5Months + HV03-055 +
+ {{ MOH731RegisterData.severe_moderate_supp_0_5_months }} +
+
6-59Months + HV03-056 +
+ {{ MOH731RegisterData.severe_moderate_supp_6_59_months }} +
+
5-9Years + HV03-057 +
+ {{ MOH731RegisterData.severe_moderate_supp_5_9_years }} +
+
10-17Years + HV03-058 +
+ {{ MOH731RegisterData.severe_moderate_supp_10_17_years }} +
+
18+Years + HV03-059 +
+ {{ MOH731RegisterData.severe_moderate_supp_18_and_above_years }} +
+
Pregnant & Lactating + HV03-060 +
+
+ 3.7 HIV in TB Clinic +
TB cases_New + HV03-061 +
{{ MOH731RegisterData.start_tb }}
+
+ TB_New_Known HIV
+ Positive(KPs) +
+ HV03-062 +
+ {{ MOH731RegisterData.start_tb_known_positive }} +
+
TB_New HIV Positive + HV03-063 +
+ {{ MOH731RegisterData.start_tb_positive }} +
+
+ TB_New_Known HIV
+ Positive(KP) on HAART +
+ HV03-064 +
+ {{ MOH731RegisterData.start_tb_on_art }} +
+
TB New_Start_HAART + HV03-065 +
+ {{ MOH731RegisterData.start_tb_art_new }} +
+
4. Medical Male Circumcision
+ 4.1 Number circumcised +
Circumcised_0-60 days + HV04-01 +
+
Circumcised_61 days -9 yrs days + HV04-02 +
+
Circumcised_10-14 + HV04-03 +
+
Circumcised_15 + + HV04-04 +
+
Tested_ HIV+ + HV04-05 +
+
Tested_ HIV- + HV04-06 +
+
+ 4.2 Type of circumcission +
Surgical + HV04-07 +
+
Devices + HV04-08 +
+
+ 4.3 Circumcission Adverse Events +
AE_During_Moderate + HV04-09 +
+
AE_During_Severe + HV04-10 +
+
AE_Post_Moderate + HV04-11 +
+
AE_Post_Severe + HV04-12 +
+
Follow up visit < 14d + HV04-13 +
+
5. Post Exposure Prophylaxis
Exposed_Occupational + HV05-01 +
+ {{ MOH731RegisterData.exposed_occupational }} +
+
Exposed Other + HV05-02 +
+ {{ MOH731RegisterData.exposed_non_occupational }} +
+
PEP_Occupational + HV05-03 +
+ {{ MOH731RegisterData.pep_occupational }} +
+
PEP_Other + HV05-04 +
+ {{ MOH731RegisterData.pep_non_occupational }} +
+
+
diff --git a/src/app/data-analytics-dashboard/hiv/report731/report731.component.spec.ts b/src/app/data-analytics-dashboard/hiv/report731/report731.component.spec.ts new file mode 100644 index 000000000..3132b6d76 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/report731.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Report731Component } from './report731.component'; + +describe('Report731Component', () => { + let component: Report731Component; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [Report731Component] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(Report731Component); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/data-analytics-dashboard/hiv/report731/report731.component.ts b/src/app/data-analytics-dashboard/hiv/report731/report731.component.ts new file mode 100644 index 000000000..7c329feb6 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/report731/report731.component.ts @@ -0,0 +1,254 @@ +import * as Moment from 'moment'; +import * as _ from 'lodash'; +import { + Component, + ElementRef, + OnInit, + Output, + ViewChild +} from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; +import { DatePipe } from '@angular/common'; +import { DataAnalyticsDashboardService } from '../../services/data-analytics-dashboard.services'; + +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; + +@Component({ + selector: 'app-report731', + templateUrl: './report731.component.html', + styleUrls: ['./report731.component.css'] +}) +export class Report731Component implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public MOH731RegisterData: any = {}; + public columnDefs: any = []; + public reportName = 'MOH 731 REPORT'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + public quarter: string; + public eDate: string; + public sDate: string; + public jointLocationUuids = []; + + public statusError = false; + public errorMessage = ''; + public showInfoMessage = false; + public isLoading = false; + public reportHead: any; + public enabledControls = 'monthControl, locationControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public showLocationsControl = true; + public showIsAggregateControl = false; + public isReleased = false; + public generated = false; + @ViewChild('cntdarcontentToSnapshot') contentToSnapshot!: ElementRef; + + 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; + } + + private _startDate: Date = Moment() + .subtract(1, 'months') + .startOf('month') + .toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = Moment() + .subtract(1, 'months') + .endOf('month') + .toDate(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + constructor( + public router: Router, + public route: ActivatedRoute, + public register: RegistersResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { + this.route.queryParams.subscribe((data) => { + data.month === undefined + ? (this._month = Moment().subtract(1, 'month').format('YYYY-MM-DD')) + : (this._month = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() { + // if (this.register.moh731Data) { + // this.MOH731RegisterData = this.register.moh731Data; + // this.calculateTotalSummary(); + // } + } + + public onMonthChange(value): any { + 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.push(...locationValues); + }); + + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(); + }); + this.MOH731RegisterData = []; + this.getMOH731Register(this.params); + this.generated = true; + } + + public storeParamsInUrl() { + this.params = { + locationUuids: this.getSelectedLocations(this.jointLocationUuids), + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') + }; + this.router.navigate([], { + relativeTo: this.route, + queryParams: this.params + }); + } + + public getMOH731Register(params: any) { + this.isLoading = true; + this.register.getMoh731Register(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; + const flatData = Object.assign({}, ...data.result); + this.MOH731RegisterData = flatData; + // this.register.moh731Data = flatData; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } + public calculateTotalSummary() { + const totalsRow = []; + if (this.MOH731RegisterData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.MOH731RegisterData, (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(title: string, indicator: string, gender: string) { + this.router.navigate(['patient-list'], { + relativeTo: this.route, + queryParams: { + indicators: indicator, + indicatorHeader: title, + month: this._month, + locationUuids: this.getSelectedLocations(this.jointLocationUuids), + indicatorGender: gender, + startDate: this.startDate, + endDate: this.endDate + } + }); + } + + public showDraftReportAlert(date) { + 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 731 Register.pdf'); + }); + } + private getSelectedLocations(locationUuids: any): string { + if (!locationUuids || locationUuids.length === 0) { + return ''; + } + + let selectedLocations = ''; + + for (let i = 0; i < locationUuids.length; i++) { + if (i === 0) { + selectedLocations = selectedLocations + (locationUuids[0] as any).value; + } else { + selectedLocations = + selectedLocations + ',' + (locationUuids[i] as any).value; + } + } + return selectedLocations; + } +} From 51ed3f619a58b9599517be9de8a269ef80731773 Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 23:16:57 +0300 Subject: [PATCH 46/50] POC-738: Added MOH 405 ANC Register --- .../anc-register/anc-register.component.css | 22 + .../anc-register/anc-register.component.html | 462 +++++++++++++++++- .../anc-register/anc-register.component.ts | 72 ++- 3 files changed, 548 insertions(+), 8 deletions(-) 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 index ab1f08146..189ddd1cd 100644 --- 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 @@ -15,3 +15,25 @@ tbody tr { th { min-width: 70px; } + +.summary { + display: flex; + gap: 40px; + align-items: stretch; + justify-content: space-between; +} + +.flex-item { + flex: 1 1 30%; + min-width: 250px; + box-sizing: border-box; +} +table { + width: 100%; + height: auto; +} + +.inner { + display: flex; + flex-direction: column; +} 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 aaaf31c18..a53c2d27d 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 @@ -73,6 +73,7 @@

Number/NUPI
(Re Visit) + AMRSID Number of
Visits
@@ -359,6 +360,7 @@

(aq) (ar) (as) + (at) @@ -367,6 +369,7 @@

{{ data.anc_number }} {{ data.anc_number_NUPI }} + {{ data.amrsID }} {{ data.number_of_anc_visits }} @@ -403,10 +406,29 @@

{{ 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_test_type }} + + + {{ data.hiv_test_1_kit_name }} / {{ data.hiv_test_1_lot_no }} /{{ + data.hiv_test_1_expiry_date + }} + / {{ data.hiv_test_1_test_result }} + + + {{ data.hiv_test_2_kit_name }} / + {{ data.hiv_test_2_lot_number }} /{{ + data.hiv_test_2_expiry_date + }} + / {{ data.hiv_test_2_test_result }} + + + {{ data.hiv_test_3_kit_name }} / + {{ data.hiv_test_3_lot_number }} /{{ + data.hiv_test_3_expiry_date + }} + /{{ data.hiv_test_3_test_result }} + {{ data.hiv_results }} {{ data.maternal_haart }} @@ -449,5 +471,437 @@

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
HIV TestingTests (ab)
Initial + {{ filterData(ancRegisterData, 'hiv_test_type', 'I') }} +
Retest + {{ filterData(ancRegisterData, 'hiv_test_type', 'R') }} +
Total (Initial + Retest) + {{ + filterData(ancRegisterData, 'hiv_test_type', 'I') + + filterData(ancRegisterData, 'hiv_test_type', 'R') + }} +
Known HIV Positive + {{ filterData(ancRegisterData, 'hiv_results', 'NA') }} +
+
+
+ + + + + + + +
Partner Testing (al) + {{ + filterData(ancRegisterData, 'partner_hiv_testing', 'P') + }} +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HIV Test KitTest 1 (ac)Test 2 (ad)Test 3 (ae)
N: Negative + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_1_test_result', + 'N' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_2_test_result', + 'N' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_3_test_result', + 'N' + ) + }} +
P: Positive + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_1_test_result', + 'P' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_2_test_result', + 'P' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_3_test_result', + 'P' + ) + }} +
I: Invalid + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_1_test_result', + 'I' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_2_test_result', + 'I' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_3_test_result', + 'I' + ) + }} +
Wastage: + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_1_test_result', + 'NA' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_2_test_result', + 'NA' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_3_test_result', + 'NA' + ) + }} +
T: Total + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_1_test_result', + 'N' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_1_test_result', + 'P' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_1_test_result', + 'I' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_1_test_result', + 'NA' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_2_test_result', + 'N' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_2_test_result', + 'P' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_2_test_result', + 'I' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_2_test_result', + 'NA' + ) + }} + + {{ + getPropertyTotals( + ancRegisterData, + 'hiv_test_3_test_result', + 'N' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_3_test_result', + 'P' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_3_test_result', + 'I' + ) + + getPropertyTotals( + ancRegisterData, + 'hiv_test_3_test_result', + 'NA' + ) + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
HIV ResultsResults (af)
Positive{{ filterData(ancRegisterData, 'hiv_results', 'P') }}
Negative{{ filterData(ancRegisterData, 'hiv_results', 'N') }}
Total + {{ + filterData(ancRegisterData, 'hiv_results', 'P') + + filterData(ancRegisterData, 'hiv_results', 'N') + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+ Adolescents(10-19Yrs) testing and result (f) +
Initial - 10-19yrs (ab) + {{ + getPropertyTotalsWithAge( + ancRegisterData, + 'hiv_test_1_test_result', + 'P', + 10, + 19 + ) + }} +
Positive - 10-19yrs (af) + {{ + getPropertyTotalsWithAge( + ancRegisterData, + 'hiv_test_1_test_result', + 'P', + 10, + 19 + ) + }} +
Started on HAART - 10-19yrs (ag) + {{ + getPropertyTotalsWithAge( + ancRegisterData, + 'maternal_haart', + 'P', + 10, + 19 + ) + }} +
+
+
+ + + + + + + + + + + + + + + + + +
Started on HAARTHAART (ag)
New On ART
On ART at 1st ANC
+
+
+ + + + + + + + + + + + + + + + + +
Screened for SyphillisTotal
Testing (y)
Testing Results (y) + {{ getPropertyTotals(ancRegisterData, 'rpr_vdrl_duo', 'P') }} +
+
+
+ + + + + + + + + + + + + + + + + +
HBV ScreeningTotal
Positive(z) + {{ getPropertyTotals(ancRegisterData, 'hepatitisB', 'P') }} +
Treatment(z) + {{ + getPropertyTotals( + ancRegisterData, + 'hepatitisB_treatment', + '2' + ) + }} +
+
+
+

+
+ No record found +
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 31628171c..bcd807310 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 @@ -44,6 +44,7 @@ export class AncRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + public generated = false; @ViewChild('cntdarcontentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; @@ -116,6 +117,7 @@ export class AncRegisterComponent implements OnInit { }); this.ancRegisterData = []; this.getANCRegisterData(this.params); + this.generated = true; } public storeParamsInUrl() { @@ -207,13 +209,75 @@ export class AncRegisterComponent implements OnInit { public takeSnapshotAndExport() { const elementToSnapshot = this.contentToSnapshot.nativeElement; - html2canvas(elementToSnapshot).then((canvas) => { + html2canvas(elementToSnapshot, { scale: 2 }).then((canvas) => { const imgData = canvas.toDataURL('image/png'); - const pdf = new jsPDF('p', 'mm', 'a4'); - const imgWidth = 210; // A4 width in mm + const pdf = new jsPDF('p', 'mm', 'a0'); + + const pageWidth = 841; // A0 width (portrait) + const pageHeight = 1189; // A0 height + + const imgWidth = pageWidth; const imgHeight = (canvas.height * imgWidth) / canvas.width; - pdf.addImage(imgData, 'PNG', 0, 0, imgWidth, imgHeight); + + let heightLeft = imgHeight; + let position = 0; + + pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); + + heightLeft -= pageHeight; + + // Add additional pages if required + while (heightLeft > 0) { + pdf.addPage(); + position = heightLeft - imgHeight; + pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); + heightLeft -= pageHeight; + } pdf.save('MOH 405 ANC Register.pdf'); }); } + filterData(summaryData: any, condition: string, value) { + if (!summaryData) { + return ''; + } + return ( + summaryData.filter((data) => { + const field = data[condition]; + + if (!value) { + return; + } + + return field === value; + }).length || '' + ); + } + + getPropertyTotals( + summaryData: any[], + property: string, + propertyValue: string + ) { + return ( + summaryData.filter((data) => data[property] === propertyValue).length || + '' + ); + } + + getPropertyTotalsWithAge( + summaryData: any[], + property: string, + propertyValue: string, + minAge: number, + maxAge: number + ) { + return ( + summaryData.filter( + (data) => + data[property] === propertyValue && + data['age'] >= minAge && + data['age'] <= maxAge + ).length || '' + ); + } } From 88e5bf0f7d05486ce90a842d0a57a10b8ec0cd10 Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 23:20:40 +0300 Subject: [PATCH 47/50] POC-743: Added MOH 406 PNC Register --- .../pnc-register/pnc-register.component.css | 35 + .../pnc-register/pnc-register.component.html | 1156 +++++++++-------- .../pnc-register/pnc-register.component.ts | 188 ++- 3 files changed, 823 insertions(+), 556 deletions(-) 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 index ab1f08146..23732fefc 100644 --- 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 @@ -15,3 +15,38 @@ tbody tr { th { min-width: 70px; } + +.summary { + display: flex; + gap: 50px; + align-items: stretch; + justify-content: space-between; +} + +.flex-item { + flex: 1 1 30%; + min-width: 250px; + box-sizing: border-box; +} +table { + width: 100%; + height: auto; +} + +.inner { + display: flex; + flex-direction: column; +} +.highlighted-row { + background-color: #bbb; /* Light gray */ +} + +.no-border { + border: none !important; + padding: 0 !important; + margin: 0 !important; + height: 0 !important; +} +.no-border-row { + border: none !important; +} 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 index 6206fb58f..eb9268687 100644 --- 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 @@ -11,7 +11,8 @@

This report is likely to change without warning.

-
+
@@ -52,7 +57,7 @@

- + @@ -96,6 +101,7 @@

PNC Number/NUPI
(Revisit) +

+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date of visitRegistration Information Maternity History Postpartum Visit Vital SignsAMRSID Full Name(first name, middle and
surname) @@ -368,528 +374,632 @@

(an) (ao) (ap)(aq)
+ {{ data.date_of_visit | date: 'dd/MM/yyyy' }} + {{ data.pnc_number }}{{ data.pnc_number }}{{ data.amrsID }}{{ data.full_names }} + {{ data.date_of_birth | date: 'dd/MM/yyyy' }} + {{ data.subcounty_county }}{{ data.village_estate_landmark }} + {{ data.date_of_delivery | date: 'dd/MM/yyyy' }} + + {{ data.place_of_delivery }} + {{ data.mode_of_delivery }}{{ data.timing_mother }}{{ data.timing_baby }}{{ data.temperature }}{{ data.pulse }}{{ data.blood_pressure }}{{ data.pallor_present }}{{ data.breast }}{{ data.uterus }}{{ data.pph }}{{ data.c_section_site }}{{ data.lochia }}{{ data.episiotomy }}{{ data.fistula }}{{ data.tb_screening }}{{ data.tested_pnc }} + {{ data.hiv_test_1_kit_name }}/ {{ data.hiv_test_1_lot_no }} / + {{ data.hiv_test_1_expiry_date }} / + {{ data.hiv_test_1_test_result }} + + {{ data.hiv_test_2_kit_name }}/ {{ data.hiv_test_2_lot_no }} / + {{ data.hiv_test_2_expiry_date }} / + {{ data.hiv_test_1_test_result }} + + {{ data.hiv_test_3_kit_name }}/ {{ data.hiv_test_3_lot_no }} / + {{ data.hiv_test_3_expiry_date }} / + {{ data.hiv_test_1_test_result }} + + {{ data.results_less_6_weeks }} + + {{ data.results_greater_6_weeks }} + + {{ data.infant_prophylaxis_less_6_weeks }} + + {{ data.maternal_haart_less_6_weeks }} + + {{ data.infant_prophylaxis_greater_6_weeks }} + + {{ data.maternal_haart_greater_6_weeks }} + {{ data.cervical_cancer_method }}{{ data.counselled }} + {{ data.other_maternal_complications }} + {{ data.haematinics }}{{ data.referrals_from }}{{ data.referrals_to }} + {{ data.reason_for_referral }} + + {{ data.remarks }} +
{{ data.nupi }}{{ data.age }}{{ data.phone_number }}{{ data.pallor }}{{ data.cervical_cancer_results }}{{ data.family_planning_method }}

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CLIENT AGE (f)Total
10-14yrs{{ calculateAgeTotal(pncSummaryData, 10, 14) }}
15-19yrs{{ calculateAgeTotal(pncSummaryData, 15, 19) }}
20-24yrs{{ calculateAgeTotal(pncSummaryData, 20, 24) }}
25yrs Plus{{ calculateAgeTotal(pncSummaryData, 25) }}
Totals{{ pncSummaryData.length }}
New PNC Visits (c)
PNC Revisit (d) + {{ + getPropertyTotals( + pncSummaryData, + 'postpartum_visit_baby', + 'R' + ) + + getPropertyTotals( + pncSummaryData, + 'postpartum_visit_mother', + 'R' + ) + }} +
Total PNC Visits + {{ + getPropertyTotals( + pncSummaryData, + 'postpartum_visit_baby', + 'Y' + ) + + getPropertyTotals( + pncSummaryData, + 'postpartum_visit_mother', + 'Y' + ) + }} +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
PNC Visit MotherTotal
New PNC Visit within 48 hours
New PNC Visit 3 days < 6 weeks + {{ + getPropertyTotals(pncSummaryData, 'results_less_6_weeks', 'Y') + }} +
New PNC Visit after 6 weeks + {{ + getPropertyTotals( + pncSummaryData, + 'results_greater_6_weeks', + 'Y' + ) + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
PNC Visit BabyTotal
New PNC Visit within 48 hours
New PNC Visit 3 days < 6 weeks + {{ + getPropertyTotals(pncSummaryData, 'results_less_6_weeks', 'Y') + }} +
New PNC Visit after 6 weeks + {{ + getPropertyTotals( + pncSummaryData, + 'results_greater_6_weeks', + 'Y' + ) + }} +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Codes for Col (p)Codes for Col (g)
1=Mild1=Normal
2=Moderate2=Cracked nipple
3=Servere3=Engorged
4=Mastitis
Codes for col (r)Codes for Col (s)
1=Contracted1=Present
2=Not Contracted2=Absent
3=Other (Specify)
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Codes for Col (i)Codes for Col (j)Codes for Col (t)Codes for Col (u)
F=Facility1=SVD1=Bleeding1=Normal
H=Home2=CS2=Normal2=Foul smelling
BBA=Born Before Arrival3=Breech3=Infected3=Excessive
4=AVD4=Gaping
5=NA
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Codes for Col (v)
1=Repaired
2=Gaping
3=Infected
4=Healed
5=NA
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
No. Tests at PNC: (ac) & (ad):{{ getPropertyTotals(pncSummaryData, 'tested_pnc', 'Y') }}
No.HIV Positive results (ac) & (ad): + {{ + getPropertyTotals(pncSummaryData, 'hiv_test_results_pnc', 'P') + }} +
No. Positive Adolescents 10-19 yrs_PNC (ac)(e) & (ad)(e) + {{ + getPropertyWithAgeTotals( + pncSummaryData, + 'hiv_test_results_pnc', + 'P', + 10, + 19 + ) + }} +
No. Started HAART Adolescents 10-19 yrs (af)(e) & (ah)(e) + {{ + getPropertyWithAgeTotals( + pncSummaryData, + 'maternal_haart', + 'P', + 10, + 19 + ) + }} +
No. Start HAART_PNC (af) & (ah): + {{ getPropertyTotals(pncSummaryData, 'maternal_haart', 'Y') }} +
No.Infant ARV prophylaxis (ae) & (ag): + {{ getPropertyTotals(pncSummaryData, 'infant_prophylaxis', 'Y') }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
HIV TEST 1 (z)NUMBER
N: Negative + {{ getHivTotals(pncSummaryData, 'hiv_test_1_test_result', 'N') }} +
P: Positive + {{ getHivTotals(pncSummaryData, 'hiv_test_1_test_result', 'P') }} +
I: Invalid + {{ getHivTotals(pncSummaryData, 'hiv_test_1_test_result', 'I') }} +
Westage: + {{ getHivTotals(pncSummaryData, 'hiv_test_1_test_result', 'NA') }} +
Total: + {{ + getHivTotals(pncSummaryData, 'hiv_test_1_test_result', 'N') + + getHivTotals(pncSummaryData, 'hiv_test_1_test_result', 'P') + + getHivTotals(pncSummaryData, 'hiv_test_1_test_result', 'I') + + getHivTotals(pncSummaryData, 'hiv_test_1_test_result', 'NA') + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
HIV TEST 2 (aa)NUMBER
N: Negative + {{ getHivTotals(pncSummaryData, 'hiv_test_2_test_result', 'N') }} +
P: Positive + {{ getHivTotals(pncSummaryData, 'hiv_test_2_test_result', 'P') }} +
I: Invalid + {{ getHivTotals(pncSummaryData, 'hiv_test_2_test_result', 'I') }} +
Westage: + {{ getHivTotals(pncSummaryData, 'hiv_test_2_test_result', 'NA') }} +
Total: + {{ + getHivTotals(pncSummaryData, 'hiv_test_2_test_result', 'N') + + getHivTotals(pncSummaryData, 'hiv_test_2_test_result', 'P') + + getHivTotals(pncSummaryData, 'hiv_test_2_test_result', 'I') + + getHivTotals(pncSummaryData, 'hiv_test_2_test_result', 'NA') + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
HIV TEST 3 (ab)NUMBER
N: Negative + {{ getHivTotals(pncSummaryData, 'hiv_test_3_test_result', 'N') }} +
P: Positive + {{ getHivTotals(pncSummaryData, 'hiv_test_3_test_result', 'P') }} +
I: Invalid + {{ getHivTotals(pncSummaryData, 'hiv_test_3_test_result', 'I') }} +
Westage: + {{ getHivTotals(pncSummaryData, 'hiv_test_3_test_result', 'NA') }} +
Total: + {{ + getHivTotals(pncSummaryData, 'hiv_test_3_test_result', 'N') + + getHivTotals(pncSummaryData, 'hiv_test_3_test_result', 'P') + + getHivTotals(pncSummaryData, 'hiv_test_3_test_result', 'I') + + getHivTotals(pncSummaryData, 'hiv_test_3_test_result', 'NA') + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Screened for Cervical Cancer (PAP) (ai) + {{ + getCevicalCancerScreeningTotals(pncSummaryData, 'PAP S', 'P') + }} +
Screened for Cervical Cancer (VIA) (ai) + {{ getCevicalCancerScreeningTotals(pncSummaryData, 'VIA', 'P') }} +
Screened for Cervical Cancer (VILI) (ai) + {{ getCevicalCancerScreeningTotals(pncSummaryData, 'VILI', 'P') }} +
Screened for Cervical Cancer (HPV) (ai) + {{ getCevicalCancerScreeningTotals(pncSummaryData, 'HPV', 'P') }} +
Received an FP method (ai){{ getPropertyTotals(pncSummaryData, 'ppfp_done', 'Y') }}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Codes of Col (ai)
1=Normal
2=Suspected
3=Confirmed
4=ND if not done
+
+
+
+
+ No record found
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 index 160dead32..440a57d79 100644 --- 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 @@ -1,7 +1,19 @@ -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 * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; + @Component({ selector: 'app-pnc-register', templateUrl: './pnc-register.component.html', @@ -12,7 +24,7 @@ export class PncRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public pncSummaryData: any = []; public columnDefs: any = []; public reportName = 'PNC Register'; public currentView = 'monthly'; @@ -22,16 +34,19 @@ export class PncRegisterComponent 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 = 'datesControl, locationControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + public generated = false; + @ViewChild('contentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; public get locationUuids(): Array { @@ -48,7 +63,31 @@ export class PncRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + + constructor( + public router: Router, + public route: ActivatedRoute, + public register: RegistersResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -64,24 +103,33 @@ export class PncRegisterComponent 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.pncSummaryData = []; + this.getPncRegisterData(this.params); + this.generated = true; } - 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'), + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -89,31 +137,31 @@ export class PncRegisterComponent 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 getPncRegisterData(params: any) { + this.isLoading = true; + this.register.getPncRegister(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.pncSummaryData = data; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } public calculateTotalSummary() { const totalsRow = []; - if (this.txnewReportSummaryData.length > 0) { + if (this.pncSummaryData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.txnewReportSummaryData, (row) => { + _.each(this.pncSummaryData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { @@ -158,4 +206,78 @@ export class PncRegisterComponent implements OnInit { 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 366 Care and Treatment Daily Activity.pdf'); + }); + } + + calculateAgeTotal(summaryData: any[], minAge: number, maxAge?: number) { + return ( + summaryData.filter( + (data) => + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + + getHivTotals(summaryData: any[], hivTestType: string, hivTestResult: string) { + return ( + summaryData.filter((data) => data[hivTestType] === hivTestResult) + .length || '' + ); + } + getCevicalCancerScreeningTotals( + summaryData: any[], + screeningMethod: string, + screenigValue: string + ) { + return ( + summaryData.filter( + (data) => + data['cervical_cancer_method'] === screeningMethod && + data['cervical_cancer_results'] === screenigValue + ).length || '' + ); + } + + getPropertyTotals( + summaryData: any[], + property: string, + propertyValue: string + ) { + return ( + summaryData.filter((data) => data[property] === propertyValue).length || + '' + ); + } + getPropertyWithAgeTotals( + summaryData: any[], + property: string, + propertyValue: string, + minAge: number, + maxAge: number + ) { + return ( + summaryData.filter( + (data) => + data[property] === propertyValue && + data['age'] >= minAge && + data['age'] <= maxAge + ).length || '' + ); + } } From 8a81072f321ca7c21d681bedb75794eb26503ed7 Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 23:24:16 +0300 Subject: [PATCH 48/50] POC-745: Added MOH 267 PrEP Daily Activity Register --- .../prepdaily-register.component.css | 9 + .../prepdaily-register.component.html | 3664 +++++++++++++++++ .../prepdaily-register.component.ts | 203 +- 3 files changed, 3872 insertions(+), 4 deletions(-) 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 index 7d7e743ba..3ca74cbcf 100644 --- 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 @@ -12,3 +12,12 @@ tbody tr { transform: rotate(180deg); white-space: nowrap; } + +.bold { + font-weight: bold; +} + +.summary { + display: flex; + gap: 5px; +} 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 fcf355c8a..68aab0301 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 @@ -78,6 +78,7 @@

PrEP No Date of Visit + AMRSID National Identification Number @@ -129,6 +130,7 @@

(a) (b) + (l) (c) (d) (e) @@ -149,6 +151,9 @@

{{ transformDate(data.Date_Of_Visit) }} + + {{ data.amrsId }} + {{ data.National_ID }} {{ data.Age }} {{ data.Sex }} @@ -199,6 +204,3665 @@

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Number initiated (New) on PrEP (g) +
10-14 Yrs15-19 Yrs20-24 Yrs25-29 Yrs>=30 Yrs
MFMFMFMFMF
General popn + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} +
MSM/MSW + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} +
FSW + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} +
PWID/PWUD + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} +
Discordant Couple + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} +
Vulnerable Pop. + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 30, + { prepStatus: 'client_prep_status', statusValue: 'N' } + ) + }} +
TOTAL + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 10, { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 10, { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 15, { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 15, { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 20, { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 20, { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 25, { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 25, { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 30, { + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 30, { + prepStatus: 'client_prep_status', + statusValue: 'N' + }) + }} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ New +
Refill +
+ Restart +
+ Number Current on PrEP +
10-14 Yrs15-19 Yrs20-24 Yrs25-29 Yrs>=30 Yrs
MFMFMFMFMF
General popn + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} +
MSM/MSW + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} +
FSW + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} +
PWID/PWUD + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} +
Discordant Couple + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} +
Vulnerable Pop. + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} + + {{ + filterPrepDiscontinued( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} +
TOTAL + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 10, + { + maxAge: 14, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 15, + { + maxAge: 19, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 20, + { + maxAge: 24, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 25, + { + maxAge: 29, + prepStatus: 'client_prep_status', + statusValue: 'D' + } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} + + {{ + filterPrepDiscontinuedTotal( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 30, + { prepStatus: 'client_prep_status', statusValue: 'D' } + ) + }} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Number diagnosed with STI (j) +
10-14 Yrs15-19 Yrs20-24 Yrs25-29 Yrs>=30 Yrs
MFMFMFMFMF
General popn + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '1', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '1', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} +
MSM/MSW + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '3', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '3', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} +
FSW + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '4', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '4', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} +
PWID/PWUD + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '5', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '5', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} +
Discordant Couple + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '2', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '2', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} +
Vulnerable Pop. + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 10, + { maxAge: 14, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 15, + { maxAge: 19, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 20, + { maxAge: 24, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 25, + { maxAge: 29, stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'M', + 'population_type', + '6', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} + + {{ + filterPrepData( + prepRegisterData, + 'Age', + 'Sex', + 'F', + 'population_type', + '6', + 30, + { stiStatus: 'with_STI', stiValue: 'Y' } + ) + }} +
TOTAL + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 10, { + maxAge: 14, + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 10, { + maxAge: 14, + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 15, { + maxAge: 19, + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 15, { + maxAge: 19, + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 20, { + maxAge: 24, + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 20, { + maxAge: 24, + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 25, { + maxAge: 29, + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 25, { + maxAge: 29, + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'M', 'Age', 30, { + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} + + {{ + getTotalData(prepRegisterData, 'Sex', 'F', 'Age', 30, { + stiStatus: 'with_STI', + stiValue: 'Y' + }) + }} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ Indicator/
PrEP method +
+ Number of clients on each PrEP method (h) +
Event DrivenDaily OralDapivirine VaginalCabotegravir injectableTotal
Number initiated (New) on PrEP + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '2', + 'client_prep_status', + 'N' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '1', + 'client_prep_status', + 'N' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '3', + 'client_prep_status', + 'N' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '4', + 'client_prep_status', + 'N' + ) + }} + + {{ + getPrepMethodTotal( + prepRegisterData, + 'client_prep_status', + 'N' + ) + }} +
+ Number continuing /
+ currently on (Refills) PrEP +
+ {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '2', + 'client_prep_status', + 'C' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '1', + 'client_prep_status', + 'C' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '3', + 'client_prep_status', + 'C' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '4', + 'client_prep_status', + 'C' + ) + }} + + {{ + getPrepMethodTotal( + prepRegisterData, + 'client_prep_status', + 'C' + ) + }} +
Number Restarting PrEP + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '2', + 'client_prep_status', + 'R' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '1', + 'client_prep_status', + 'R' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '3', + 'client_prep_status', + 'R' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '4', + 'client_prep_status', + 'R' + ) + }} + + {{ + getPrepMethodTotal( + prepRegisterData, + 'client_prep_status', + 'R' + ) + }} +
+ Number on PrEP for at-least 3 months + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '2', + 'client_prep_status', + 'C' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '1', + 'client_prep_status', + 'C' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '3', + 'client_prep_status', + 'C' + ) + }} + + {{ + filterPrepMethod( + prepRegisterData, + 'prep_method', + '4', + 'client_prep_status', + 'C' + ) + }} + + {{ + getPrepMethodTotal( + prepRegisterData, + 'client_prep_status', + 'C' + ) + }} +
+ Number Seroconverting while on PrEP (i) +
+
+

{ if (data.error) { this.showInfoMessage = true; @@ -147,7 +153,6 @@ export class PrepdailyRegisterComponent implements OnInit { } else { this.showInfoMessage = false; this.prepRegisterData = data; - console.log('PREP DATA IS: ' + JSON.stringify(data)); this.isLoading = false; this.showDraftReportAlert(this._month); } @@ -192,4 +197,194 @@ export class PrepdailyRegisterComponent implements OnInit { pdf.save('MOH 267 PrEP Daily Activity Register.pdf'); }); } + + filterPrepData( + data: any[], + age: string, + gender: string, + genderValue: string, + populationType: string, + populationValue: string, + minAge: number, + options: FilterPrepOptions = {} + ): number | string { + if (!Array.isArray(data)) { + return ''; + } + const { maxAge, prepStatus, statusValue, stiStatus, stiValue } = options; + + return ( + data.filter((item) => { + const ageValue = item[age]; + const genderMatch = item[gender] === genderValue; + const popTypeMatch = item[populationType] === populationValue; + const minAgeMatch = ageValue >= minAge; + const maxAgeMatch = maxAge !== undefined ? ageValue <= maxAge : true; + const prepStatusMatch = + prepStatus && statusValue ? item[prepStatus] === statusValue : true; + + const stiStatusMatch = + stiStatus && stiValue ? item[stiStatus] === stiValue : true; + + return ( + genderMatch && + popTypeMatch && + minAgeMatch && + maxAgeMatch && + prepStatusMatch && + stiStatusMatch + ); + }).length || '' + ); + } + + filterPrepDiscontinued( + data: any[], + age: string, + gender: string, + genderValue: string, + populationType: string, + populationValue: string, + minAge: number, + options: FilterPrepOptions = {} + ): number | string { + if (!Array.isArray(data)) { + return ''; + } + const { maxAge, prepStatus, statusValue, stiStatus, stiValue } = options; + + return ( + data.filter((item) => { + const ageValue = item[age]; + const genderMatch = item[gender] === genderValue; + const popTypeMatch = item[populationType] === populationValue; + const minAgeMatch = ageValue >= minAge; + const maxAgeMatch = maxAge !== undefined ? ageValue <= maxAge : true; + const prepStatusMatch = + prepStatus && statusValue + ? item[prepStatus] === 'R' || + item[prepStatus] === 'N' || + item[prepStatus] === 'C' + : true; + + const stiStatusMatch = + stiStatus && stiValue ? item[stiStatus] === stiValue : true; + + return ( + genderMatch && + popTypeMatch && + minAgeMatch && + maxAgeMatch && + prepStatusMatch && + stiStatusMatch + ); + }).length || '' + ); + } + + filterPrepDiscontinuedTotal( + data: any[], + age: string, + gender: string, + genderValue: string, + minAge: number, + options: FilterPrepOptions = {} + ): number | string { + if (!Array.isArray(data)) { + return ''; + } + const { maxAge, prepStatus, statusValue, stiStatus, stiValue } = options; + + return ( + data.filter((item) => { + const ageValue = item[age]; + const genderMatch = item[gender] === genderValue; + const minAgeMatch = ageValue >= minAge; + const maxAgeMatch = maxAge !== undefined ? ageValue <= maxAge : true; + const prepStatusMatch = + prepStatus && statusValue + ? item[prepStatus] === 'R' || + item[prepStatus] === 'N' || + item[prepStatus] === 'C' + : true; + + const stiStatusMatch = + stiStatus && stiValue ? item[stiStatus] === stiValue : true; + + return ( + genderMatch && + minAgeMatch && + maxAgeMatch && + prepStatusMatch && + stiStatusMatch + ); + }).length || '' + ); + } + + getTotalData( + summaryData: any[], + gender: string, + genderValue: string, + age: string, + minAge: number, + options: FilterPrepOptions = {} + ): number | string { + if (!Array.isArray(summaryData)) { + return ''; + } + + const { maxAge, prepStatus, statusValue, stiStatus, stiValue } = options; + + return ( + summaryData.filter((data) => { + const ageValue = data[age]; + const genderMatch = data[gender] === genderValue; + const minAgeMatch = ageValue >= minAge; + const maxAgeMatch = maxAge !== undefined ? ageValue <= maxAge : true; + const prepStatusMatch = + prepStatus && statusValue ? data[prepStatus] === statusValue : true; + + const stiStatusMatch = + stiStatus && stiValue ? data[stiStatus] === stiValue : true; + + return ( + genderMatch && + minAgeMatch && + maxAgeMatch && + prepStatusMatch && + stiStatusMatch + ); + }).length || '' + ); + } + + filterPrepMethod( + data: any[], + prepMethod: string, + prepMethodValue: number, + prepStatus: string, + prepStatusValue: string + ) { + return ( + data.filter( + (param) => + param[prepMethod] === prepMethodValue && + param[prepStatus] === prepStatusValue + ).length || '' + ); + } + + getPrepMethodTotal(data: any[], prepStatus: string, prepStatusValue: number) { + return ( + data.filter( + (param) => + (param['prep_method'] === '1' || + param['prep_method'] === '2' || + param['prep_method'] === '3' || + param['prep_method'] === '4') && + param[prepStatus] === prepStatusValue + ).length || '' + ); + } } From cccb64aebce348aa9ad5cffc44878850d8862b17 Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 23:27:23 +0300 Subject: [PATCH 49/50] POC-740: Added MOH 407 Nutrition Service Register --- .../nutrition-register.component.css | 32 +- .../nutrition-register.component.html | 1478 ++++++----------- .../nutrition-register.component.ts | 128 +- 3 files changed, 640 insertions(+), 998 deletions(-) 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 index ab1f08146..a4ad7f3a1 100644 --- 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 @@ -1,10 +1,10 @@ tr, .table-bordered th, .table-bordered td { - border: 2px solid #000; /* Darker border color */ + border: 2px solid #000; } tbody tr { - height: 20px; /* Adjust the height as per your design */ + height: 20px; } .vertical-text { writing-mode: vertical-rl; @@ -15,3 +15,31 @@ tbody tr { th { min-width: 70px; } + +.summary { + display: flex; + gap: 50px; + align-items: stretch; + justify-content: space-between; +} + +.flex-item { + flex: 1 1 30%; + min-width: 250px; + box-sizing: border-box; +} + +.no-border { + border: none !important; +} + +.table.table-bordered thead tr th.no-border { + border: none !important; +} + +.center { + text-align: center; +} +.bold { + font-weight: bold; +} 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 index aa9f35a0b..a7fe5632a 100644 --- 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 @@ -11,7 +11,8 @@

This report is likely to change without warning.

-
+
@@ -158,242 +163,207 @@

+ + + {{ a + 1 }} + + {{ data.date | date: 'dd/MM/yyyy' }} + + {{ data.id_number }} + {{ data.ccc_number }} + {{ data.full_names }} + {{ data.visit_type }} + + {{ data.village_estate_landmark }} + + {{ data.sex }} + {{ data.age_years }} + {{ data.age_months }} + + {{ data.pregnant_lactating }} + + {{ data.nutritional_assessment_code }} + + {{ data.nutritional_status }} + + {{ data.serostatus }} + {{ data.cormobidities }} + {{ data.food_secure }} + {{ data.remarks }} + + + {{ data.nupi }} + {{ data.nutritional_assessment_value }} + + + + +

+

Page Summary

+
+
+
+ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Patients SeenNutrition Diagnosis
Patient CategoryNewRevisitAge categorySAM +MAM +
HIV+TOTALHIV+TOTAL0-5 Months
6-59 Months
Male5-9 yrs
Female10-17 yrs
Pregnant & Lactating18+ yrs
Food SecurePregnant/Lactating
+
+
+ + - - - - - - - - - - - - - - - - - + - - + + + + + + + - - - - - - - - - - - - - - - - - + + + + + - - + + + + + - - - - - - - - - - - - - - - - - + + + + + - - + + + + + - - - - - - - - - - - - - - - - - + + + + + - - + + + + +
Medical Condition
Age categoryTBHypertensiondiabetesOthers
0-5 Months
6-59 Months
5-9 yrs
10-17 yrs
18+ yrs
Pregnant/
Lactating

-
+
@@ -409,7 +379,7 @@

- + @@ -420,7 +390,7 @@

Discharge/Transfer
Measurements -

+ @@ -490,6 +460,7 @@

W/H Zscore/BMI For Age/BMIKg/m2 (1-3)

+ @@ -498,6 +469,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -506,6 +478,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -514,6 +487,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -525,6 +499,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -533,6 +508,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -541,6 +517,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -549,6 +526,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -560,6 +538,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -568,6 +547,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -576,6 +556,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -584,6 +565,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -595,6 +577,7 @@

W/H Zscore/BMI For Age/BMIKg/m2

+ @@ -626,6 +609,7 @@

5-Transfer,
6- Death +

+ @@ -714,757 +699,324 @@

- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Client's follow up RegisterClient's follow up Register
Clients' DetailsOutcomeOutcome
week1MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention MUAC Nutrition Intervention Remarks
@@ -696,6 +680,7 @@

(bb) (bc) (bd)(bd) (be) (bf) (bg)(bt) (bu) (bv)(bw)(bw) (bx)
{{ a + 1 }} + {{ data.date | date: 'dd/MM/yyyy' }} + {{ data.id_number }}{{ data.ccc_number }}{{ data.full_names }} + {{ data.village_estate_landmark }} + {{ data.phone_number }}{{ data.age_years }}{{ data.age_months }}{{ data.sex }} + {{ data.type_of_addmission }} + + {{ data.pregnant_lactating }} + {{ data.serostatus }} + {{ data.admission_criteria }} + {{ data.weight }}{{ data.height }} + {{ data.weight_for_height_z_score }} + {{ data.muac }}{{ data.exit_date }}{{ data.length_of_stay }} + {{ data.exit_outcome }} + {{ data.remarks }}
{{ data.nupi }}

+
+

Page Summary

+

Page Summary

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Age categoryTotal HIV
+ve
Total HIV+ve Provided
Therapeutic support
Total HIV+ve Provided
Supplemental support
0-5 Months
6-59 Months
5-9 yrs
10-17 yrs
18+ yrs
Pregnant/
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Prescribed Nutritional
+ Support +
0-5Months6-59Months5-9 Years10-17 Years18+yearsPregnant/
lactating
TB + Total HIV+ve Provided
+ Nutritional support +
HIV +veHIV -veHIV +veHIV -veHIV +veHIV -veHIV +veHIV -veHIV +veHIV -veHIV +veHIV -veHIV +veHIV -ve
Therapeutic Milk
(F 75/F 100)
RUTF
RUSF
FBF
CSB
Others
+
+
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 index 3240e3fd1..0fab34a1b 100644 --- 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 @@ -1,7 +1,19 @@ -import { Component, OnInit, Output } from '@angular/core'; +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 * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; +import { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; +import { DatePipe } from '@angular/common'; + @Component({ selector: 'app-nutrition-register', templateUrl: './nutrition-register.component.html', @@ -12,7 +24,7 @@ export class NutritionRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public nutritionSummaryData: any = []; public columnDefs: any = []; public reportName = 'Nutrition Service Register'; public currentView = 'monthly'; @@ -22,16 +34,18 @@ export class NutritionRegisterComponent 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 = 'datesControl, locationControl'; public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + @ViewChild('contentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; public get locationUuids(): Array { @@ -48,7 +62,31 @@ export class NutritionRegisterComponent implements OnInit { this._locationUuids = locationUuids; } - constructor(public router: Router, public route: ActivatedRoute) { + private _startDate: Date = Moment().toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = new Date(); + public get endDate(): Date { + return this._endDate; + } + + public set endDate(v: Date) { + this._endDate = v; + } + + constructor( + public router: Router, + public route: ActivatedRoute, + public register: RegistersResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -64,24 +102,32 @@ export class NutritionRegisterComponent 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.nutritionSummaryData = []; + this.getNutritionData(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'), + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + endDate: Moment(this.endDate).format('YYYY-MM-DD') }; this.router.navigate([], { relativeTo: this.route, @@ -89,31 +135,30 @@ export class NutritionRegisterComponent 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 getNutritionData(params: any) { + this.isLoading = true; + this.register.getNutritionRegister(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.nutritionSummaryData = data; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } public calculateTotalSummary() { const totalsRow = []; - if (this.txnewReportSummaryData.length > 0) { + if (this.nutritionSummaryData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.txnewReportSummaryData, (row) => { + _.each(this.nutritionSummaryData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { @@ -158,4 +203,21 @@ export class NutritionRegisterComponent implements OnInit { 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 366 Care and Treatment Daily Activity.pdf'); + }); + } } From 9141f630ae366c9a5c36e0527cd1063391dfec8b Mon Sep 17 00:00:00 2001 From: Denzel Kipkemoi Date: Wed, 10 Dec 2025 23:35:17 +0300 Subject: [PATCH 50/50] POC-741: Added MOH 333 Maternity Register --- .../maternity-register.component.css | 22 + .../maternity-register.component.html | 1334 +++++++---------- .../maternity-register.component.ts | 140 +- 3 files changed, 695 insertions(+), 801 deletions(-) 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 index ab1f08146..ae9e9ed55 100644 --- 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 @@ -15,3 +15,25 @@ tbody tr { th { min-width: 70px; } + +.summary { + display: flex; + gap: 20px; + align-items: stretch; + justify-content: space-between; +} + +.flex-item { + flex: 1 1 30%; + min-width: 250px; + box-sizing: border-box; +} +table { + width: 100%; + height: auto; +} + +.inner { + display: flex; + flex-direction: column; +} 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 index 369418be5..8c6924891 100644 --- 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 @@ -38,7 +38,10 @@

-
+
Ministry Of Health @@ -58,6 +61,7 @@

Admission
(dd/mm/yyyy) + AMRSID Admission number (yyyy-mm-nnnn) Full Name
@@ -431,776 +435,568 @@

(av) (aw) (ax) + (ay) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + {{ data.date_of_admission }} + + + {{ data.amrsID }} + + {{ data.admission_number }} + {{ 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.no_of_anc_visits }} + {{ data.lmp }} + + {{ data.edd | date: 'dd/MM/yyyy' }} + + {{ data.diagnosis }} + + {{ data.duration_of_labour }} + + + {{ data.date_of_delivery | date: 'dd/MM/yyyy' }} + + {{ data.time_of_delivery }} + + {{ data.gestation_at_birth }} + + {{ data.mode_of_delivery }} + + {{ data.no_of_babies_delivered }} + + + {{ data.placenta_complete }} + + {{ data.uterotonic_given }} + + {{ data.vaginal_examination }} + + {{ data.blood_loss }} + + {{ data.mother_status_after_delivery }} + + + {{ data.maternal_deaths_notified }} + + + {{ data.delivery_complications }} + + {{ data.apgar_score }} + {{ data.birth_outcome }} + {{ data.birth_weight }} + {{ data.sex }} + + {{ data.initiated_on_bf_less_one_hour }} + + + {{ data.teo_given_at_birth }} + + + {{ data.chlorhexdine_applied_on_cord_stump }} + + {{ data.birth_with_deformity }} + {{ data.given_vitamin_k }} + {{ data.duo_test_result }} + + {{ data.hiv_test_1_kit_name }}/ {{ datahiv_test_1_lot_no }} / + {{ hiv_test_1_expiry_date }} + + + {{ data.hiv_test_2_kit_name }}/ {{ datahiv_test_2_lot_no }} / + {{ hiv_test_2_expiry_date }} + + + {{ data.hiv_test_3_kit_name }}/ {{ datahiv_test_3_lot_no }} / + {{ hiv_test_3_expiry_date }} + + {{ data.hiv_test_results_maternity }} + {{ data.maternal_haart }} + + {{ data.infant_prophylaxis }} + + + {{ data.partner_tested_for_hiv }} + + + {{ data.counselled_on_infant_feeding }} + + + {{ data.deleivery_conducted_by }} + + + {{ data.birth_notification_number }} + + {{ data.discharge_date }} + + {{ data.discharge_status_of_baby }} + + {{ data.referrals_from }} + {{ data.referrals_to }} + + {{ data.reasons_for_refferal }} + + {{ data.comments }} + + + {{ data.nupi }} + {{ data.age }} + {{ data.phone_number }} + + {{ data.date_maternal_death_notified | date: 'dd/MM/yyyy' }} + + {{ data.kangaroo_mother_care }} + {{ data.type_of_deformity }} + {{ data.hiv_test_type }} + {{ data.hiv_test_type }} + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AGE (d)Number
10-14 years{{ calculateAgeTotals(maternitySummaryData, 10, 14) }}
15-19 years{{ calculateAgeTotals(maternitySummaryData, 15, 19) }}
20-24 years{{ calculateAgeTotals(maternitySummaryData, 20, 24) }}
Above 25 years{{ calculateAgeTotals(maternitySummaryData, 25) }}
Totals{{ maternitySummaryData.length }}
+
+
+ + + + + + + + + + + + + + + + + +
No of mothers given Uterotonics (u)Number
Oxytocin + {{ + getParameterTotals( + maternitySummaryData, + 'uterotonic_given', + 1 + ) + }} +
Carbetocin + {{ + getParameterTotals( + maternitySummaryData, + 'uterotonic_given', + 2 + ) + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Mode of delivery (r)Number
No. Normal deliveries (r) + {{ + getParameterTotals( + maternitySummaryData, + 'mode_of_delivery', + 1 + ) + }} +
No. Caesarean sections (r) + {{ + getParameterTotals( + maternitySummaryData, + 'mode_of_delivery', + 2 + ) + }} +
No. Breech deliveries (r) + {{ + getParameterTotals( + maternitySummaryData, + 'mode_of_delivery', + 3 + ) + }} +
No. Assisted vaginal deliveries (r) + {{ + getParameterTotals( + maternitySummaryData, + 'mode_of_delivery', + 4 + ) + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Maternal deaths (y)
Maternal deaths 10-14Years (y) + {{ getMaternalDeathTotals(maternitySummaryData, 10, 14) }} +
Maternal deaths 15-19Years (y) + {{ getMaternalDeathTotals(maternitySummaryData, 15, 19) }} +
Maternal deaths 20 years plus (y){{ getMaternalDeathTotals(maternitySummaryData, 20) }}
Maternal deaths audited + {{ + getMaternalDeathTotals(maternitySummaryData, 10, 14) + + getMaternalDeathTotals(maternitySummaryData, 15, 19) + + getMaternalDeathTotals(maternitySummaryData, 20) + }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Maternal complications (z):AliveDead
No. with APH (z):
No. with PPH(z):
No. with rutpured uterus (z):
No. with obstructed labour (z):
No. with sepsis (z):
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pre Term Babies (q):
Underweight Babies (ac):
Live Birth (ab):
Birth with deformities (ah):
Fresh Still Births (ab):
Macerated Still Births (ab):
+
+
+
+ + + + + + + + + + + + +
Adolescents (10 -19 yrs) New HIV+ maternity (al)(d)
Adolescents (10 -19 yrs) Started HAART (am)(d)
+
+
+ + + + + + + + + + + + +
Young Women (20 -24 yrs) New HIV+ maternity (al)(d)
+ Young Women (20 -24 yrs) Started HAART maternity (am)(d) +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
Initial test at L&D (al):
ARetest at L&D (al):
Positive Results L&D (al):
No. HIV positive deliveries (ab)(al)
+
+
+ + + + + + + + + + + + +
No. Started HAART_L&D (am): + {{ + getParameterTotals( + maternitySummaryData, + 'maternal_haart', + 'Y' + ) + }} +
Infant ARV prophylaxis_L&D(an): + {{ + getParameterTotals( + maternitySummaryData, + 'infant_prophylaxis', + 'Y' + ) + }} +
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
No. of babies applied chlorhexidine for cord care (ag) + {{ + getParameterTotals( + maternitySummaryData, + 'chlorhexdine_applied_on_cord_stump', + 'Y' + ) + }} +
No. of babies given tetracycline at birth (af) + {{ + getParameterTotals( + maternitySummaryData, + 'teo_given_at_birth', + 'Y' + ) + }} +
+ No. of Infants intiatied on breastfeeding within 1 hour after + birth (ae) + + {{ + getParameterTotals( + maternitySummaryData, + 'initiated_on_bf_less_one_hour', + 'Y' + ) + }} +
No. of neonates given Vit "K" (ah) + {{ + getParameterTotals( + maternitySummaryData, + 'given_vitamin_k', + 'Y' + ) + }} +
+
+
+ + + + + + + + + + + + + + + + + + +
No. of babies discharged alive (at): + {{ + getParameterTotals( + maternitySummaryData, + 'baby_status_on_discharge', + 'A' + ) + }} +
Early Neonatal deaths (at):(0-7days) + {{ + getParameterTotals( + maternitySummaryData, + 'baby_status_on_discharge', + 'D' + ) + }} +
Late Neonatal deaths (at):(8-28days) + {{ + getParameterTotals( + maternitySummaryData, + 'baby_status_on_discharge', + 'D' + ) + }} +
+
+

+
+ No record found +
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 index ae122072c..8422d906e 100644 --- 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 @@ -1,7 +1,19 @@ -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 { RegistersResourceService } from 'src/app/etl-api/registers-resource.service'; +import * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; + @Component({ selector: 'app-maternity-register', templateUrl: './maternity-register.component.html', @@ -12,7 +24,7 @@ export class MaternityRegisterComponent implements OnInit { public params: any; public indicators: string; public selectedIndicators = []; - public txnewReportSummaryData: any = []; + public maternitySummaryData: any = []; public columnDefs: any = []; public reportName = 'Martenity Register'; public currentView = 'monthly'; @@ -22,6 +34,7 @@ export class MaternityRegisterComponent implements OnInit { public quarter: string; public eDate: string; public sDate: string; + public jointLocationUuids: string; public statusError = false; public errorMessage = ''; @@ -32,6 +45,8 @@ export class MaternityRegisterComponent implements OnInit { public pinnedBottomRowData: any = []; public _month: string; public isReleased = true; + public generated = false; + @ViewChild('contentToSnapshot') contentToSnapshot!: ElementRef; public _locationUuids: any = []; public get locationUuids(): Array { @@ -66,7 +81,13 @@ export class MaternityRegisterComponent implements OnInit { this._endDate = v; } - constructor(public router: Router, public route: ActivatedRoute) { + constructor( + public router: Router, + public route: ActivatedRoute, + public register: RegistersResourceService, + private datePipe: DatePipe, + private dataAnalyticsDashboardService: DataAnalyticsDashboardService + ) { this.route.queryParams.subscribe((data) => { data.month === undefined ? (this._month = Moment() @@ -82,24 +103,31 @@ export class MaternityRegisterComponent implements OnInit { ngOnInit() {} public onMonthChange(value): any { - this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + // 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.maternitySummaryData = []; + this.getMaternityRegister(this.params); + this.generated = true; } - 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'), startDate: Moment(this.startDate).format('YYYY-MM-DD'), endDate: Moment(this.endDate).format('YYYY-MM-DD') }; @@ -109,31 +137,31 @@ export class MaternityRegisterComponent 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 getMaternityRegister(params: any) { + this.isLoading = true; + this.register.getMaternityRegister(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.maternitySummaryData = data; + this.calculateTotalSummary(); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } public calculateTotalSummary() { const totalsRow = []; - if (this.txnewReportSummaryData.length > 0) { + if (this.maternitySummaryData.length > 0) { const totalObj = { location: 'Totals' }; - _.each(this.txnewReportSummaryData, (row) => { + _.each(this.maternitySummaryData, (row) => { Object.keys(row).map((key) => { if (Number.isInteger(row[key]) === true) { if (totalObj[key]) { @@ -178,4 +206,52 @@ export class MaternityRegisterComponent implements OnInit { 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 366 Care and Treatment Daily Activity.pdf'); + }); + } + + calculateAgeTotals(summaryData: any[], minAge: number, maxAge?: number) { + return ( + summaryData.filter( + (data) => + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + + getMaternalDeathTotals(summaryData: any[], minAge: number, maxAge?: number) { + return ( + summaryData.filter( + (data) => + data['maternal_deaths_notified'] === 'Y' && + data['age'] >= minAge && + (maxAge === undefined || data['age'] <= maxAge) + ).length || '' + ); + } + getParameterTotals( + summaryData: any[], + parameterName: string, + parameterValue: string | number + ) { + return ( + summaryData.filter((data) => data[parameterName] === parameterValue) + .length || '' + ); + } }