-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
2,847 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
9 changes: 9 additions & 0 deletions
9
...rd/hiv/clinic-dashboard-pmtct-rri-report/clinic-dashboard-pmtct-rri-report.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-lg-12 col-md-12 col-sm-12"> | ||
<pmtct-calhiv-rri-report | ||
[locations]="selectedClinic" | ||
></pmtct-calhiv-rri-report> | ||
</div> | ||
</div> | ||
</div> |
37 changes: 37 additions & 0 deletions
37
...oard/hiv/clinic-dashboard-pmtct-rri-report/clinic-dashboard-pmtct-rri-report.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Component, OnInit, OnDestroy } from '@angular/core'; | ||
import { Subscription } from 'rxjs'; | ||
import { Router, ActivatedRoute } from '@angular/router'; | ||
import { ClinicDashboardCacheService } from '../../services/clinic-dashboard-cache.service'; | ||
|
||
@Component({ | ||
selector: 'clinic-dashboard-pmtct-rri-report', | ||
templateUrl: './clinic-dashboard-pmtct-rri-report.component.html', | ||
styleUrls: ['./clinic-dashboard-pmtct-rri-report.component.css'] | ||
}) | ||
export class ClinicDashboardPmtctRriReportComponent implements OnInit { | ||
public selectedClinic = ''; | ||
private subs: Subscription[] = []; | ||
public routeSub: Subscription; | ||
|
||
constructor( | ||
private _router: Router, | ||
private _route: ActivatedRoute, | ||
private _clinicDashboardCacheService: ClinicDashboardCacheService | ||
) {} | ||
|
||
public ngOnInit() { | ||
this.routeSub = this._route.parent.parent.params.subscribe((params) => { | ||
this._clinicDashboardCacheService.setCurrentClinic( | ||
params['location_uuid'] | ||
); | ||
}); | ||
|
||
const sub = this._clinicDashboardCacheService | ||
.getCurrentClinic() | ||
.subscribe((location) => { | ||
this.selectedClinic = location; | ||
}); | ||
|
||
this.subs.push(sub); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { TestBed, inject } from '@angular/core/testing'; | ||
|
||
import { PmtctCalhivRriReportService } from './pmtct-calhiv-rri-report.service'; | ||
|
||
describe('PmtctCalhivRriReportService', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [PmtctCalhivRriReportService] | ||
}); | ||
}); | ||
|
||
it('should be created', inject( | ||
[PmtctCalhivRriReportService], | ||
(service: PmtctCalhivRriReportService) => { | ||
expect(service).toBeTruthy(); | ||
} | ||
)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpClient, HttpParams } from '@angular/common/http'; | ||
import { Observable } from 'rxjs'; | ||
import * as _ from 'lodash'; | ||
import { AppSettingsService } from '../app-settings/app-settings.service'; | ||
import { DataCacheService } from '../shared/services/data-cache.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class PmtctCalhivRriReportService { | ||
constructor( | ||
protected http: HttpClient, | ||
protected appSettingsService: AppSettingsService, | ||
private cacheService: DataCacheService | ||
) {} | ||
|
||
public getBaseUrl(): string { | ||
return this.appSettingsService.getEtlRestbaseurl().trim(); | ||
} | ||
|
||
public getPatientListUrl(): string { | ||
return ( | ||
this.appSettingsService.getEtlRestbaseurl().trim() + | ||
'pmtct_rri_summary/patient-list' | ||
); | ||
} | ||
|
||
public getRriIndicatorsReport(payload: any): Observable<any> { | ||
if (!payload) { | ||
return null; | ||
} | ||
let urlParams: HttpParams = new HttpParams() | ||
.set('endDate', payload.endDate) | ||
.set('startDate', payload.startDate); | ||
|
||
if (payload.locationUuids) { | ||
if (payload.locationUuids.length > 0) { | ||
urlParams = urlParams.set('locationUuids', payload.locationUuids); | ||
} | ||
} | ||
const url = this.getBaseUrl() + 'pmtct_rri_summary'; | ||
return this.http.get(url, { | ||
params: urlParams | ||
}); | ||
} | ||
|
||
public getRriMonthlySummaryPatientList(params: any) { | ||
if (!params) { | ||
return null; | ||
} | ||
|
||
const urlParams: HttpParams = new HttpParams() | ||
.set('startDate', params.startDate) | ||
.set('endDate', params.endDate) | ||
.set('locationUuids', params.locationUuids) | ||
.set('indicators', params.indicators) | ||
.set('reportType', params.reportType); | ||
|
||
const url = this.getPatientListUrl(); | ||
|
||
return this.http.get(url, { | ||
params: urlParams | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/hiv-care-lib/hei-indicators-report/hei-indicators-report.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.