diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 9b4dc89..7d414b6 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -59,10 +59,20 @@ const routes: Routes = [ loadChildren: () => import('./screens/consultation-screen/consultation-screen.module').then(m => m.ConsultationScreenComponentModule), canActivate: [AuthGuard] }, + { + path: 'consultation-screen/:consultationId', + loadChildren: () => import('./screens/consultation-screen/consultation-screen.module').then(m => m.ConsultationScreenComponentModule), + canActivate: [AuthGuard] + }, { path: 'medical-review-screen', loadChildren: () => import('./screens/medical-review-screen/medical-review-screen.module').then(m => m.MedicalReviewScreenModule), canActivate: [AuthGuard] + }, + { + path: 'medical-review-screen/:mbId', + loadChildren: () => import('./screens/medical-review-screen/medical-review-screen.module').then(m => m.MedicalReviewScreenModule), + canActivate: [AuthGuard] } ] }, diff --git a/src/app/classes/notificationtype-enum.ts b/src/app/classes/notificationtype-enum.ts index 270207c..d128e67 100644 --- a/src/app/classes/notificationtype-enum.ts +++ b/src/app/classes/notificationtype-enum.ts @@ -1,7 +1,7 @@ export enum NotificationTypeEnum{ - BOOKING = ('BOOKING'), - CONSULTATION = ("CONSULTATION"), - FORM = ("FORM"), - GENERAL = ("GENERAL"), - MEDICAL_BOARD = ("MEDICAL BOARD") + GENERAL = "GENERAL", + BOOKING = "BOOKING", + CONSULTATION = "CONSULTATION", + FORM = "FORM", + MEDICAL_BOARD = "MEDICAL_BOARD" } \ No newline at end of file diff --git a/src/app/layout/app-topbar/app-topbar.component.html b/src/app/layout/app-topbar/app-topbar.component.html index e6c213e..e90d27e 100644 --- a/src/app/layout/app-topbar/app-topbar.component.html +++ b/src/app/layout/app-topbar/app-topbar.component.html @@ -85,7 +85,7 @@
{{notification.title}}
- {{notification.message}} + {{notification.message}}

{{notification.notificationDate | date:'dd/MM/yyyy HH:mm'}}

