diff --git a/src/app/etl-api/defaulter-tracing-register-resource.service.spec.ts b/src/app/etl-api/defaulter-tracing-register-resource.service.spec.ts new file mode 100644 index 000000000..1599754b5 --- /dev/null +++ b/src/app/etl-api/defaulter-tracing-register-resource.service.spec.ts @@ -0,0 +1,18 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { DefaulterTracingRegisterResourceService } from './defaulter-tracing-register-resource.service'; + +describe('DefaulterTracingRegisterResourceService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [DefaulterTracingRegisterResourceService] + }); + }); + + it('should be created', inject( + [DefaulterTracingRegisterResourceService], + (service: DefaulterTracingRegisterResourceService) => { + expect(service).toBeTruthy(); + } + )); +}); diff --git a/src/app/etl-api/defaulter-tracing-register-resource.service.ts b/src/app/etl-api/defaulter-tracing-register-resource.service.ts new file mode 100644 index 000000000..dc2533f47 --- /dev/null +++ b/src/app/etl-api/defaulter-tracing-register-resource.service.ts @@ -0,0 +1,63 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { AppSettingsService } from '../app-settings/app-settings.service'; +import { catchError, map } from 'rxjs/operators'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class DefaulterTracingRegisterResourceService { + public get url(): string { + return this.appSettingsService.getEtlRestbaseurl().trim(); + } + + constructor( + public http: HttpClient, + public appSettingsService: AppSettingsService + ) {} + + public getDefaulterTracingRegisterMonthlyRegister( + params: any + ): Observable { + console.log('params2etl: ', params); + // tslint:disable-next-line: max-line-length + return this.http + .get( + `${this.url}defaulter-tracing-register?&month=${params.month}&locationUuids=${params.locationUuids}` + ) + .pipe( + catchError((err: any) => { + const error: any = err; + const errorObj = { + error: error.status, + message: error.statusText + }; + return Observable.of(errorObj); + }), + map((response: Response) => { + return response; + }) + ); + } + public getDefaulterTracingRegisterPatientList(params: any): Observable { + // tslint:disable-next-line: max-line-length + return this.http + .get( + `${this.url}defaulter-tracing-register-patient-list?startDate=${params.startDate}&endDate=${params.month}&locationUuids=${params.locationUuids}&indicators=${params.indicators}¤tView=${params.currentView}` + ) + .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/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.css b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.html b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.html new file mode 100644 index 000000000..67625d29e --- /dev/null +++ b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.html @@ -0,0 +1,30 @@ +
+ +
+
+ Loading... +
+

Defaulter Tracing Register patient list

+
+ +
+

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

+ +

+
+
+

Error loading patient list.

+
diff --git a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.spec.ts b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.spec.ts new file mode 100644 index 000000000..3b193a1e0 --- /dev/null +++ b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DefaulterPatientListComponent } from './defaulter-patient-list.component'; + +describe('DefaulterPatientListComponent', () => { + let component: DefaulterPatientListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DefaulterPatientListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DefaulterPatientListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.ts b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.ts new file mode 100644 index 000000000..36646d1c8 --- /dev/null +++ b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-patient-list/defaulter-patient-list.component.ts @@ -0,0 +1,122 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { Location } from '@angular/common'; +import { DefaulterTracingRegisterResourceService } from 'src/app/etl-api/defaulter-tracing-register-resource.service'; + +@Component({ + selector: 'app-defaulter-patient-list', + templateUrl: './defaulter-patient-list.component.html', + styleUrls: ['./defaulter-patient-list.component.css'] +}) +export class DefaulterPatientListComponent 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; + + constructor( + private router: Router, + private route: ActivatedRoute, + private _location: Location, + public dtrResourceService: DefaulterTracingRegisterResourceService + ) {} + + ngOnInit() { + this.route.queryParams.subscribe( + (params) => { + if (params && params.month) { + this.params = params; + this.selectedIndicator = params.indicatorHeader; + this.selectedIndicatorGender = params.indicatorGender; + this.getPatientList(params); + } + }, + (error) => { + console.error('Error', error); + } + ); + this.addExtraColumns(); + } + + private getPatientList(params: any) { + this.dtrResourceService + .getDefaulterTracingRegisterPatientList(params) + .subscribe((data) => { + this.isLoading = false; + this.patientData = data.results.results; + this.hasLoadedAll = true; + }); + } + + public addExtraColumns() { + const extraColumns = { + phone_number: 'Phone', + enrollment_date: 'Enrolment Date', + last_appointment: 'Last Appointment', + latest_rtc_date: 'Latest RTC Date', + days_since_rtc_date: 'Days since RTC', + arv_first_regimen: 'ARV first regimen', + arv_first_regimen_start_date: 'First ARV start date', + cur_meds: 'Current Regimen', + cur_arv_line: 'Current ARV Line', + arv_start_date: 'ARV Start 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', + ovcid_id: 'OVCID' + }; + + 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 goBack() { + this._location.back(); + } +} diff --git a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-record/defaulter-record.component.html b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-record/defaulter-record.component.html index 6ded05b47..babfbd82d 100644 --- a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-record/defaulter-record.component.html +++ b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-record/defaulter-record.component.html @@ -1,46 +1,39 @@

MONTHLY DEFAULTER TRACING AND OUTCOME REGISTER

-
- - - - - - - - - - - - - +
+
{{ h }}
+ + + + + + + + + + + + - - + + - + - + - + - + - + @@ -49,551 +42,552 @@

MONTHLY DEFAULTER TRACING AND OUTCOME REGISTER

- + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ h }}
Serial number Client's Name Patient on ART (Y/N) - Patient type (establlished/not established or Well/Advanced) 12106, - 12107 - CCC Enrollment Date (7013)Patient type (establlished/not established or Well/Advanced)CCC Enrollment Date Is patient enroled in DSD (Y/N)Date of Missed Appointment (1592)Date of Missed Appointment Treatment Supporter Name Client's Physical Address/Nearest Landmark - Verification (insert code of information source) - Verification (insert code of information source) Types of Tracing Note the date of each attempt and outcome on a separate row C=contact (1065) NC=no contact (1066)C=contact NC=no contact Tracer's name (Form enterer)Comments (Note the reasons for defaulting) - (9467)Comments (Note the reasons for defaulting) - Date promised to come (5096) - Date promised to come Final Tracing Outcome Date of Final Outcome/Date Client attended Clinic
Client's unique CCC No. and NUPI Sex (M/F) Age in YrsDate of ART initiation (1499)Date of ART initiation What type of DSD (use codes below) Client's Telephone No. Treatment Supporter Tel No.Client Called (1950)Treatment Supporter Called (9025)Physical Tracing (7066)Client CalledTreatment Supporter CalledPhysical Tracing Outcome(Tick appropriately)
1
2
3
4
5
6
7
8
- Verification code: 1=pharmacy daily register, 2=Pharmacy MSH database, - 3=Pre ART/ART register, 4=CCC patient card - MOH 257 , 5=Hospital death - register, 6=inpatient register, 7=TB/HEI registers. DSD Codes: 1= - Facility Fast track 2= Community ART -
- Outcome Codes: 1. Self Return 2. Brough back to care 3. Transfer Out 4. - Dead 5. Refused Care/ Self Disengaged 6. IIT/LTFU. 7. Refilled Elsewhere -
Summary of Client Outcomes (TOTALS)1234567
-
\ No newline at end of file + + + + + + + + 1 + Tony Austin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11111-22222 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Verification code: 1=pharmacy daily register, 2=Pharmacy MSH database, + 3=Pre ART/ART register, 4=CCC patient card - MOH 257 , 5=Hospital + death register, 6=inpatient register, 7=TB/HEI registers. DSD Codes: + 1= Facility Fast track 2= Community ART + + + + + Outcome Codes: 1. Self Return 2. Brough back to care 3. Transfer Out + 4. Dead 5. Refused Care/ Self Disengaged 6. IIT/LTFU. 7. Refilled + Elsewhere + + + + Summary of Client Outcomes (TOTALS) + 1 + 2 + 3 + 4 + 5 + 6 + 7 + + + + + + + + + + + + + diff --git a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-record/defaulter-record.component.ts b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-record/defaulter-record.component.ts index 5b65de36c..e4a616feb 100644 --- a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-record/defaulter-record.component.ts +++ b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-record/defaulter-record.component.ts @@ -1,22 +1,36 @@ -import { Component, Directive, HostListener, OnInit } from '@angular/core'; -import { DatePipe } from '@angular/common'; +import { + Component, + HostListener, + Inject, + Input, + OnDestroy, + OnInit +} from '@angular/core'; +import { Router } from '@angular/router'; import * as _ from 'lodash'; -import * as moment from 'moment'; -import { ClinicFlowCacheService } from '../../../../hiv-care-lib/clinic-flow/clinic-flow-cache.service'; +import { Subscription } from 'rxjs'; +import { DefaulterTracingRegisterResourceService } from 'src/app/etl-api/defaulter-tracing-register-resource.service'; +import { DefaulterTracingRegisterCacheService } from '../defaulter-tracing-register-cache.service'; @Component({ selector: 'app-defaulter-record', templateUrl: './defaulter-record.component.html', styleUrls: ['./defaulter-record.component.css'] }) -export class DefaulterRecordComponent implements OnInit { - // public locations: Array; +export class DefaulterRecordComponent implements OnInit, OnDestroy { + // tslint:disable-next-line:no-input-rename + @Input('locations') public locationUuids: any; + // tslint:disable-next-line:no-input-rename + @Input('date') public selectedDate: any; + public errors: any[] = []; + public defaulterTracingRegisterData: any[] = []; + public loadingDefaulterTracingRegister = false; + public summarydataLoaded = false; + public selectedLocation: any; // public selectedDate: any; - // private _datePipe: DatePipe; - // constructor(private clinicFlowCache: ClinicFlowCacheService) { - // this._datePipe = new DatePipe('en-US'); - // } + public dataLoaded = false; + private subs: Subscription[] = []; public top = [ 'a', 'b', @@ -39,46 +53,99 @@ export class DefaulterRecordComponent implements OnInit { '' ]; + constructor( + private defaulterTracingRegisterCacheService: DefaulterTracingRegisterCacheService, + private router: Router, + // @Inject('DefaulterTracingRegisterResource') + private defaulterTracingRegisterResourceService: DefaulterTracingRegisterResourceService + ) {} + public ngOnInit() { - // if (this.clinicFlowCache.lastClinicFlowSelectedDate) { - // this.selectedDate = this.clinicFlowCache.lastClinicFlowSelectedDate; - // } else { - // this.selectedDate = this._datePipe.transform(new Date(), 'yyyy-MM-dd'); - // this.clinicFlowCache.setSelectedDate(this.selectedDate); - // } + const sub = this.defaulterTracingRegisterCacheService + .getSelectedLocation() + .subscribe((clinic) => { + this.selectedLocation = clinic; + const dateSub = this.defaulterTracingRegisterCacheService + .getSelectedDate() + .subscribe((date) => { + this.selectedDate = date; + if (this.selectedLocation && this.selectedDate) { + if (this.loadingDefaulterTracingRegister === false) { + this.initParams(); + this.getDefaulterTracingRegister( + this.selectedDate, + this.locationUuids + ); + } + } + }); + this.subs.push(dateSub); + }); + this.subs.push(sub); } - @HostListener('scroll', ['$event']) // for window scroll events - onScroll(event: any) { - console.log('scroll-$event: ', event); - } - public renderClinicFlow(locationData: any) { - // let locations; - // if (locationData && locationData.locations) { - // const locationCheck = _.first(locationData.locations); - // if (_.isObject(locationCheck)) { - // locations = locationData.locations.slice().map((location) => { - // return location.value; - // }); - // } else { - // locations = locationData.locations; - // } - // this.clinicFlowCache.setSelectedLocation(locations); - // } - // this.locations = locations; + public ngOnDestroy(): void { + this.subs.forEach((sub) => { + sub.unsubscribe(); + }); } - public setSelectedDate(date) { - // this.selectedDate = date; - // this.clinicFlowCache.setSelectedDate(date); + public getDefaulterTracingRegister(dateStated, locations) { + this.initParams(); + this.loadingDefaulterTracingRegister = true; + this.defaulterTracingRegisterCacheService.setIsLoading( + this.loadingDefaulterTracingRegister + ); + const params = { + month: dateStated, + locationUuids: locations + }; + const result = this.defaulterTracingRegisterResourceService.getDefaulterTracingRegisterMonthlyRegister( + params + ); + if (result === null) { + throw new Error('Null Defaulter Tracing Register observable'); + } else { + console.log('result:', result); + result.take(1).subscribe( + (data) => { + if (data && data.result.length > 0) { + const formatted = this.defaulterTracingRegisterCacheService.formatData( + data.result + ); + this.defaulterTracingRegisterData = this.defaulterTracingRegisterData.concat( + formatted + ); + this.summarydataLoaded = true; + } else { + this.dataLoaded = true; + } + this.loadingDefaulterTracingRegister = false; + this.defaulterTracingRegisterCacheService.setIsLoading( + this.loadingDefaulterTracingRegister + ); + }, + (error) => { + this.loadingDefaulterTracingRegister = false; + this.defaulterTracingRegisterCacheService.setIsLoading( + this.loadingDefaulterTracingRegister + ); + this.errors.push({ + id: 'Defulter Tracing Register', + message: 'error fetching defaulter tracing register' + }); + } + ); + } } - public navigateDay(value) { - // if (value) { - // const m = moment(new Date(this.selectedDate)); - // const revisedDate = m.add(value, 'd'); - // this.selectedDate = this._datePipe.transform(revisedDate, 'yyyy-MM-dd'); - // this.clinicFlowCache.setSelectedDate(this.selectedDate); - // } + public initParams() { + this.loadingDefaulterTracingRegister = false; + this.dataLoaded = false; + this.errors = []; + this.defaulterTracingRegisterData = []; } + + @HostListener('scroll', ['$event']) // for window scroll events + onScroll(event: any) {} } diff --git a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register-cache.service.spec.ts b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register-cache.service.spec.ts new file mode 100644 index 000000000..eac7db3e0 --- /dev/null +++ b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register-cache.service.spec.ts @@ -0,0 +1,18 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { DefaulterTracingRegisterCacheService } from './defaulter-tracing-register-cache-service.service'; + +describe('DefaulterTracingRegisterCacheServiceService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [DefaulterTracingRegisterCacheService] + }); + }); + + it('should be created', inject( + [DefaulterTracingRegisterCacheService], + (service: DefaulterTracingRegisterCacheService) => { + expect(service).toBeTruthy(); + } + )); +}); diff --git a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register-cache.service.ts b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register-cache.service.ts new file mode 100644 index 000000000..54f541e3f --- /dev/null +++ b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register-cache.service.ts @@ -0,0 +1,220 @@ +import { Injectable } from '@angular/core'; +import * as Moment from 'moment'; +import * as _ from 'lodash'; +import { BehaviorSubject } from 'rxjs'; + +@Injectable() +export class DefaulterTracingRegisterCacheService { + public lastdefaulterTracingRegisterSelectedDate: any; + public dataIsLoading = true; + public initialUuid; + public data: any; + public selectedLocations = new BehaviorSubject(this.initialUuid); + public formatedDate = Moment(new Date()).format('YYYY-MM-DD'); + public selectedDate = new BehaviorSubject(this.formatedDate); + public isLoading = new BehaviorSubject(this.dataIsLoading); + public defaulterTracingRegisterData = new BehaviorSubject(this.data); + + constructor() {} + + public setdefaulterTracingRegisterData(data: any) { + this.initialUuid = data; + this.defaulterTracingRegisterData.next(data); + } + + public getdefaulterTracingRegisterData() { + return this.defaulterTracingRegisterData; + } + + public setSelectedLocation(location: any) { + this.setIsLoading(true); + this.initialUuid = location.value; + this.selectedLocations.next(location); + } + + public getSelectedLocation() { + return this.selectedLocations; + } + + public setSelectedDate(date) { + this.formatedDate = Moment(date).format('YYYY-MM-DD'); + this.lastdefaulterTracingRegisterSelectedDate = this.formatedDate; + this.setIsLoading(true); + this.selectedDate.next(this.formatedDate); + } + public getSelectedDate() { + return this.selectedDate; + } + public setIsLoading(loading: boolean) { + this.isLoading.next(loading); + } + public getIsLoading() { + return this.isLoading; + } + public formatData(defaulterTracingRegisterData) { + const d: any = defaulterTracingRegisterData || []; + let count = 1; + _.forEach(d, (row) => { + row['#'] = count; + if (!row['person_name']) { + row['person_name'] = row['names']; + } + count++; + }); + + return defaulterTracingRegisterData || []; + } + public getdefaulterTracingRegisterColumns() { + return [ + { + headerName: '#', + field: '#', + width: 60, + filter: 'number', + pinned: true + }, + { + headerName: 'Names', + field: 'person_name', + pinned: true, + filter: 'text', + width: 120, + cellStyle: { + 'white-space': 'normal' + } + }, + { + headerName: 'Registered', + field: 'registered', + filter: 'text', + width: 120, + cellStyle: { + 'white-space': 'normal' + }, + cellRenderer: (params) => { + let date = ''; + let time = ''; + if (params.value) { + date = Moment(params.value).format('DD-MM-YYYY'); + time = Moment(params.value).format('H:mmA'); + } + + return ( + '' + + time + + '
' + + '' + + date + + '' + ); + } + }, + { + headerName: 'Triaged', + field: 'triaged', + filter: 'text', + width: 100, + cellRenderer: (params) => { + let date = ''; + let time = ''; + if (params.value) { + date = Moment(params.value).format('DD-MM-YYYY'); + time = Moment(params.value).format('H:mmA'); + } + + return ( + '' + + time + + '
' + + '' + + date + + '' + ); + } + }, + { + headerName: 'Triage Waiting Time (mins)', + width: 210, + filter: 'text', + field: 'time_to_be_triaged' + }, + { + headerName: 'Seen by Clinician', + field: 'seen_by_clinician_date', + filter: 'text', + width: 300, + cellRenderer: (params) => { + return ` + ${params.value} + `; + } + }, + { + headerName: 'Clinician Waiting Time (mins)', + width: 210, + filter: 'text', + field: 'time_to_be_seen_by_clinician' + }, + { + headerName: 'Time to Complete Visit(mins)', + width: 210, + filter: 'text', + field: 'time_to_complete_visit' + }, + { + headerName: 'Location', + width: 200, + filter: 'text', + field: 'location', + cellRenderer: (params) => { + if (params.value === '-') { + return ''; + } else { + return params.value; + } + } + } + ]; + } + public getLocationStatsColumn() { + return [ + { + headerName: 'Location', + width: 120, + filter: 'text', + field: 'location', + pinned: 'left' + }, + { + headerName: ' # Visits', + width: 150, + filter: 'text', + field: 'totalVisitsCount' + }, + { + headerName: '# Incomplete', + width: 180, + filter: 'text', + field: 'incompleteVisitsCount' + }, + { + headerName: 'Median Triage Waiting Time', + width: 250, + filter: 'text', + field: 'medianWaitingTime.medianTriageWaitingTime' + }, + { + headerName: 'Median Clinician Waiting Time ', + width: 250, + filter: 'text', + field: 'medianWaitingTime.medianClinicianWaitingTime' + }, + { + headerName: 'Median Visit Completion Time ', + width: 250, + filter: 'text', + field: 'medianWaitingTime.medianVisitCompletionTime' + } + ]; + } +} diff --git a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register.component.html b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register.component.html index 8e5d036f6..227582fe1 100644 --- a/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register.component.html +++ b/src/app/registers-dashboard/hiv/defaulter-tracing-register/defaulter-tracing-register.component.html @@ -5,21 +5,24 @@

- - + +
+
@@ -35,7 +38,7 @@

class="col-md-4 col-xs-4" style="text-align: center; padding: 1px; margin: 2px 0px 2px 0px" > - {{ selectedDate | date }} + {{ monthString }}


- +

- +