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..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 @@ -44,6 +44,18 @@ 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'; +import { OtzRegisterComponent } from './registers/otz-register/otz-register.component'; +import { Moh731RegisterComponent } from './registers/moh731-register/moh731-register.component'; @NgModule({ imports: [ @@ -97,7 +109,19 @@ 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, + OtzRegisterComponent, + Moh731RegisterComponent ], 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..ab1f08146 --- /dev/null +++ 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 new file mode 100644 index 000000000..aaaf31c18 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.html @@ -0,0 +1,453 @@ +

+ {{ reportName }} +

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

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

+

+ {{ errorMessage }} +

+
+ +
+ +
+
+
+
+
+
+ Ministry Of Health +
+
+ AnteNatal (ANC) Register MOH 405 +
+
+ 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 TestingOther Conditions and TreatmentDewormingIPT 1-3TT DoseSupplementationLLITNsReferrralsRemarks
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 + 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 + 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 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)
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)
+ {{ 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.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..31628171c --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/anc-register/anc-register.component.ts @@ -0,0 +1,219 @@ +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', + styleUrls: ['./anc-register.component.css'] +}) +export class AncRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public ancRegisterData: any = []; + public columnDefs: any = []; + public reportName = 'AnteNatal (ANC) Register MOH 405'; + public currentView = 'monthly'; + public currentViewBelow = 'pdf'; + public month: string; + public year: number; + 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 = 'datesControl, locationControl'; + public pinnedBottomRowData: any = []; + public _month: string; + public isReleased = 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().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 ancRegisterService: ANCRegisterResourceService, + 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 = locationValues.join(', '); + }); + + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(); + }); + this.ancRegisterData = []; + this.getANCRegisterData(this.params); + } + + 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 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.ancRegisterData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.ancRegisterData, (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 405 ANC Register.pdf'); + }); + } +} 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..640a3a1b6 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.css @@ -0,0 +1,26 @@ +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; + transform: rotate(180deg); +} + +.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 new file mode 100644 index 000000000..ea67405a2 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.html @@ -0,0 +1,1340 @@ +

+ {{ reportName }} +

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

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

+

+ {{ errorMessage }} +

+
+ +
+ +
+
+
+
+
+
+ Ministry Of Health +
+
+ HIV Care Treatment Daily Activity Register MOH 366 +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NoDateAMRSIDNational 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)(ap)
{{ a + 1 }} + {{ data.date | date: 'dd/MM/yyyy' }} + + {{ data.amrsID }} + {{ data.national_id_number }} + {{ data.ccc_number?.replace('-', '') }} + {{ data.age }} + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? '✓' : '' }} + + + + {{ data.started_on_art === 'Y' ? data.screened_for_tb : 'NA' }} + + + + {{ data.started_on_art === 'Y' ? data.screened_for_tb : 'NA' }} + + + + {{ data.started_on_art === 'Y' ? data.started_on_tpt : 'NA' }} + + + + {{ data.started_on_art === 'Y' ? data.started_on_tpt : 'NA' }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + + + {{ + data.revisit + ? data.revisit + : data.current_on_art > 0 + ? data.current_on_art + : 1 + }} + + {{ data.dsd_status }}{{ data.dsd_type }}{{ data.remarks }}
{{ data.NUPI }}
+ Data element CODE + HV03-O1HVO3-02HVO3-03HVO3-04HVO3-05HVO3-06HVO3-07HVO3-08HVO3-09HVO3-10HVO3-11HVO3-12HVO3-13HVO3-14HVO3-15HVO3-16HVO3-17HVO3-18HVO3-19HVO3-20HVO3-21HVO3-22HVO3-23HVO3-24HVO3-25HVO3-26HVO3-27HVO3-28HVO3-29HVO3-30HVO3-31HVO3-32HVO3-33HVO3-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.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..3e74e116f --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/cntdaily-register/cntdaily-register.component.ts @@ -0,0 +1,332 @@ +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', + styleUrls: ['./cntdaily-register.component.css'] +}) +export class CntdailyRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public careTreatmentRegisterData: 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 jointLocationUuids: string; + + 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 careTreatmentRegisterService: CareTreatmentResourceService, + 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 = locationValues.join(', '); + }); + + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(); + }); + this.careTreatmentRegisterData = []; + this.getCareTreatmentRegisterData(this.params); + this.generated = true; + } + + 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, + queryParams: this.params + }); + } + + 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 { + 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.careTreatmentRegisterData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.careTreatmentRegisterData, (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, { scale: 2 }).then((canvas) => { + const imgData = canvas.toDataURL('image/png'); + 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; + + 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 || '' + ); + } +} 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..7d7e743ba --- /dev/null +++ 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 new file mode 100644 index 000000000..5c7c15274 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.html @@ -0,0 +1,178 @@ +

+ {{ reportName }} +

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

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

+

+ {{ errorMessage }} +

+
+ +
+ × +

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

+

+ {{ errorMessage }} +

+
+ +
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 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) +
{{ 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 }}
+
+
+
+ No record found +
+
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..7e2df3c06 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/defaultertracing-register/defaultertracing-register.component.ts @@ -0,0 +1,192 @@ +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', + styleUrls: ['./defaultertracing-register.component.css'] +}) +export class DefaultertracingRegisterComponent implements OnInit { + @Output() + public params: any; + public indicators: string; + public selectedIndicators = []; + public defaulterTracingRegisterData: 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 jointLocationUuids: string; + + 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('defaulterTracingcontentToSnapshot') + 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 = locationValues.join(', '); + }); + + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(); + }); + this.defaulterTracingRegisterData = []; + this.getDefaulterTracingRegister(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 getDefaulterTracingRegister(params: any) { + this.isLoading = true; + 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`; + 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, + 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('Defaulter Tracing Register.pdf'); + }); + } +} 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.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..67b6d2129 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.html @@ -0,0 +1,271 @@ +