diff --git a/src/app/layout/app-topbar/app-topbar.component.ts b/src/app/layout/app-topbar/app-topbar.component.ts index 856a986..369b06f 100644 --- a/src/app/layout/app-topbar/app-topbar.component.ts +++ b/src/app/layout/app-topbar/app-topbar.component.ts @@ -108,13 +108,13 @@ export class AppTopbarComponent implements OnInit { } toDisable() { + return document.getElementById('msg').innerHTML.includes('...') } deleteNotification(notification) { this.notificationService.deleteNotification(notification.notificationId).subscribe( response => { - this.messageService.add({ severity: 'success', summary: 'Service Message', detail: 'Notification Deleted' }); }, error => { console.error(error) } @@ -149,10 +149,11 @@ export class AppTopbarComponent implements OnInit { } } if (notification.notificationTypeEnum === NotificationTypeEnum.MEDICAL_BOARD) { - url = url + "/medical-review-screen" + url = url + "/medical-review-screen" if (notification.dynamicId !== undefined) { url = url + "/" + notification.dynamicId } + } this.router.navigate([url]) diff --git a/src/app/screens/booking-management-screen/booking-management-screen.component.html b/src/app/screens/booking-management-screen/booking-management-screen.component.html index dbaf7cf..58e8bef 100644 --- a/src/app/screens/booking-management-screen/booking-management-screen.component.html +++ b/src/app/screens/booking-management-screen/booking-management-screen.component.html @@ -147,10 +147,11 @@

Consultation type

+ + - - - + +

diff --git a/src/app/screens/consultation-screen/consultation-screen.component.ts b/src/app/screens/consultation-screen/consultation-screen.component.ts index 82cd539..e873fd8 100644 --- a/src/app/screens/consultation-screen/consultation-screen.component.ts +++ b/src/app/screens/consultation-screen/consultation-screen.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; import { ConfirmationService, Message, MessageService } from 'primeng/api'; import { Consultation } from 'src/app/classes/consultation/consultation'; import { BreadcrumbService } from 'src/app/services/breadcrum.service'; @@ -14,20 +15,36 @@ import { ConsultationService } from 'src/app/services/consultation/consultation. export class ConsultationScreenComponent implements OnInit { myConsultations: Consultation[] = [] selectedConsultation: Consultation + passedConsultationId: number isSelected: boolean queueNumber: number - constructor(private breadcrumbService: BreadcrumbService, private consultationService: ConsultationService) { + constructor(private breadcrumbService: BreadcrumbService, private activatedRoute: ActivatedRoute, private consultationService: ConsultationService) { this.breadcrumbService.setItems([ { label: 'Manage Consultation' } ]) } ngOnInit() { + let tempString = this.activatedRoute.snapshot.paramMap.get('consultationId') this.consultationService.retrieveServicemanConsultations().subscribe( response => { (async () => { this.myConsultations = response.consultations + if (tempString !== '') { + this.passedConsultationId = parseInt(tempString) + for (var index = 0; index < this.myConsultations.length; index++) { + if (this.myConsultations[index].consultationId === this.passedConsultationId) { + this.selectedConsultation = this.myConsultations[index]; + let a = '' + this.onRowSelect(a) + break; + } + } + } + else { + this.isSelected = false + } })(); }, error => { console.error(error) diff --git a/src/app/screens/general-eforms-screen/general-eforms-screen.component.html b/src/app/screens/general-eforms-screen/general-eforms-screen.component.html index ea1fc1a..5c13bce 100644 --- a/src/app/screens/general-eforms-screen/general-eforms-screen.component.html +++ b/src/app/screens/general-eforms-screen/general-eforms-screen.component.html @@ -27,7 +27,6 @@ style="float:right;">
- - Home Page + Home Page -
-
- -
-
- {{unsubmittedForms.length}} unsubmitted forms -
-
- -
-
- -

You are required to submit these forms before your consultation!

- - - - - - Form Name - Consultation Purpose - Due Date - - - - - {{formInstance.formTemplateMapping.formTemplateName}} - - {{formInstance.booking.consultationPurpose.consultationPurposeName}} - {{formInstance.booking.bookingSlot.startDateTime | date:'dd/MM/yyyy HH:mm'}} - - - - - - - -
-
-
- - - - - -
-
-

Upcoming Booking

-
-
- -
-
- -
-
-

Consultation Purpose

-

{{nextBooking.consultationPurpose.consultationPurposeName}}

-
-
-

Venue

-

{{nextBooking.bookingSlot.medicalCentre.name}}

-
-
-

Date

-

{{nextBooking.bookingSlot.startDateTime | date:'dd/MM/yyyy HH:mm'}}

-
-
-
- -
-
-

Upcoming Booking

- -
-
-

You have no upcoming booking

-
- -
-
- - - - -
-
+
+ +
+
+ + + + + + + +
+
+

Upcoming Medical Review

+
+
+ +
+
+ +
+
+

Date

+

{{upcomingMedicalBoard.scheduledStartDate | date:'dd/MM/yyyy' }}

+
+
+

Time

+

{{upcomingMedicalBoard.scheduledStartDate | date:'HH:mm' }}

+
+
+

Assigned Chairman

+

Dr. {{upcomingMedicalBoard.chairman}}

+
+
+
+ +
+
+

Upcoming Medical Review

+ +
+
+

You have no upcoming medical Review

+
+ +
+
+
+ +
+
+ +
+
+ {{unsubmittedForms.length}} + unsubmitted forms +
+
+ +
+
+ +

You are required to submit these forms before your consultation!

+ + + + + + Form Name + Consultation Purpose + Due Date + + + + + {{formInstance.formTemplateMapping.formTemplateName}} + + {{formInstance.booking.consultationPurpose.consultationPurposeName}} + {{formInstance.booking.bookingSlot.startDateTime | date:'dd/MM/yyyy HH:mm'}} + + + + + + + +
+
+
+
+ + + + + +
+
+

Upcoming Booking

+
+
+ +
+
+ +
+
+

Consultation Purpose

+

{{nextBooking.consultationPurpose.consultationPurposeName}}

+
+
+

Venue

+

{{nextBooking.bookingSlot.medicalCentre.name}}

+
+
+

Date

+

{{nextBooking.bookingSlot.startDateTime | date:'dd/MM/yyyy HH:mm'}}

+
+
+
+ +
+
+

Upcoming Booking

+ +
+
+

You have no upcoming booking

+
+ +
+
+
+
- \ No newline at end of file + diff --git a/src/app/screens/home-screen/home-screen.component.ts b/src/app/screens/home-screen/home-screen.component.ts index 3470b55..438d056 100644 --- a/src/app/screens/home-screen/home-screen.component.ts +++ b/src/app/screens/home-screen/home-screen.component.ts @@ -6,6 +6,8 @@ import { faCoffee } from '@fortawesome/free-solid-svg-icons'; import { BreadcrumbService } from '../../services/breadcrum.service'; +import { MedicalBoardCaseWrapper } from 'src/app/classes/medical-board-case-wrapper/medical-board-case-wrapper'; +import { MedicalReviewService } from 'src/app/services/medical-review/medical-review.service'; @Component({ selector: 'app-home-screen', @@ -20,8 +22,9 @@ export class HomeScreenComponent implements OnInit { nextBooking: Booking sortField: string; mostRecentBookingDate: Date + upcomingMedicalBoard: MedicalBoardCaseWrapper - constructor(private breadcrumbService: BreadcrumbService, private schedulerService: SchedulerService) { + constructor(private breadcrumbService: BreadcrumbService, private schedulerService: SchedulerService, private medicalBoardService: MedicalReviewService) { this.breadcrumbService.setItems([ { label: '' } ]); @@ -63,6 +66,25 @@ export class HomeScreenComponent implements OnInit { } ) + this.medicalBoardService.retrieveAllServicemanMedicalBoardCases().subscribe( + response => { + var medicalBoardCaseWrappers: MedicalBoardCaseWrapper[] = response.medicalBoardCases + + for (var idx = 0; idx < medicalBoardCaseWrappers.length; idx++) { + if (medicalBoardCaseWrappers[idx].medicalBoardCase.medicalBoardCaseStatus.toString() === "SCHEDULED") { + this.upcomingMedicalBoard = medicalBoardCaseWrappers[idx] + this.upcomingMedicalBoard.scheduledStartDate = this.convertUTCStringToSingaporeDate(this.upcomingMedicalBoard.scheduledStartDate) + this.upcomingMedicalBoard.scheduledEndDate = this.convertUTCStringToSingaporeDate(this.upcomingMedicalBoard.scheduledEndDate) + console.log(this.upcomingMedicalBoard); + break + } + } + }, + error => { + console.log(error); + } + ) + } diff --git a/src/app/screens/medical-review-screen/medical-review-screen.component.css b/src/app/screens/medical-review-screen/medical-review-screen.component.css index 9bd0b77..66496b0 100644 --- a/src/app/screens/medical-review-screen/medical-review-screen.component.css +++ b/src/app/screens/medical-review-screen/medical-review-screen.component.css @@ -6,6 +6,11 @@ letter-spacing: .3px; } +.type-status { + float: right; + margin-right: 5px; +} + .status-badge { font-size: 15px; margin: 3px; @@ -31,4 +36,29 @@ margin: 3px; background: #ff4d4d; color: #FFFFFF; -} \ No newline at end of file +} + +.pes-badge { + border-radius: 5px; + padding: 2px 6px; + margin: 3px; + background: #607D8B; + color: #FFFFFF; +} + +.absense-badge { + border-radius: 5px; + padding: 2px 6px; + margin: 3px; + background: #607D8B; + color: #FFFFFF; +} + + +.presence-badge { + border-radius: 5px; + padding: 2px 6px; + margin: 3px; + background: #607D8B; + color: #FFFFFF; +} diff --git a/src/app/screens/medical-review-screen/medical-review-screen.component.html b/src/app/screens/medical-review-screen/medical-review-screen.component.html index 46b4373..2e38cf6 100644 --- a/src/app/screens/medical-review-screen/medical-review-screen.component.html +++ b/src/app/screens/medical-review-screen/medical-review-screen.component.html @@ -7,53 +7,11 @@
-
- -

My statuses

- - - -
You have no past/present status
-
-
-
- - - - Status Name - - - Status Date - - - Status Validity - - - - - - - {{condition.conditionStatus.description}} - {{condition.conditionStartDate | date:'dd/MM/yyyy'}} - - {{condition.conditionStatus.statusEndDate | date:'dd/MM/yyyy'}} - Active - Expired - - - - - -
-

My Medical Reviews

- - + + @@ -65,22 +23,41 @@

My Medical Reviews

-

Medical Case Id: {{indivCase.medicalBoardCase.medicalBoardCaseId}}

-
-
-

Assigned Chairman

-

{{indivCase.chairman}}

-
-
-

Date

-

{{indivCase.scheduledStartDate | date:'dd/MM/yyyy' }}

-
-
-

Time

-

{{indivCase.scheduledStartDate | date:'HH:mm' }} - - {{indivCase.scheduledEndDate | date:'HH:mm' }}

+

Medical Case ID: {{indivCase.medicalBoardCase.medicalBoardCaseId}} + + +

+ + +
+
+

Assigned Chairman

+

Dr. {{indivCase.chairman}}

+
+
+

Date

+

{{indivCase.scheduledStartDate | date:'dd/MM/yyyy' }}

+
+
+

Time

+

{{indivCase.scheduledStartDate | date:'HH:mm' }}

+
-
+ + + + + +
Please wait for your medical review is allocated
+
+
+ +
@@ -119,21 +96,40 @@

{{indivCase.chairman}}

+ -

Medical Case ID: {{indivCase.medicalBoardCase.medicalBoardCaseId}}

+

Medical Case ID: {{indivCase.medicalBoardCase.medicalBoardCaseId}} + + + + + + +

+
-
-

Assigned Chairman

-

{{indivCase.chairman}}

-

Date

{{indivCase.scheduledStartDate | date:'dd/MM/yyyy' }}

Time

-

{{indivCase.scheduledStartDate | date:'HH:mm' }} - - {{indivCase.scheduledEndDate | date:'HH:mm' }}

+

{{indivCase.scheduledStartDate | date:'HH:mm' }}

+
+
+

Assigned Chairman

+

Dr. {{indivCase.chairman}}

Pes Status

@@ -161,9 +157,10 @@

{{indivCase.medicalBoardCase.finalPesStatus}}

{{conditionStatusWrapper.conditionStatus.description}} - {{conditionStatusWrapper.conditionStartDate | date:'dd/MM/yyyy'}} - + + {{conditionStatusWrapper.conditionStartDate | date:'dd/MM/yyyy'}} - {{conditionStatusWrapper.conditionStatus.statusEndDate | date:'dd/MM/yyyy'}} - + PERMANENT @@ -175,9 +172,56 @@

{{indivCase.medicalBoardCase.finalPesStatus}}

-
+
+ +

Current Pes Status: {{currentServiceman?.pesStatus}}

+

My Statuses

+ + + +
You have no past/present status
+
+
+
+ + + + Status Name + + + Status Date + + + Status Validity + + + + + + + {{condition.conditionStatus.description}} + + {{condition.conditionStartDate | date:'dd/MM/yyyy'}} - + {{condition.conditionStatus.statusEndDate | date:'dd/MM/yyyy'}} + + PERMANENT + Active + Expired + + + + +
+
diff --git a/src/app/screens/medical-review-screen/medical-review-screen.component.ts b/src/app/screens/medical-review-screen/medical-review-screen.component.ts index 3e1372e..b8c0290 100644 --- a/src/app/screens/medical-review-screen/medical-review-screen.component.ts +++ b/src/app/screens/medical-review-screen/medical-review-screen.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; import { MessageService } from 'primeng/api'; +import { connectableObservableDescriptor } from 'rxjs/internal/observable/ConnectableObservable'; import { ConditionStatusWrapper } from 'src/app/classes/condition-status/condition-status'; import { MedicalBoardCaseWrapper } from 'src/app/classes/medical-board-case-wrapper/medical-board-case-wrapper'; import { MedicalBoardCaseStatusEnum } from 'src/app/classes/medicalboardcase-enum'; @@ -24,11 +26,12 @@ export class MedicalReviewScreenComponent implements OnInit { allConditionStatusWrappers: ConditionStatusWrapper[] = [] activeConditionStatusWrappers: ConditionStatusWrapper[] expiredConditionStatusWrappers: ConditionStatusWrapper[] - waitingMedicalBoardCaseWrappers: MedicalBoardCaseWrapper[] = [] currentServiceman: Serviceman - + displayCompleted: boolean + index: number + trueboolean: boolean - constructor(private breadcrumbService: BreadcrumbService, private medicalReviewService: MedicalReviewService, private servicemanService: ServicemanService, + constructor(private breadcrumbService: BreadcrumbService, private activatedRoute: ActivatedRoute, private medicalReviewService: MedicalReviewService, private servicemanService: ServicemanService, private sessionService: SessionService) { this.breadcrumbService.setItems([ { label: 'Medical Review' } @@ -36,6 +39,7 @@ export class MedicalReviewScreenComponent implements OnInit { } ngOnInit(): void { + let tempString = this.activatedRoute.snapshot.paramMap.get('mbId') this.servicemanService.retrieveServicemanDetails().subscribe( response => { this.currentServiceman = response.serviceman @@ -49,9 +53,17 @@ export class MedicalReviewScreenComponent implements OnInit { response => { this.medicalBoardCaseWrappers = response.medicalBoardCases this.medicalBoardCaseWrappers.forEach(mbCase => { + console.log(parseInt(tempString)) + if (parseInt(tempString) === mbCase.medicalBoardCase.medicalBoardCaseId) { + if (mbCase.medicalBoardCase.medicalBoardCaseStatus.toString().toUpperCase() == 'COMPLETED') { + console.log("here") + this.displayCompleted = true + console.log(this.displayCompleted) + } + } mbCase.scheduledStartDate = this.convertUTCStringToSingaporeDate(mbCase.scheduledStartDate) mbCase.scheduledEndDate = this.convertUTCStringToSingaporeDate(mbCase.scheduledEndDate) - if (mbCase.medicalBoardCase.medicalBoardCaseStatus.toString().toUpperCase() == 'SCHEDULED') { + if (mbCase.medicalBoardCase.medicalBoardCaseStatus.toString().toUpperCase() == 'SCHEDULED' || mbCase.medicalBoardCase.medicalBoardCaseStatus.toString().toUpperCase() == 'WAITING') { this.upcomingMedicalBoardCaseWrappers.push(mbCase) } else if (mbCase.medicalBoardCase.medicalBoardCaseStatus.toString().toUpperCase() == 'COMPLETED'){ mbCase.conditionStatuses.forEach(conStatWrapper => { @@ -59,11 +71,16 @@ export class MedicalReviewScreenComponent implements OnInit { conStatWrapper.conditionStartDate = this.convertUTCStringToSingaporeDate(conStatWrapper.conditionStartDate) }); this.completedMedicalBoardCaseWrappers.push(mbCase) - } else { - this.waitingMedicalBoardCaseWrappers.push(mbCase) - } + } }); + if (this.displayCompleted) { + this.index = 1 + } else { + this.index = 0 + } + console.log("final") + console.log(this.displayCompleted) this.upcomingMedicalBoardCaseWrappers.sort((x, y) => (y.scheduledStartDate.getTime() - x.scheduledStartDate.getTime())) this.completedMedicalBoardCaseWrappers.sort((x, y) => (y.scheduledStartDate.getTime() - x.scheduledStartDate.getTime())) this.upcomingMedicalBoardCaseWrappers = this.upcomingMedicalBoardCaseWrappers.slice(0,5) diff --git a/src/assets/layout/images/login/login-bg.jpg b/src/assets/layout/images/login/login-bg.jpg index aa5ba83..365e870 100644 Binary files a/src/assets/layout/images/login/login-bg.jpg and b/src/assets/layout/images/login/login-bg.jpg differ diff --git a/src/assets/medreview.jpg b/src/assets/medreview.jpg new file mode 100644 index 0000000..56d031d Binary files /dev/null and b/src/assets/medreview.jpg differ