forked from AMPATH/ng2-amrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* POC-352 * [POC-539-fix] dna pcr snapshot (AMPATH#1674) * POC-352: suggested changes --------- Co-authored-by: Angie-540 <[email protected]> Co-authored-by: Henry Korir <[email protected]> Co-authored-by: Drizzentic <[email protected]>
- Loading branch information
1 parent
66cd364
commit 43c4cb4
Showing
26 changed files
with
1,233 additions
and
2 deletions.
There are no files selected for viewing
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
103 changes: 103 additions & 0 deletions
103
src/app/hiv-care-lib/pmtct-calhiv-rri-report/pmtct-calhiv-filter.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,103 @@ | ||
<div style="margin-top: 4px; margin-bottom: 4px" class="container-fluid"> | ||
<div | ||
style=" | ||
padding: 0px; | ||
border: 1px double lightgray; | ||
border-bottom: 0px; | ||
cursor: pointer; | ||
" | ||
class="row" | ||
(click)="filterCollapsed = !filterCollapsed" | ||
> | ||
<span class="text-info" style="margin: 2px; font-weight: bold"> | ||
<span | ||
class="glyphicon glyphicon-filter" | ||
style="font-weight: normal" | ||
></span> | ||
Report filters</span | ||
> | ||
<span style="margin: 2px" class="label label-default pull-right"> | ||
<span | ||
class="glyphicon glyphicon-chevron-down" | ||
*ngIf="!filterCollapsed" | ||
></span> | ||
<span | ||
class="glyphicon glyphicon-chevron-up" | ||
*ngIf="filterCollapsed" | ||
></span> | ||
</span> | ||
</div> | ||
<div style="padding: 0px; border: 1px double lightgray" class="row"> | ||
<div *ngIf="!filterCollapsed"> | ||
<div | ||
class="col-xs-10" | ||
style="padding: 4px; border-left: 4px solid lightgray" | ||
> | ||
<div *ngIf="!isMonthMode" class="form-row"> | ||
<label for="startDate">Start Date</label> | ||
<input | ||
id="startDate" | ||
type="date" | ||
class="form-control" | ||
[(ngModel)]="startDateString" | ||
/> | ||
</div> | ||
<div *ngIf="!isMonthMode" class="form-row"> | ||
<label for="endDate">End Date</label> | ||
<input | ||
id="endDate" | ||
type="date" | ||
class="form-control" | ||
[(ngModel)]="endDateString" | ||
/> | ||
</div> | ||
<div *ngIf="isMonthMode" class="form-row"> | ||
<label for="month">Month:</label> | ||
<input | ||
id="month" | ||
type="month" | ||
class="form-control" | ||
[(ngModel)]="monthString" | ||
/> | ||
</div> | ||
<div class="form-row" *ngIf="showIsAggregateControl"> | ||
<label for="isAggregate">Aggregate Locations</label> | ||
<input | ||
id="isAggregate" | ||
type="checkbox" | ||
name="aggregated" | ||
[checked]="isAggregated" | ||
(change)="isAggregated = !isAggregated" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div | ||
style="padding: 0px; border: 1px double lightgray" | ||
class="row" | ||
*ngIf="showLocationsControl" | ||
> | ||
<location-filter | ||
[multiple]="true" | ||
[locationUuids]="locationUuids" | ||
(onLocationChange)="onLocationsSelected($event)" | ||
></location-filter> | ||
</div> | ||
<div class="row" style="margin-top: 4px; padding: 0px"> | ||
<button | ||
type="button" | ||
*ngIf="!parentIsBusy" | ||
class="btn btn-primary pull-right" | ||
(click)="onClickedGenerate()" | ||
> | ||
Generate Report | ||
</button> | ||
<span | ||
class="pull-right" | ||
style="font-weight: bold; color: gray" | ||
*ngIf="parentIsBusy" | ||
>Loading report..</span | ||
> | ||
</div> | ||
</div> |
Oops, something went wrong.