Skip to content

Commit

Permalink
POC-352
Browse files Browse the repository at this point in the history
  • Loading branch information
Angie-540 authored and hiqedme committed Oct 5, 2023
1 parent ba6a7d3 commit 35b9e29
Show file tree
Hide file tree
Showing 26 changed files with 1,238 additions and 2 deletions.
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>
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);
}
}
4 changes: 4 additions & 0 deletions src/app/clinic-dashboard/hiv/hiv-program.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ import { ClinicDashboardRetentionReportComponent } from './retention-report/clin
import { ClinicDashboardCaseManagementComponent } from './case-management/clinic-dashboard-case-management.component';
import { PrepReportComponent } from './prep-report/prep-report.component';
import { ClinicDashboardHeiReportComponent } from './clinic-dashboard-hei-indicators-report/clinic-dashboard-hei-report.component';
import { ClinicDashboardPmtctRriReportComponent } from './clinic-dashboard-pmtct-rri-report/clinic-dashboard-pmtct-rri-report.component';

import { HIVListsMicroFrontendComponent } from './hiv-lists-microfrontend-report/hiv-lists-microfrontend.component';
import { FamilyTestingComponent } from './family-testing/family-testing.component';
import { AngularMultiSelectModule } from 'angular2-multiselect-dropdown/angular2-multiselect-dropdown';
Expand Down Expand Up @@ -133,6 +135,7 @@ import { PreAppointmentOutreachComponent } from '../general/pre-appointment-outr
RangeSliderComponent,
RouterModule,
ClinicDashboardHeiReportComponent,
ClinicDashboardPmtctRriReportComponent,
ClinicDashboardGainsAndLossesComponent,
MOH412ClinicDashboardComponent,
MOH412ClinicDashboardPatientListComponent,
Expand Down Expand Up @@ -175,6 +178,7 @@ import { PreAppointmentOutreachComponent } from '../general/pre-appointment-outr
ClinicDashboardCaseManagementComponent,
PrepReportComponent,
ClinicDashboardHeiReportComponent,
ClinicDashboardPmtctRriReportComponent,
HIVListsMicroFrontendComponent,
FamilyTestingComponent,
ClinicDashboardGainsAndLossesComponent,
Expand Down
32 changes: 32 additions & 0 deletions src/app/clinic-dashboard/hiv/hiv-program.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ import { IptReportPatientListComponent } from 'src/app/hiv-care-lib/ipt-report/i

import { ClinicDashboardHeiReportComponent } from './clinic-dashboard-hei-indicators-report/clinic-dashboard-hei-report.component';
import { HeiIndicatorsPatientListComponent } from './../../hiv-care-lib/hei-indicators-report/hei-indicators-patient-list.component';
// pmtct-rri reports
import { PmtctCalhivRriReportComponent } from 'src/app/hiv-care-lib/pmtct-calhiv-rri-report/pmtct-calhiv-rri-report.component';
import { PmtctCalhivRriPatientListComponent } from 'src/app/hiv-care-lib/pmtct-calhiv-rri-report/pmtct-calhiv-patient-list.component';
import { ClinicDashboardPmtctRriReportComponent } from './clinic-dashboard-pmtct-rri-report/clinic-dashboard-pmtct-rri-report.component';

import { HIVListsMicroFrontendComponent } from './hiv-lists-microfrontend-report/hiv-lists-microfrontend.component';
import { FamilyTestingBaseComponent } from 'src/app/hiv-care-lib/family-testing/family-testing-base.component';
import { FamilyTestingContactComponent } from 'src/app/hiv-care-lib/family-testing/family-testing-contact-list.component';
Expand Down Expand Up @@ -296,6 +301,19 @@ const routes: Routes = [
{ path: 'location', component: ClinicFlowLocationStatsComponent },
{ path: '', redirectTo: 'summary', pathMatch: 'prefix' }
]
},
{
path: 'pmtct-rri-report',
children: [
{ path: 'visits', component: ClinicFlowVisitsComponent },
{ path: 'summary', component: ClinicFlowSummaryComponent },
{
path: 'provider-stats',
component: ClinicFlowProviderStatsComponent
},
{ path: 'location', component: ClinicFlowLocationStatsComponent },
{ path: '', redirectTo: 'summary', pathMatch: 'prefix' }
]
}
]
},
Expand Down Expand Up @@ -470,6 +488,20 @@ const routes: Routes = [
}
]
},