+ {{ reportName }} +

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

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

+

+ {{ errorMessage }} +

+
+ +
+ +
+
+
+
+
+
+ Ministry Of Health +
+
+ HIV EXPOSED INFANT REGISTER MOH 408 +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Cohort: Month/Year (MMM-YYYY)...........................{{ + formattedStartDate + }}.............................................. +
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 enrollment (DD/MM/YYYY) + Birth Certificate
+ Number +
HEI 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 }} + {{ transformDate(data.date_enrolled) }} + + {{ data.Birth_Certificate_number }} + + {{ data.HEI_ID }} + + {{ data.given_name }} {{ data.middle_name }} + {{ data.family_name }} + + {{ transformDate(data.dob) }} + Sex{{ data.infant_prophylaxis }}{{ data.parent_name }} + {{ data.pcr_one ? data.pcr_one_age_weeks : '' }} + + {{ date_enrolled }} + + {{ transformDate(data.pcr_one ? data.pcr_one_date : '') }} + + {{ data.pcr_two ? data.pcr_two_age_months : '' }} + + {{ transformDate(data.pcr_two ? data.pcr_two_date : '') }} + + {{ data.pcr_three ? data.pcr_three_age_months : '' }} + + {{ transformDate(data.pcr_three ? data.pcr_three_date : '') }} + Infant Feeding + {{ null }} + + {{ data.confirm_pcr ? data.confirm_pcr_age_months : '' }} + + {{ transformDate(data.confirm_pcr ? data.confirm_pcr_date : '') }} + + {{ data.age_in_months_on_first_antibody }} + + {{ transformDate(data.antibody_date) }} + {{ null }} + {{ data.death_date ? data.death_date : data.hei_outcome }} + {{ data.remarks }}
{{ data.NUPI }}{{ data.gender }}{{ data.Phone_Number }} + {{ data.pcr_one }} + + {{ data.pcr_two }} + + {{ data.pcr_three }} + + {{ data.infant_feeding }} + + {{ data.confirm_confirm }} + + {{ data.antibody_test }} + + {{ data.age_in_months === 24 ? data.infant_feeding : '' }} + {{ null }}
+
+
+
+ No record found +
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..c955c2da3 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/hei-register/hei-register.component.ts @@ -0,0 +1,248 @@ +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 * as html2canvas from 'html2canvas'; +import * as jsPDF from 'jspdf'; +@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 jointLocationUuids: string; + + 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 showLocationsControl = true; + public showIsAggregateControl = false; + @ViewChild('heicontentToSnapshot') 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().startOf('month').toDate(); + public get startDate(): Date { + return this._startDate; + } + + public set startDate(v: Date) { + this._startDate = v; + } + + private _endDate: Date = Moment().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 heiRegisterService: HeiRegisterResourceService, + 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 = locationValues.join(', '); + }); + + this.route.parent.parent.params.subscribe((params: any) => { + this.storeParamsInUrl(); + }); + this.heiRegisterData = []; + 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.getSelectedLocations(this.jointLocationUuids), + startDate: startDateMinusOneYear.format('YYYY-MM-DD'), + endDate: endDateMinusOneYear.format('YYYY-MM-DD') + }; + 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 { + this.showInfoMessage = false; + this.columnDefs = data.sectionDefinitions; + this.heiRegisterData = data; + this.generated = true; + 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().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 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; + } +} 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..7228658f8 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.css @@ -0,0 +1,39 @@ +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; +} +.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 new file mode 100644 index 000000000..44779a982 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.html @@ -0,0 +1,738 @@ +

