Skip to content

Commit

Permalink
Add data analytics to hts
Browse files Browse the repository at this point in the history
  • Loading branch information
sainingo committed Nov 4, 2024
1 parent 605674d commit c45faec
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/app/clinic-dashboard/hts/hts-program.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { DailyScheduleClinicFlowComponent } from './clinic-flow/daily-schedule-c
import { ProgramVisitEncounterSearchModule } from '../../program-visit-encounter-search/program-visit-encounter-search.module';
import { GeneralModule } from '../general/general.module';
import { ChangeDepartmentModule } from '../change-department/change-department.module';
import { HtsMonthlyScheduleComponent } from './monthly-schedule/monthly-schedule.component';

@NgModule({
imports: [
Expand All @@ -38,7 +39,11 @@ import { ChangeDepartmentModule } from '../change-department/change-department.m
ChangeDepartmentModule
],
exports: [],
declarations: [HTSDailyScheduleComponent, DailyScheduleClinicFlowComponent],
declarations: [
HTSDailyScheduleComponent,
HtsMonthlyScheduleComponent,
DailyScheduleClinicFlowComponent
],
providers: []
})
export class HTSModule {}
5 changes: 5 additions & 0 deletions src/app/clinic-dashboard/hts/hts-program.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ClinicFlowLocationStatsComponent } from '../../hiv-care-lib/clinic-flow
import { ClinicFlowProviderStatsComponent } from '../../hiv-care-lib/clinic-flow/clinic-flow-provider-stats.component';
import { ClinicFlowSummaryComponent } from '../../hiv-care-lib/clinic-flow/clinic-flow-summary.component';
import { ChangeDepartmentComponent } from '../change-department/change-department.component';
import { HtsMonthlyScheduleComponent } from './monthly-schedule/monthly-schedule.component';
const routes: Routes = [
{
path: 'daily-schedule',
Expand Down Expand Up @@ -41,6 +42,10 @@ const routes: Routes = [
}
]
},
{
path: 'monthly-schedule',
component: HtsMonthlyScheduleComponent
},
{
path: 'department-select',
component: ChangeDepartmentComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { Subscription } from 'rxjs';
import { Router, ActivatedRoute, Params } from '@angular/router';
import {
CalendarEvent,
CalendarEventAction,
CalendarEventTimesChangedEvent,
CalendarMonthViewDay
} from 'angular-calendar';
import { MonthlyScheduleBaseComponent } from '../../../clinic-schedule-lib/monthly-schedule/monthly-schedule.component';
import { SelectDepartmentService } from './../../../shared/services/select-department.service';
import { ClinicDashboardCacheService } from '../../services/clinic-dashboard-cache.service';
import { AppFeatureAnalytics } from '../../../shared/app-analytics/app-feature-analytics.service';
import { PatientProgramResourceService } from '../../../etl-api/patient-program-resource.service';
import { LocalStorageService } from '../../../utils/local-storage.service';
import { MonthlyScheduleResourceService } from '../../../etl-api/monthly-scheduled-resource.service';
@Component({
selector: 'hts-monthly-schedule',
templateUrl:
'../../../clinic-schedule-lib/monthly-schedule/monthly-schedule.component.html'
})
export class HtsMonthlyScheduleComponent
extends MonthlyScheduleBaseComponent
implements OnInit, OnDestroy {
public routeSub: Subscription = new Subscription();
public myDepartment = 'HTS';

constructor(
public monthlyScheduleResourceService: MonthlyScheduleResourceService,
public clinicDashboardCacheService: ClinicDashboardCacheService,
public router: Router,
public route: ActivatedRoute,
public appFeatureAnalytics: AppFeatureAnalytics,
public localstorageService: LocalStorageService,
public patientProgramService: PatientProgramResourceService,
public selectDepartmentService: SelectDepartmentService
) {
super(
monthlyScheduleResourceService,
clinicDashboardCacheService,
router,
route,
appFeatureAnalytics,
localstorageService,
patientProgramService
);
}

public ngOnInit() {
this.selectDepartmentService.setDepartment(this.myDepartment);
this.route.parent.parent.params.subscribe((params) => {
this.clinicDashboardCacheService.setCurrentClinic(
params['location_uuid']
);
});
}

public ngOnDestroy() {
this.routeSub.unsubscribe();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export const routes: Routes = [
{
path: 'cdm',
loadChildren: './cdm/data-analytics-cdm.module#DataAnalyticsCdmModule'
},
{
path: 'hts',
loadChildren: './hts/data-analytics-hts.module#DataAnalyticsHtsModule'
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/data-analytics-dashboard/data-analytics.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export class DataAnalyticsDashboardComponent implements OnInit {
case 'cdm':
this.router.navigate(['/data-analytics', department, 'clinic-flow']);
break;

case 'hts':
this.router.navigate(['/data-analytics', department, 'clinic-flow']);
break;
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/app/data-analytics-dashboard/data-analytics.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { PocHttpInteceptor } from '../shared/services/poc-http-interceptor';
import { ClinicRoutesFactory } from '../navigation/side-navigation/clinic-side-nav/clinic-side-nav-routes.factory';
import { DataAnalyticsDashboardComponent } from './data-analytics.component';
import { DataAnalyticsHtsModule } from './hts/data-analytics-hts.module';
/**
* Do not specify providers for modules that might be imported by a lazy loaded module.
*/
Expand Down Expand Up @@ -67,7 +68,8 @@ import { DataAnalyticsDashboardComponent } from './data-analytics.component';
MatProgressBarModule,
CacheModule,
DataEntryStatisticsModule,
DataAnalyticsCdmModule
DataAnalyticsCdmModule,
DataAnalyticsHtsModule
],
declarations: [DataAnalyticsDashboardComponent],
providers: [
Expand Down
19 changes: 19 additions & 0 deletions src/app/data-analytics-dashboard/hts/data-analytics-hts.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PatientProgramEnrollmentModule } from '../../patients-program-enrollment/patients-program-enrollment.module';
import { DataEntryStatisticsModule } from '../../data-entry-statistics/data-entry-statistics.module';
import { ChangeDepartmentModule } from '../change-department/change-department.module';
import { DataAnalyticsHivModule } from '../hiv/data-analytics-hiv.module';
@NgModule({
imports: [
CommonModule,
PatientProgramEnrollmentModule,
DataEntryStatisticsModule,
ChangeDepartmentModule,
DataAnalyticsHivModule
],
exports: [],
declarations: [],
providers: []
})
export class DataAnalyticsHtsModule {}
48 changes: 48 additions & 0 deletions src/app/data-analytics-dashboard/hts/data-analytics-hts.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DataEntryStatisticsComponent } from '../../data-entry-statistics/data-entry-statistics.component';
import { DataEntryStatisticsPatientListComponent } from '../../data-entry-statistics/data-entry-statistics-patient-list.component';
import { PatientsProgramEnrollmentComponent } from '../../patients-program-enrollment/patients-program-enrollment.component';
import { ProgramEnrollmentPatientListComponent } from '../../patients-program-enrollment/program-enrollent-patient-list.component';
import { ChangeDepartmentComponent } from '../change-department/change-department.component';
import { AdminDashboardClinicFlowComponent } from '../hiv/clinic-flow/admin-dashboard-clinic-flow';
const routes: Routes = [
{
path: 'clinic-flow',
component: AdminDashboardClinicFlowComponent
},
{
path: 'program-enrollment',
children: [
{
path: '',
component: PatientsProgramEnrollmentComponent
},
{
path: 'patient-list',
component: ProgramEnrollmentPatientListComponent
}
]
},
{
path: 'data-entry-statistics',
children: [
{
path: '',
component: DataEntryStatisticsComponent
},
{
path: 'patient-list',
component: DataEntryStatisticsPatientListComponent
}
]
},
{
path: 'select-department',
component: ChangeDepartmentComponent
}
];

export const DataAnalyticsDashboardOncologyRouting: ModuleWithProviders = RouterModule.forChild(
routes
);
2 changes: 2 additions & 0 deletions src/app/group-manager/group-detail/group-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export class GroupDetailComponent implements OnInit, OnDestroy, AfterViewInit {
this.communityGroupService.getGroupByUuid(uuid)
]);
dcOtzSubs.subscribe((results) => {
console.log('results here', results);
const res = results[0];
this.numberOfMembers = res.cohortMembers.length;
this.group = res;
Expand Down Expand Up @@ -221,6 +222,7 @@ export class GroupDetailComponent implements OnInit, OnDestroy, AfterViewInit {
}

public generateMembersData(cohortMembers, cohortVisits) {
console.log('cohortMembers', cohortMembers);
this.membersData = [];
this.columns = [];
const memberUuids = this.generatePatientUuids(cohortMembers);
Expand Down
4 changes: 3 additions & 1 deletion src/app/openmrs-api/community-group-resource.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class CommunityGroupService {

return one$;
}
// 'custom:(attributes,auditInfo,cohortLeaders,cohortType,cohortVisits,description,display,endDate,groupCohort,location,name,startDate,uuid,voided,voidReason)'

public _getGroupByUuid(
groupUuid: string,
Expand All @@ -94,7 +95,7 @@ export class CommunityGroupService {
let group: any;
const params = new HttpParams().set(
'v',
'custom:(attributes,auditInfo,cohortLeaders,cohortType,cohortVisits,description,display,endDate,groupCohort,location,name,startDate,uuid,voided,voidReason)'
'custom:(attributes,auditInfo,cohortLeaders,cohortType,description,display,endDate,groupCohort,location,name,startDate,uuid,voided,voidReason)'
);
const url = this.getOpenMrsBaseUrl() + '/cohort' + `/${groupUuid}`;
return this.http
Expand All @@ -105,6 +106,7 @@ export class CommunityGroupService {
map((response) => {
group = response;
group.cohortMembers = cohortMembers;
console.log('group is already here', group);
return group;
})
);
Expand Down
31 changes: 31 additions & 0 deletions src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,37 @@
"isDistinct": true
}
]
},
{
"departmentName": "HTS",
"baseRoute": "hts",
"alias": "hts",
"routes": [
{
"url": "clinic-flow",
"label": "Clinic Flow",
"icon": "fa fa-clock-o"
},
{
"url": "program-enrollment",
"label": "Program Enrollment",
"icon": "fa fa-list-alt",
"isSideBarOpen": false
},
{
"url": "data-entry-statistics",
"label": "Data Entry Statistics",
"icon": "fa fa-bar-chart",
"isSideBarOpen": false
},
{
"url": "select-department",
"label": "Change Department",
"icon": "fa fa-exchange",
"isSideBarOpen": false,
"isDistinct": true
}
]
}
]
}

0 comments on commit c45faec

Please sign in to comment.