Skip to content

Commit

Permalink
Merge branch 'master' into POC-538
Browse files Browse the repository at this point in the history
  • Loading branch information
sainingo authored Oct 6, 2023
2 parents 8205480 + e11ddd6 commit 0e83192
Show file tree
Hide file tree
Showing 49 changed files with 2,847 additions and 72 deletions.
38 changes: 0 additions & 38 deletions .vscode/launch.json

This file was deleted.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-amrs",
"version": "2.17.1",
"version": "2.17.2",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --port 3000",
Expand Down
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 @@ -216,6 +221,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 @@ -285,6 +295,11 @@ import { TxRttReportPatientListComponent } from './tx-rtt-report/tx-rtt-report-p
HeiIndicatorsTabularComponent,
HeiIndicatorsPatientListComponent,
HeiIndicatorsPdfViewComponent,
PmtctCalhivRriReportComponent,
PmtctCalhivRriTabularComponent,
PmtctCalhivPdfViewComponent,
PmtctCalhivRriFiltersComponent,
PmtctCalhivRriPatientListComponent,
PatientGainsAndLosesPatientListComponent,
PatientGainsAndLosesComponent,
FamilyTestingBaseComponent,
Expand Down
Loading

0 comments on commit 0e83192

Please sign in to comment.