+ {{ 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 +
+
+ MOH 362 HTS LAB, REFERRAL AND LINKAGE REGISTER
+ MOH 362: HTS LAB REGISTER
+
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Serial
+ Number +
+ National
+ Identification
+ Number +
AMRSID + 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)(s)
{{ item.serialNumber }}{{ item.nupiNumber }}{{ 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.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.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') + }} +
+
+
+
+
+
+
+
+
+
+ Ministry Of Health +
+
+ MOH 362 HTS LAB, REFERRAL AND LINKAGE REGISTER
+ REFERRAL AND LINKAGE REGISTER
+
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Serial
+ Number +
AMRSID + 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)
{{ item.serialNumber }}{{ item.amrsID }}{{ 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.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..951a2193e --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/htsrefferallinkage-register/htsrefferallinkage-register.component.ts @@ -0,0 +1,381 @@ +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'; + +@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 htsLabData: any; + public htsLinkageData: 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 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 _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, + private htsService: HtsReferralLinkageService, + 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 = data.month); + + this.showDraftReportAlert(this._month); + }); + } + + ngOnInit() {} + + public onMonthChange(value): any { + this._month = Moment(value).endOf('month').format('YYYY-MM-DD'); + } + + 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 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) => { + 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.isLoading = false; + this.showInfoMessage = false; + const transformedData = this.transformApiData(data); + 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 || '', + amrsID: item.amrsID || '', + 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: item.marital_status || '', + populationType: item.population_type || '', + subPopulation: item.sub_population || '', + 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 || '', + amrsID: item.amrsID || '', + 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.htsLinkageData.length > 0) { + const totalObj = { + location: 'Totals' + }; + _.each(this.htsLinkageData, (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; + } + } + 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 || '' + ); + } +} 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..ab1f08146 --- /dev/null +++ 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 new file mode 100644 index 000000000..369418be5 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.html @@ -0,0 +1,1206 @@ +

+ {{ 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 +
+
+ 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)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
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..ae122072c --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/maternity-register/maternity-register.component.ts @@ -0,0 +1,181 @@ +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 = 'datesControl, locationControl'; + 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; + } + + 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) { + 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'), + 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 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/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/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..ab1f08146 --- /dev/null +++ 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 new file mode 100644 index 000000000..aa9f35a0b --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/nutrition-register/nutrition-register.component.html @@ -0,0 +1,1470 @@ +

+ {{ 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 +
+
+ 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)
+
+
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..ab1f08146 --- /dev/null +++ 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 new file mode 100644 index 000000000..6206fb58f --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/pnc-register/pnc-register.component.html @@ -0,0 +1,895 @@ +

+ {{ 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 +
+
+ 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)
+
+
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..7d7e743ba --- /dev/null +++ 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 new file mode 100644 index 000000000..fcf355c8a --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.html @@ -0,0 +1,211 @@ +

+ {{ reportName }} +

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

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

+

+ {{ errorMessage }} +

+
+ +
+ × +

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

+

+ {{ errorMessage }} +

+
+ +
+ +
+
+
+
+
+
+ Ministry Of Health +
+
+ MOH 267 PrEP Daily Activity Register +
+
+ Ver. July 2023 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PrEP NoDate of Visit + National Identification Number + Age + 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)
+ {{ 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 }}
TOTAL this Month{{ prepRegisterData.length }}
+
+
+
+ No record found +
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..d7f4e3081 --- /dev/null +++ b/src/app/data-analytics-dashboard/hiv/registers/prepdaily-register/prepdaily-register.component.ts @@ -0,0 +1,195 @@ +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-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 prepRegisterData: 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 jointLocationUuids: string; + + 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; + + 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 = []; + 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 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('MM-DD-YYYY'); + } + + 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.prepRegisterData = []; + this.getPrEPRegisterReport(this.params); + this.generated = true; + } + + 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, + queryParams: this.params + }); + } + + 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; + this.errorMessage = `There has been an error while loading the report, please retry again`; + this.isLoading = false; + } else { + this.showInfoMessage = false; + this.prepRegisterData = data; + console.log('PREP DATA IS: ' + JSON.stringify(data)); + this.isLoading = false; + this.showDraftReportAlert(this._month); + } + }); + } + + 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 267 PrEP Daily Activity Register.pdf'); + }); + } +} 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/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; + } +} 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..aa8910e07 --- /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?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; + }) + ); + } +} 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..6e251fd2f --- /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}registers/cntregister?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; + }) + ); + } +} 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..b699baef3 --- /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}registers/heiregister?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 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/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; + }) + ); + } +} 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..4762d9298 --- /dev/null +++ b/src/app/etl-api/registers-resource.service.ts @@ -0,0 +1,152 @@ +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 { + return this.http + .get( + `${this.url}registers/prepregisterdata?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 getDefaulterTracingRegister(params: any): Observable { + return this.http + .get( + `${this.url}registers/defaultertracing?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 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; + }) + ); + } +} 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..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 @@ -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)) 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", 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 @@
- +