diff --git a/src/app/clinic-dashboard/hiv/hiv-program.routes.ts b/src/app/clinic-dashboard/hiv/hiv-program.routes.ts index fa5c94101..3e869c7d1 100644 --- a/src/app/clinic-dashboard/hiv/hiv-program.routes.ts +++ b/src/app/clinic-dashboard/hiv/hiv-program.routes.ts @@ -225,19 +225,6 @@ const routes: Routes = [ path: 'surge-reports', component: SurgeReportComponent }, - { - path: 'dqa-reports', - children: [ - { - path: 'dqa-report-patientlist', - component: ChartAbstractionPatientlistComponent - }, - { - path: '', - component: DqaReportsComponent - } - ] - }, { path: 'surge-reports/surge-report-patientlist', component: SurgeReportPatientListComponent diff --git a/src/app/etl-api/dqa-chart-abstraction.service.ts b/src/app/etl-api/dqa-chart-abstraction.service.ts index f8825f762..04d3e75e0 100644 --- a/src/app/etl-api/dqa-chart-abstraction.service.ts +++ b/src/app/etl-api/dqa-chart-abstraction.service.ts @@ -18,6 +18,14 @@ export class DqaChartAbstractionService { } public getDqaChartAbstractionReport(params: any): Observable { + let extraParams = ''; + if (params.startDate && params.endDate) { + extraParams += + '&startDate=' + params.startDate + '&endDate=' + params.endDate; + } + if (params.patientType) { + extraParams += '&patientType=' + params.patientType; + } const sampleUrl = this.url + 'dqa-chart-abstraction?locationUuids=' + @@ -25,7 +33,8 @@ export class DqaChartAbstractionService { '&limit=' + params.limit + '&offset=' + - params.offset; + params.offset + + extraParams; return this.http.get(sampleUrl, {}).pipe( map((response: any) => { diff --git a/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.html b/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.html index 370743ef1..ddfc9ca37 100644 --- a/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.html +++ b/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.html @@ -25,28 +25,6 @@

DQA patient list

- -
- - - -

Error loading patient list.

diff --git a/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.ts b/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.ts index 84fcc5759..b26b94e50 100644 --- a/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.ts +++ b/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.ts @@ -29,17 +29,22 @@ export class ChartAbstractionPatientlistComponent implements OnInit { ngOnInit() { let requestParams: any; - this.addExtraColumns(); + this.route.queryParams.subscribe( (params) => { if (params) { + this.patientData = []; + this.isLoading = true; this.params = params; + this.addExtraColumns(this.params.patientType); requestParams = { locations: this.params.locationUuids, - limit: 300, + startDate: this.params.startDate, + endDate: this.params.endDate, + patientType: this.params.patientType, + limit: this.params.limit ? this.params.limit : 10, offset: 0 }; - this.getPatientList(requestParams); } }, @@ -60,19 +65,37 @@ export class ChartAbstractionPatientlistComponent implements OnInit { } }); } - public addExtraColumns() { + public addExtraColumns(patientType) { + let hide = true; + if (patientType === 'PMTCT') { + hide = false; + } const extraColumns = { - person_id: 'Unique Patient ID', + person_id: 'CCC Number', + NUPI: 'NUPI', birthdate: 'DOB', - last_appointment_date: 'Date Of Last Appointment', - next_appointment: 'Date Of Next Appointment ', - drugs_given: 'Drugs Given', + sex_gender: 'Gender', + drugs_given: 'Current Regimen', + drugs_duration: 'Drug dosage given (duration)', weight: 'Weight', height: 'Height', + muac: 'MUAC', BMI: 'BMI', - condom_provided_this_visit: 'Condom Issued', - tb_screened_this_visit: 'TB screening', - last_ipt_start_date: 'IPT initiated' + nutrition: 'Nutrition Assessment Done', + DSD: 'DSD Model', + hiv_start_date: 'Date Confirmed HIV Positive', + arv_start_date: 'Date of ART Initiation', + cd4_1: 'Baseline CD4 Test Result', + vl_1: 'Latest Valid VL', + tpt_status: 'TPT Status', + last_ipt_start_date: 'TPT initiated', + ipt_stop_date: 'TPT Stop Date', + ipt_completion_date: 'TPT Completion Date', + last_clinical_encounter: 'Last Clinical Encounter', + last_appointment_date: 'Date of Last Appointment', + next_appointment: 'Date of Next Appointment ', + visit_type: 'Visit Type', + tb_screened_this_visit: 'TB screening' }; for (const indicator in extraColumns) { if (indicator) { @@ -89,13 +112,38 @@ export class ChartAbstractionPatientlistComponent implements OnInit { if (column.value != null) { return moment(column.value).format('YYYY-MM-DD'); } - } + }, + pinned: false }, { field: 'last_appointment_date', cellRenderer: (column) => { if (column.value != null) { - return moment(column.value).format('YYYY-MM-DD'); + return moment(column.value).format('DD-MM-YYYY'); + } + } + }, + { + field: 'arv_start_date', + cellRenderer: (column) => { + if (column.value != null) { + return moment(column.value).format('DD-MM-YYYY'); + } + } + }, + { + field: 'hiv_start_date', + cellRenderer: (column) => { + if (column.value != null) { + return moment(column.value).format('DD-MM-YYYY'); + } + } + }, + { + field: 'last_clinical_encounter', + cellRenderer: (column) => { + if (column.value != null) { + return moment(column.value).format('DD-MM-YYYY'); } } }, @@ -103,12 +151,12 @@ export class ChartAbstractionPatientlistComponent implements OnInit { field: 'next_appointment', cellRenderer: (column) => { if (column.value != null) { - return moment(column.value).format('YYYY-MM-DD'); + return moment(column.value).format('DD-MM-YYYY'); } } }, { - field: 'condom_provided_this_visit', + field: 'tb_screened_this_visit', width: 150, cellRenderer: (column) => { if (column.value === 0) { @@ -118,42 +166,137 @@ export class ChartAbstractionPatientlistComponent implements OnInit { } }, { - field: 'tb_screened_this_visit', - width: 150, + field: 'vl_1', cellRenderer: (column) => { if (column.value === 0) { - return 'NO'; + return 'LDL'; } - return 'YES'; + return column.value; + } + }, + { + field: 'nutrition', + width: 150, + cellRenderer: (column) => { + if (column.value === 'YES') { + return 'YES'; + } + return 'NO'; } }, { field: 'last_ipt_start_date', cellRenderer: (column) => { if (column.value != null) { - return moment(column.value).format('YYYY-MM-DD'); + return moment(column.value).format('DD-MM-YYYY'); + } + }, + hide: true + }, + { + field: 'ipt_completion_date', + cellRenderer: (column) => { + if (column.value != null) { + return moment(column.value).format('DD-MM-YYYY'); + } + }, + hide: true + }, + { + field: 'ipt_stop_date', + cellRenderer: (column) => { + if (column.value != null) { + return moment(column.value).format('DD-MM-YYYY'); + } + }, + hide: true + }, + { + field: 'arv_start_date', + cellRenderer: (column) => { + if (column.value != null) { + return moment(column.value).format('DD-MM-YYYY'); } } }, + { + field: 'drugs_given', + width: 280 + }, + { + field: 'height', + width: 100 + }, { field: 'weight', - width: 150 + width: 100 }, { - field: 'Height', - width: 150 + field: 'muac', + width: 100 }, { - field: 'BMI', + field: 'visit_type', width: 150 }, + { + field: 'muac', + width: 100 + }, { field: 'person_id', - width: 200 + width: 200, + pinned: true + }, + { + field: 'NUPI', + width: 150, + pinned: true }, { field: 'drugs_given', width: 280 + }, + { + field: 'vl_1', + width: 150 + }, + { + field: 'drugs_duration', + width: 150 + }, + { + field: 'person_name', + width: 150, + hide: true + }, + { + field: 'gender', + width: 150, + hide: true + }, + { + field: 'identifiers', + width: 150, + hide: true + }, + { + field: 'age', + width: 150 + }, + { + field: 'sex_gender', + width: 150 + }, + { + field: '#', + width: 150, + hide: true + }, + { + field: 'visit_type', + width: 150, + hide: true } ); } diff --git a/src/app/hiv-care-lib/dqa-reports/dqa-report-base/dqa-report-base.component.html b/src/app/hiv-care-lib/dqa-reports/dqa-report-base/dqa-report-base.component.html index b390f8ca9..7d0deb213 100644 --- a/src/app/hiv-care-lib/dqa-reports/dqa-report-base/dqa-report-base.component.html +++ b/src/app/hiv-care-lib/dqa-reports/dqa-report-base/dqa-report-base.component.html @@ -4,6 +4,10 @@

diff --git a/src/app/hiv-care-lib/dqa-reports/dqa-report-base/dqa-report-base.component.ts b/src/app/hiv-care-lib/dqa-reports/dqa-report-base/dqa-report-base.component.ts index 529cf2328..8ba306c68 100644 --- a/src/app/hiv-care-lib/dqa-reports/dqa-report-base/dqa-report-base.component.ts +++ b/src/app/hiv-care-lib/dqa-reports/dqa-report-base/dqa-report-base.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; +import * as Moment from 'moment'; import * as _ from 'lodash'; import { take } from 'rxjs/operators'; import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/services/data-analytics-dashboard.services'; @@ -11,10 +12,30 @@ import { DataAnalyticsDashboardService } from 'src/app/data-analytics-dashboard/ styleUrls: ['./dqa-report-base.component.css'] }) export class DqaReportBaseComponent implements OnInit { - public enabledControls = 'locationControl'; + public enabledControls = + 'locationControl,datesControl,patientTypeControl,sampleSizeControl'; public _locationUuids: any = []; public showPatientList = false; public showInfoMessage = false; + public selectedPatientType = ''; + public selectedSampleSize = ''; + private _startDate: Date = Moment().subtract(1, 'month').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; + } public get locationUuids(): Array { return this._locationUuids; } @@ -41,11 +62,14 @@ export class DqaReportBaseComponent implements OnInit { .pipe(take(1)) .subscribe((data) => { if (data) { - console.log(data); this.router.navigate([], { relativeTo: this.route, queryParams: { - locationUuids: this.getSelectedLocations(data.locations) + locationUuids: this.getSelectedLocations(data.locations), + endDate: Moment(this.endDate).format('YYYY-MM-DD'), + startDate: Moment(this.startDate).format('YYYY-MM-DD'), + limit: this.selectedSampleSize, + patientType: this.selectedPatientType } }); this.showPatientList = true; @@ -55,4 +79,10 @@ export class DqaReportBaseComponent implements OnInit { private getSelectedLocations(locationUuids: Array): string { return locationUuids.map((location) => location.value).join(','); } + public patientTypeChange($event) { + this.selectedPatientType = $event; + } + public sampleSizeChange($event) { + this.selectedSampleSize = $event; + } } diff --git a/src/app/shared/dynamic-route/schema/clinic.dashboard.conf.json b/src/app/shared/dynamic-route/schema/clinic.dashboard.conf.json index cf63d4a52..24cb17ebf 100644 --- a/src/app/shared/dynamic-route/schema/clinic.dashboard.conf.json +++ b/src/app/shared/dynamic-route/schema/clinic.dashboard.conf.json @@ -170,12 +170,6 @@ "icon": "fa fa-table", "isSideBarOpen": false }, - { - "url": "dqa-reports", - "label": "DQA Reports", - "icon": "fa fa-pie-chart", - "isSideBarOpen": false - }, { "url": "hei-report", "label": "HEI Report", diff --git a/src/app/shared/report-filters/report-filters.component.html b/src/app/shared/report-filters/report-filters.component.html index 323200986..58697f25f 100644 --- a/src/app/shared/report-filters/report-filters.component.html +++ b/src/app/shared/report-filters/report-filters.component.html @@ -242,6 +242,40 @@ (onLocationChange)="getSelectedLocations($event)" > +
+
+
+ + + +
+
+
+
+ + + +
+
+
diff --git a/src/app/shared/report-filters/report-filters.component.ts b/src/app/shared/report-filters/report-filters.component.ts index 68eb7fdb5..1ce1426cf 100644 --- a/src/app/shared/report-filters/report-filters.component.ts +++ b/src/app/shared/report-filters/report-filters.component.ts @@ -74,6 +74,8 @@ export class ReportFiltersComponent @Output() public startingMonthChange = new EventEmitter(); @Output() public endingMonthChange = new EventEmitter(); @Output() public locationTypeChange = new EventEmitter(); + @Output() public patientTypeChange = new EventEmitter(); + @Output() public sampleSizeChange = new EventEmitter(); public genderOptions: Array = [ { value: 'F', @@ -104,6 +106,106 @@ export class ReportFiltersComponent value: 'primary_care_facility' } ]; + public patientTypeOptions = [ + { + label: 'Adult', + value: 'adult' + }, + { + label: 'Pediatric', + value: 'PEADS' + }, + { + label: 'PMTCT', + value: 'PMTCT' + } + ]; + public sampleSize = [ + { + label: '10', + value: '10' + }, + { + label: '20', + value: '20' + }, + { + label: '30', + value: '30' + }, + { + label: '40', + value: '40' + }, + { + label: '50', + value: '50' + }, + { + label: '60', + value: '60' + }, + { + label: '70', + value: '70' + }, + { + label: '80', + value: '80' + }, + { + label: '90', + value: '90' + }, + { + label: '100', + value: '100' + }, + { + label: '110', + value: '110' + }, + { + label: '120', + value: '120' + }, + { + label: '130', + value: '130' + }, + { + label: '140', + value: '140' + }, + { + label: '150', + value: '150' + }, + { + label: '160', + value: '160' + }, + { + label: '170', + value: '170' + }, + { + label: '180', + value: '180' + }, + { + label: '190', + value: '190' + }, + { + label: '200', + value: '200' + }, + { + label: 'All', + value: 'all' + } + ]; public selectedLoactionType: any; public selectedIndicatorTagsSelectedAll = false; public selectedProgramTagsSelectedAll = false; @@ -520,7 +622,13 @@ export class ReportFiltersComponent this.onMonthChange.emit(value); } public onlocationTypeChange($event: any): void { - console.log('Location Type Change', $event); this.locationTypeChange.emit($event.value); } + + public onpatientTypeChange($event: any): void { + this.patientTypeChange.emit($event.value); + } + public onsampleSizeChange($event: any): void { + this.sampleSizeChange.emit($event.value); + } }