diff --git a/src/app/clinic-dashboard/hts/hts-program.module.ts b/src/app/clinic-dashboard/hts/hts-program.module.ts index f7122063a..cd0330df9 100644 --- a/src/app/clinic-dashboard/hts/hts-program.module.ts +++ b/src/app/clinic-dashboard/hts/hts-program.module.ts @@ -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: [ @@ -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 {} diff --git a/src/app/clinic-dashboard/hts/hts-program.routes.ts b/src/app/clinic-dashboard/hts/hts-program.routes.ts index c22ab412c..fa193d1f0 100644 --- a/src/app/clinic-dashboard/hts/hts-program.routes.ts +++ b/src/app/clinic-dashboard/hts/hts-program.routes.ts @@ -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', @@ -41,6 +42,10 @@ const routes: Routes = [ } ] }, + { + path: 'monthly-schedule', + component: HtsMonthlyScheduleComponent + }, { path: 'department-select', component: ChangeDepartmentComponent diff --git a/src/app/clinic-dashboard/hts/monthly-schedule/monthly-schedule.component.ts b/src/app/clinic-dashboard/hts/monthly-schedule/monthly-schedule.component.ts new file mode 100644 index 000000000..91aae0504 --- /dev/null +++ b/src/app/clinic-dashboard/hts/monthly-schedule/monthly-schedule.component.ts @@ -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(); + } +} diff --git a/src/app/data-analytics-dashboard/data-analytics-dashboard-routes.ts b/src/app/data-analytics-dashboard/data-analytics-dashboard-routes.ts index 616cd9aed..1110795ba 100644 --- a/src/app/data-analytics-dashboard/data-analytics-dashboard-routes.ts +++ b/src/app/data-analytics-dashboard/data-analytics-dashboard-routes.ts @@ -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' } ] } diff --git a/src/app/data-analytics-dashboard/data-analytics.component.ts b/src/app/data-analytics-dashboard/data-analytics.component.ts index 97408e581..b16c793de 100644 --- a/src/app/data-analytics-dashboard/data-analytics.component.ts +++ b/src/app/data-analytics-dashboard/data-analytics.component.ts @@ -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; } } diff --git a/src/app/data-analytics-dashboard/data-analytics.module.ts b/src/app/data-analytics-dashboard/data-analytics.module.ts index 1042c7910..e2c353070 100644 --- a/src/app/data-analytics-dashboard/data-analytics.module.ts +++ b/src/app/data-analytics-dashboard/data-analytics.module.ts @@ -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. */ @@ -67,7 +68,8 @@ import { DataAnalyticsDashboardComponent } from './data-analytics.component'; MatProgressBarModule, CacheModule, DataEntryStatisticsModule, - DataAnalyticsCdmModule + DataAnalyticsCdmModule, + DataAnalyticsHtsModule ], declarations: [DataAnalyticsDashboardComponent], providers: [ diff --git a/src/app/data-analytics-dashboard/hts/data-analytics-hts.module.ts b/src/app/data-analytics-dashboard/hts/data-analytics-hts.module.ts new file mode 100644 index 000000000..571a7b59f --- /dev/null +++ b/src/app/data-analytics-dashboard/hts/data-analytics-hts.module.ts @@ -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 {} diff --git a/src/app/data-analytics-dashboard/hts/data-analytics-hts.routes.ts b/src/app/data-analytics-dashboard/hts/data-analytics-hts.routes.ts new file mode 100644 index 000000000..da7bc786b --- /dev/null +++ b/src/app/data-analytics-dashboard/hts/data-analytics-hts.routes.ts @@ -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 +); diff --git a/src/app/group-manager/group-detail/group-detail.component.ts b/src/app/group-manager/group-detail/group-detail.component.ts index 5d1b3f69c..b73bf565f 100644 --- a/src/app/group-manager/group-detail/group-detail.component.ts +++ b/src/app/group-manager/group-detail/group-detail.component.ts @@ -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; @@ -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); diff --git a/src/app/openmrs-api/community-group-resource.service.ts b/src/app/openmrs-api/community-group-resource.service.ts index 01e928abf..b733f3d9a 100644 --- a/src/app/openmrs-api/community-group-resource.service.ts +++ b/src/app/openmrs-api/community-group-resource.service.ts @@ -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, @@ -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 @@ -105,6 +106,7 @@ export class CommunityGroupService { map((response) => { group = response; group.cohortMembers = cohortMembers; + console.log('group is already here', group); return group; }) ); diff --git a/src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json b/src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json index 0cc6d3a9c..9425c71d8 100644 --- a/src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json +++ b/src/app/shared/dynamic-route/schema/analytics.dashboard.conf.json @@ -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 + } + ] } ] }