From 4d7a321c2e7e331c69fbb2bc9fb1e11ccd0afed5 Mon Sep 17 00:00:00 2001 From: sainingo Date: Thu, 24 Oct 2024 12:31:43 +0300 Subject: [PATCH 1/4] Initial commit for HTS Module --- .../department-programs-config.json | 9 +++++++++ .../dynamic-route/schema/patient.dashboard.conf.json | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/app/program-visit-encounter-search/department-programs-config.json b/src/app/program-visit-encounter-search/department-programs-config.json index 1781dc95b..82395febb 100644 --- a/src/app/program-visit-encounter-search/department-programs-config.json +++ b/src/app/program-visit-encounter-search/department-programs-config.json @@ -139,5 +139,14 @@ "name": "DERMATOLOGY" } ] + }, + "uud7": { + "name": "HTS", + "programs": [ + { + "uuid": "a0f8382f-df8a-4f1d-8959-9fb6eef90353", + "name": "HTS PROGRAM" + } + ] } } diff --git a/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json b/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json index 149bf0bc3..f39dc253d 100644 --- a/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json +++ b/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json @@ -578,6 +578,16 @@ "requiresPatientEnrollment": true, "routes": [] }, + { + "programName": "Hiv Testing Services", + "programUuid": "a0f8382f-df8a-4f1d-8959-9fb6eef90353", + "baseRoute": "a0f8382f-df8a-4f1d-8959-9fb6eef90353", + "alias": "hts", + "published": true, + "requiresPatientEnrollment": true, + "shared-routes-class": "hts", + "routes": [] + }, { "programName": "Mental Health", "programUuid": "6976b7eb-6d66-4aba-bcc0-cd8be80041cd", From 20e0b0a44aeb14e81067f4c294b66205b89902e2 Mon Sep 17 00:00:00 2001 From: sainingo Date: Fri, 25 Oct 2024 13:03:47 +0300 Subject: [PATCH 2/4] Work on HTS workflows --- .../clinic-dashboard-routing.ts | 5 ++ .../clinic-dashboard.module.ts | 4 +- .../clinic-dashboard.routes.ts | 4 + .../daily-schedule-clinic-flow.component.html | 1 + ...ily-schedule-clinic-flow.component.spec.ts | 34 ++++++++ .../daily-schedule-clinic-flow.component.ts | 44 +++++++++++ .../daily-schedule.component.ts | 78 +++++++++++++++++++ .../hts/hts-program.module.ts | 44 +++++++++++ .../hts/hts-program.routes.ts | 52 +++++++++++++ .../patient-dashboard.routes.ts | 5 ++ .../schema/clinic.dashboard.conf.json | 13 ++++ .../schema/patient.dashboard.conf.json | 72 ++++++++++++++++- 12 files changed, 353 insertions(+), 3 deletions(-) create mode 100644 src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.html create mode 100644 src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.spec.ts create mode 100644 src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.ts create mode 100644 src/app/clinic-dashboard/hts/daily-schedule/daily-schedule.component.ts create mode 100644 src/app/clinic-dashboard/hts/hts-program.module.ts create mode 100644 src/app/clinic-dashboard/hts/hts-program.routes.ts diff --git a/src/app/clinic-dashboard/clinic-dashboard-routing.ts b/src/app/clinic-dashboard/clinic-dashboard-routing.ts index 893240e7c..f05f819ba 100644 --- a/src/app/clinic-dashboard/clinic-dashboard-routing.ts +++ b/src/app/clinic-dashboard/clinic-dashboard-routing.ts @@ -66,6 +66,11 @@ const clinicDashboardRoutes: Routes = [ (mod) => mod.MNCHModule ) }, + { + path: 'hts', + loadChildren: () => + System.import('./hts/hts-program.module').then((mod) => mod.HTSModule) + }, { path: '', redirectTo: 'general', diff --git a/src/app/clinic-dashboard/clinic-dashboard.module.ts b/src/app/clinic-dashboard/clinic-dashboard.module.ts index 75c842d91..b3a65debf 100644 --- a/src/app/clinic-dashboard/clinic-dashboard.module.ts +++ b/src/app/clinic-dashboard/clinic-dashboard.module.ts @@ -54,6 +54,7 @@ import { PatientProgramEnrollmentModule } from './../patients-program-enrollment import { PatientReferralProgramModule } from './referral/patient-referral-program.module'; import { ClinicRoutesFactory } from '../navigation/side-navigation/clinic-side-nav/clinic-side-nav-routes.factory'; import { MNCHModule } from './mnch/mnch-program.module'; +import { HTSModule } from './hts/hts-program.module'; @NgModule({ declarations: [ @@ -102,7 +103,8 @@ import { MNCHModule } from './mnch/mnch-program.module'; NgxPaginationModule, PatientReferralProgramModule, OncologyProgramModule, - MNCHModule + MNCHModule, + HTSModule ], providers: [ ClinicDashboardCacheService, diff --git a/src/app/clinic-dashboard/clinic-dashboard.routes.ts b/src/app/clinic-dashboard/clinic-dashboard.routes.ts index 36fda96ea..9c575c2f1 100644 --- a/src/app/clinic-dashboard/clinic-dashboard.routes.ts +++ b/src/app/clinic-dashboard/clinic-dashboard.routes.ts @@ -32,6 +32,10 @@ export const routes = [ path: 'mnch', loadChildren: './mnch/mnch-program.module#MNCHModule' }, + { + path: 'hts', + loadChildren: './hts/hts-program.module#HTSModule' + }, { path: '', redirectTo: 'general', pathMatch: 'prefix' } ] } diff --git a/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.html b/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.html new file mode 100644 index 000000000..419c8501f --- /dev/null +++ b/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.html @@ -0,0 +1 @@ + diff --git a/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.spec.ts b/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.spec.ts new file mode 100644 index 000000000..e58c1e997 --- /dev/null +++ b/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.spec.ts @@ -0,0 +1,34 @@ +import { ComponentFixture, async, TestBed } from '@angular/core/testing'; + +import { DateTimePickerModule } from '@ampath-kenya/ngx-openmrs-formentry'; +import { CalendarModule } from 'angular-calendar'; +import { NgxMyDatePickerModule } from 'ngx-mydatepicker'; + +import { DailyScheduleClinicFlowComponent } from './daily-schedule-clinic-flow.component'; +import { ClinicFlowCacheService } from '../../../hiv-care-lib/clinic-flow/clinic-flow-cache.service'; +import { ClinicDashboardCacheService } from '../../services/clinic-dashboard-cache.service'; + +describe('Daily-schedule-clinic-flow Tests', () => { + let comp: DailyScheduleClinicFlowComponent; + let fixture: ComponentFixture; + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + DateTimePickerModule, + NgxMyDatePickerModule.forRoot(), + CalendarModule.forRoot() + ], + declarations: [DailyScheduleClinicFlowComponent], + providers: [ClinicFlowCacheService, ClinicDashboardCacheService] + }) + .compileComponents() + .then(() => { + fixture = TestBed.createComponent(DailyScheduleClinicFlowComponent); + comp = fixture.componentInstance; + }); + })); + + /*it('should be defined', () => { + expect(comp).toBeDefined(); + });*/ +}); diff --git a/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.ts b/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.ts new file mode 100644 index 000000000..96c693c1b --- /dev/null +++ b/src/app/clinic-dashboard/hts/clinic-flow/daily-schedule-clinic-flow.component.ts @@ -0,0 +1,44 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { DatePipe } from '@angular/common'; + +import { ClinicFlowCacheService } from '../../../hiv-care-lib/clinic-flow/clinic-flow-cache.service'; +import { ClinicDashboardCacheService } from '../../services/clinic-dashboard-cache.service'; +import { Subscription } from 'rxjs'; + +@Component({ + selector: 'daily-schedule-clinic-flow-component', + templateUrl: './daily-schedule-clinic-flow.component.html' +}) +export class DailyScheduleClinicFlowComponent implements OnInit, OnDestroy { + public selectedDate: any; + private _datePipe: DatePipe; + private subs: Subscription[] = []; + constructor( + private clinicFlowCache: ClinicFlowCacheService, + private clinicDashboardCacheService: ClinicDashboardCacheService + ) { + this._datePipe = new DatePipe('en-US'); + } + + public ngOnInit() { + if (this.clinicFlowCache.lastClinicFlowSelectedDate) { + this.selectedDate = this.clinicFlowCache.lastClinicFlowSelectedDate; + } else { + this.selectedDate = this._datePipe.transform(new Date(), 'yyyy-MM-dd'); + this.clinicFlowCache.setSelectedDate(this.selectedDate); + } + const routeSub = this.clinicDashboardCacheService + .getCurrentClinic() + .subscribe((clinic) => { + this.clinicFlowCache.setSelectedLocation(clinic); + }); + + this.subs.push(routeSub); + } + + public ngOnDestroy() { + this.subs.forEach((sub) => { + sub.unsubscribe(); + }); + } +} diff --git a/src/app/clinic-dashboard/hts/daily-schedule/daily-schedule.component.ts b/src/app/clinic-dashboard/hts/daily-schedule/daily-schedule.component.ts new file mode 100644 index 000000000..1ca7c0d23 --- /dev/null +++ b/src/app/clinic-dashboard/hts/daily-schedule/daily-schedule.component.ts @@ -0,0 +1,78 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Subscription } from 'rxjs'; +import { ClinicDashboardCacheService } from '../../services/clinic-dashboard-cache.service'; +import { Router, ActivatedRoute } from '@angular/router'; +import { DatePipe } from '@angular/common'; +import { DailyScheduleBaseComponent } from '../../../clinic-schedule-lib/daily-schedule/daily-schedule.component'; +import { ClinicFlowCacheService } from '../../../hiv-care-lib/clinic-flow/clinic-flow-cache.service'; +import { SelectDepartmentService } from './../../../shared/services/select-department.service'; +import * as Moment from 'moment'; +@Component({ + selector: 'hts-daily-schedule', + templateUrl: + '../../../clinic-schedule-lib/daily-schedule/daily-schedule.component.html' +}) +export class HTSDailyScheduleComponent + extends DailyScheduleBaseComponent + implements OnInit, OnDestroy { + public routeSub: Subscription = new Subscription(); + public myDepartment = 'HTS'; + public _datePipe: DatePipe; + public selectedDate: any; + public paramsSub: Subscription; + public activeLinkIndex = 0; + public tabLinks = [ + { label: 'Appointments', link: 'daily-appointments' }, + { label: 'Visits', link: 'daily-visits' }, + { label: 'Clinic Flow', link: 'clinic-flow' }, + { label: 'Has not returned', link: 'daily-not-returned' } + ]; + + constructor( + public clinicDashboardCacheService: ClinicDashboardCacheService, + public router: Router, + public route: ActivatedRoute, + public clinicFlowCache: ClinicFlowCacheService, + private selectDepartmentService: SelectDepartmentService + ) { + super(clinicDashboardCacheService, router, route, clinicFlowCache); + this._datePipe = new DatePipe('en-US'); + } + + public ngOnInit() { + this.setActiveTab(); + this.paramsSub = this.route.queryParams.subscribe((params) => { + if (params.startDate) { + this.selectedDate = Moment(params.startDate).format('MMM D , YYYY '); + this.clinicFlowCache.setSelectedDate(this.selectedDate); + } + }); + this.selectDepartmentService.setDepartment(this.myDepartment); + this.routeSub = this.route.parent.parent.params.subscribe((params) => { + this.clinicDashboardCacheService.setCurrentClinic( + params['location_uuid'] + ); + }); + if (this.clinicFlowCache.lastClinicFlowSelectedDate) { + this.selectedDate = this.clinicFlowCache.lastClinicFlowSelectedDate; + } else { + this.selectedDate = Moment().format('MMM D , YYYY '); + this.clinicFlowCache.setSelectedDate(this.selectedDate); + } + } + + public ngOnDestroy() { + this.routeSub.unsubscribe(); + this.paramsSub.unsubscribe(); + } + + public setActiveTab() { + if (this.router.url) { + let path = this.router.url; + const n = this.router.url.indexOf('?'); + path = this.router.url.substring(0, n !== -1 ? n : path.length); + path = path.substr(this.router.url.lastIndexOf('/') + 1); + this.activeLinkIndex = this.tabLinks.findIndex((x) => x.link === path); + } + } +} diff --git a/src/app/clinic-dashboard/hts/hts-program.module.ts b/src/app/clinic-dashboard/hts/hts-program.module.ts new file mode 100644 index 000000000..f7122063a --- /dev/null +++ b/src/app/clinic-dashboard/hts/hts-program.module.ts @@ -0,0 +1,44 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { + MatProgressSpinnerModule, + MatProgressBarModule, + MatTabsModule +} from '@angular/material'; +import { ClinicScheduleLibModule } from '../../clinic-schedule-lib/clinic-schedule-lib.module'; +import { CalendarModule } from 'angular-calendar'; +import { htsProgramRouting } from './hts-program.routes'; +import { DateTimePickerModule } from '@ampath-kenya/ngx-openmrs-formentry'; +import { EtlApi } from '../../etl-api/etl-api.module'; +import { HivCareLibModule } from '../../hiv-care-lib/hiv-care-lib.module'; +import { DataListsModule } from '../../shared/data-lists/data-lists.module'; +import { HTSDailyScheduleComponent } from './daily-schedule/daily-schedule.component'; +import { DailyScheduleClinicFlowComponent } from './clinic-flow/daily-schedule-clinic-flow.component'; +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'; + +@NgModule({ + imports: [ + htsProgramRouting, + HivCareLibModule, + ClinicScheduleLibModule, + DateTimePickerModule, + CalendarModule, + EtlApi, + DataListsModule, + CommonModule, + FormsModule, + MatTabsModule, + MatProgressSpinnerModule, + MatProgressBarModule, + ProgramVisitEncounterSearchModule, + GeneralModule, + ChangeDepartmentModule + ], + exports: [], + declarations: [HTSDailyScheduleComponent, 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 new file mode 100644 index 000000000..c22ab412c --- /dev/null +++ b/src/app/clinic-dashboard/hts/hts-program.routes.ts @@ -0,0 +1,52 @@ +import { ModuleWithProviders } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { HTSDailyScheduleComponent } from './daily-schedule/daily-schedule.component'; +import { DailyScheduleVisitsComponent } from '../../clinic-schedule-lib/daily-schedule/daily-schedule-visits.component'; +import { DailyScheduleAppointmentsComponent } from '../../clinic-schedule-lib/daily-schedule/daily-schedule-appointments.component'; +import { DailyScheduleNotReturnedComponent } from '../../clinic-schedule-lib/daily-schedule/daily-schedule-not-returned.component'; +import { DailyScheduleClinicFlowComponent } from './clinic-flow/daily-schedule-clinic-flow.component'; +import { ClinicFlowVisitsComponent } from '../../hiv-care-lib/clinic-flow/clinic-flow-visits.component'; +import { ClinicFlowLocationStatsComponent } from '../../hiv-care-lib/clinic-flow/clinic-flow-location-stats.component'; +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'; +const routes: Routes = [ + { + path: 'daily-schedule', + component: HTSDailyScheduleComponent, + children: [ + { path: '', redirectTo: 'daily-appointments', pathMatch: 'prefix' }, + { path: 'daily-visits', component: DailyScheduleVisitsComponent }, + { + path: 'daily-appointments', + component: DailyScheduleAppointmentsComponent + }, + { + path: 'daily-not-returned', + component: DailyScheduleNotReturnedComponent + }, + { + path: 'clinic-flow', + component: DailyScheduleClinicFlowComponent, + children: [ + { path: 'visits', component: ClinicFlowVisitsComponent }, + { path: 'summary', component: ClinicFlowSummaryComponent }, + { + path: 'provider-stats', + component: ClinicFlowProviderStatsComponent + }, + { path: 'location', component: ClinicFlowLocationStatsComponent }, + { path: '', redirectTo: 'summary', pathMatch: 'prefix' } + ] + } + ] + }, + { + path: 'department-select', + component: ChangeDepartmentComponent + } +]; + +export const htsProgramRouting: ModuleWithProviders = RouterModule.forChild( + routes +); diff --git a/src/app/patient-dashboard/patient-dashboard.routes.ts b/src/app/patient-dashboard/patient-dashboard.routes.ts index 0e0adb047..af691c588 100644 --- a/src/app/patient-dashboard/patient-dashboard.routes.ts +++ b/src/app/patient-dashboard/patient-dashboard.routes.ts @@ -68,6 +68,11 @@ export const routes = [ path: 'mnch/:program/landing-page', component: GeneralLandingPageComponent }, + { + // HTS Landing Page + path: 'hts/:program/landing-page', + component: GeneralLandingPageComponent + }, { path: 'cdm/:program/landing-page', // CDM Landing Page component: CdmSummaryComponent diff --git a/src/app/shared/dynamic-route/schema/clinic.dashboard.conf.json b/src/app/shared/dynamic-route/schema/clinic.dashboard.conf.json index 1757d4686..801ac1b1b 100644 --- a/src/app/shared/dynamic-route/schema/clinic.dashboard.conf.json +++ b/src/app/shared/dynamic-route/schema/clinic.dashboard.conf.json @@ -291,6 +291,19 @@ "isSideBarOpen": false } ] + }, + { + "departmentName": "HTS", + "baseRoute": "hts", + "alias": "hts", + "routes": [ + { + "url": "daily-schedule", + "label": "Daily Schedule", + "icon": "fa fa-calendar-o", + "isSideBarOpen": false + } + ] } ] } diff --git a/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json b/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json index f39dc253d..c83a90c8d 100644 --- a/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json +++ b/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json @@ -579,14 +579,35 @@ "routes": [] }, { - "programName": "Hiv Testing Services", + "programName": "HIV Testing Services", "programUuid": "a0f8382f-df8a-4f1d-8959-9fb6eef90353", "baseRoute": "a0f8382f-df8a-4f1d-8959-9fb6eef90353", "alias": "hts", "published": true, "requiresPatientEnrollment": true, "shared-routes-class": "hts", - "routes": [] + "routes": [ + { + "url": "visit", + "label": "Visit", + "icon": "icon-i-outpatient" + }, + { + "url": "patient-encounters", + "label": "Encounters", + "icon": "icon-i-immunizations" + }, + { + "url": "patient-vitals", + "label": "Vitals", + "icon": "fa fa-heartbeat" + }, + { + "url": "lab-data-summary", + "label": "Lab Data Summary", + "icon": "icon-i-laboratory" + } + ] }, { "programName": "Mental Health", @@ -793,6 +814,53 @@ "label": "Imaging", "icon": "icon-i-radiology" } + ], + "hts": [ + { + "url": "visit", + "label": "Visit", + "icon": "icon-i-outpatient" + }, + { + "url": "patient-encounters", + "label": "Encounters", + "icon": "icon-i-immunizations" + }, + { + "url": "patient-vitals", + "label": "Vitals", + "icon": "fa fa-heartbeat" + }, + { + "url": "hiv-summary", + "label": "HIV Summary", + "icon": "fa fa-medkit" + }, + { + "url": "patient-monthly-status-history", + "label": "Monthly Status History", + "icon": "fa fa-medkit" + }, + { + "url": "clinical-notes", + "label": "Clinical Notes", + "icon": "fa fa-book" + }, + { + "url": "lab-data-summary", + "label": "Lab Data Summary", + "icon": "icon-i-laboratory" + }, + { + "url": "lab-orders", + "label": "Lab Orders", + "icon": "icon-i-pathology" + }, + { + "url": "patient-imaging", + "label": "Imaging", + "icon": "icon-i-radiology" + } ] } } From 605674d12540dc901b133b77fc6d775295d1a8b0 Mon Sep 17 00:00:00 2001 From: sainingo Date: Fri, 25 Oct 2024 13:17:11 +0300 Subject: [PATCH 3/4] Upgrade deprecated upload-artifact to v3 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c6dc1a4a..3d288a621 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: - name: Build prod run: npm run build-prod - name: Upload build files to artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: build-files path: dist From c45faeca4875e123f5d026fc3dfca0c2f79a4b1c Mon Sep 17 00:00:00 2001 From: sainingo Date: Mon, 4 Nov 2024 10:09:09 +0300 Subject: [PATCH 4/4] Add data analytics to hts --- .../hts/hts-program.module.ts | 7 ++- .../hts/hts-program.routes.ts | 5 ++ .../monthly-schedule.component.ts | 61 +++++++++++++++++++ .../data-analytics-dashboard-routes.ts | 4 ++ .../data-analytics.component.ts | 4 ++ .../data-analytics.module.ts | 4 +- .../hts/data-analytics-hts.module.ts | 19 ++++++ .../hts/data-analytics-hts.routes.ts | 48 +++++++++++++++ .../group-detail/group-detail.component.ts | 2 + .../community-group-resource.service.ts | 4 +- .../schema/analytics.dashboard.conf.json | 31 ++++++++++ 11 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 src/app/clinic-dashboard/hts/monthly-schedule/monthly-schedule.component.ts create mode 100644 src/app/data-analytics-dashboard/hts/data-analytics-hts.module.ts create mode 100644 src/app/data-analytics-dashboard/hts/data-analytics-hts.routes.ts 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 + } + ] } ] }