{
path: 'pmtct-rri-report',
children: [
{
path: '',
component: ClinicDashboardPmtctRriReportComponent
},
{
path: 'patient-list',
component: PmtctCalhivRriPatientListComponent
}
]
},
{
path: 'pre-appoinment-outreach',
component: PreAppointmentOutreachComponent
Expand Down
2 changes: 2 additions & 0 deletions src/app/etl-api/etl-api.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { HivDifferentiatedCareResourceService } from './hiv-differentiated-care-
import { SurgeResourceService } from './surge-resource.service';
import { PatientEducationService } from './patient-education.service';
import { HeiReportService } from './hei-report.service';
import { PmtctCalhivRriReportService } from './pmtct-calhiv-rri-report.service';
import { CervicalCancerScreeningSummaResourceService } from './cervical-cancer-screening-summary-resource.service';
import { MOH412ResourceService } from './moh-412-resource.service';
import { ClinicFlowResourceService } from './clinic-flow-resource.service';
Expand Down Expand Up @@ -86,6 +87,7 @@ import { LocationUnitsService } from './location-units.service';
HivDifferentiatedCareResourceService,
SurgeResourceService,
HeiReportService,
PmtctCalhivRriReportService,
PatientEducationService,
CervicalCancerScreeningSummaResourceService,
MOH412ResourceService,
Expand Down
18 changes: 18 additions & 0 deletions src/app/etl-api/pmtct-calhiv-rri-report.service.spec.ts
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();
}
));
});
66 changes: 66 additions & 0 deletions src/app/etl-api/pmtct-calhiv-rri-report.service.ts
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
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class HeiIndicatorsFilterComponent implements OnInit {
.endOf('month')
.format('YYYY-MM-DD')
};

this.passParamsToUrl(this.params);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HeiReportService } from './../../etl-api/hei-report.service';
import { take } from 'rxjs/operators';
import { Component, OnInit, Input } from '@angular/core';
import { Subject } from 'rxjs';
import { Router, ActivatedRoute } from '@angular/router';
import { HeiReportService } from './../../etl-api/hei-report.service';
import * as Moment from 'moment';

@Component({
Expand Down
15 changes: 15 additions & 0 deletions src/app/hiv-care-lib/hiv-care-lib.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ import { HeiIndicatorsFilterComponent } from './hei-indicators-report/hei-indica
import { HeiIndicatorsTabularComponent } from './hei-indicators-report/hei-indicators-tabular-component';
import { HeiIndicatorsPatientListComponent } from './hei-indicators-report/hei-indicators-patient-list.component';
import { HeiIndicatorsPdfViewComponent } from './hei-indicators-report/hei-indicators-pdf-view.component';
import { PmtctCalhivRriReportComponent } from './pmtct-calhiv-rri-report/pmtct-calhiv-rri-report.component';
import { PmtctCalhivPdfViewComponent } from './pmtct-calhiv-rri-report/pmtct-calhiv-pdf-view.component';
import { PmtctCalhivRriFiltersComponent } from './pmtct-calhiv-rri-report/pmtct-calhiv-filter.component';
import { PmtctCalhivRriTabularComponent } from './pmtct-calhiv-rri-report/pmtct-calhiv-tabular.component';
import { PmtctCalhivRriPatientListComponent } from './pmtct-calhiv-rri-report/pmtct-calhiv-patient-list.component';
import { HighchartsStatic } from 'angular2-highcharts/dist/HighchartsService';
import { SurgeReportTabularComponent } from './surge-report/surge-report-tabular.component';
import { SurgeReportBaseComponent } from './surge-report/surge-report-base.component';
Expand Down Expand Up @@ -212,6 +217,11 @@ import { TxRttReportPatientListComponent } from './tx-rtt-report/tx-rtt-report-p
HeiIndicatorsTabularComponent,
HeiIndicatorsPatientListComponent,
HeiIndicatorsPdfViewComponent,
PmtctCalhivRriReportComponent,
PmtctCalhivRriTabularComponent,
PmtctCalhivPdfViewComponent,
PmtctCalhivRriFiltersComponent,
PmtctCalhivRriPatientListComponent,
FamilyTestingBaseComponent,
FamilyTestingPatientlistComponent,
FamilyTestingTreeComponent,
Expand Down Expand Up @@ -280,6 +290,11 @@ import { TxRttReportPatientListComponent } from './tx-rtt-report/tx-rtt-report-p
HeiIndicatorsTabularComponent,
HeiIndicatorsPatientListComponent,
HeiIndicatorsPdfViewComponent,
PmtctCalhivRriReportComponent,
PmtctCalhivRriTabularComponent,
PmtctCalhivPdfViewComponent,
PmtctCalhivRriFiltersComponent,
PmtctCalhivRriPatientListComponent,
PatientGainsAndLosesPatientListComponent,
PatientGainsAndLosesComponent,
FamilyTestingBaseComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<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>

Loading

0 comments on commit 35b9e29

Please sign in to comment.