Skip to content

Commit

Permalink
Merge pull request #23 from jianyiee96/sr4-post-demo
Browse files Browse the repository at this point in the history
Sr4 post demo
  • Loading branch information
weekeat-tan authored Nov 15, 2020
2 parents 0e438de + 2b9d148 commit 4bb8e88
Show file tree
Hide file tree
Showing 14 changed files with 371 additions and 199 deletions.
10 changes: 10 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
]
},
Expand Down
10 changes: 5 additions & 5 deletions src/app/classes/notificationtype-enum.ts
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion src/app/layout/app-topbar/app-topbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div class="p-grid">
<div *ngIf="notification.isRead" class="p-col-10">
<h5>{{notification.title}}</h5>
<span id="msg">{{notification.message}}</span>
<span id="msg" style="white-space: pre-line" class="ellipsis">{{notification.message}}</span>
<br/>
<p style="font-size:0.8rem; color: #65676b">{{notification.notificationDate | date:'dd/MM/yyyy HH:mm'}}</p>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/app/layout/app-topbar/app-topbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ <h4>Consultation type</h4>

<div class="p-field-radiobutton">
<h4>
<p-radioButton inputId="general" type="radio" name="food" [(ngModel)]="isForReview" [value]="false"></p-radioButton>
<label for="general" style="margin-right: 15px;"> General Consultation</label>
<p-radioButton inputId="review" type="radio" name="food" [(ngModel)]="isForReview" [value]="true"></p-radioButton>
<label for="review" style="margin-right: 15px;" > Medical Review</label>
<p-radioButton inputId="general" type="radio" name="food" [(ngModel)]="isForReview" [value]="false"></p-radioButton>
<label for="general" > General Consultation</label>
<label for="review" > Pre-Medical Board Review</label>

</h4>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
style="float:right;"></button>
</div>
</div>

<p-table #dt [value]="formInstances" selectionMode="single" [(selection)]="selectedFormInstance"
[paginator]="true" [rows]="10" [rowsPerPageOptions]="[10,25,50]"
dataKey="formInstanceId" (onRowSelect)="onRowSelect($event)" (onRowUnselect)="onRowUnselect($event)"
Expand Down
247 changes: 139 additions & 108 deletions src/app/screens/home-screen/home-screen.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,117 +3,148 @@

<head>

<title>Home Page</title>
<title>Home Page</title>
</head>

<body>
<div class="p-grid p-fluid">
<div class="p-col-12 p-lg-6" *ngIf="unsubmittedForms.length !== 0" >
<p-card class="cardBackgroundOverride">
<div class="p-grid">
<div class="p-col-12 p-md-8" style="font-size: 30px; font-weight: bold;">
<i class="pi pi-exclamation-triangle" style="font-size: 0.8em;"></i> {{unsubmittedForms.length}} unsubmitted forms
</div>
<div class="p-col-12 p-md-4">
<button pButton icon="pi pi-chevron-right"
label="View All Forms" routerLink="/general-eforms-screen"></button>
</div>
</div>

<h4 style=" color: red;">You are required to submit these forms before your consultation!</h4>
<p-accordion id="overrideAccordion">
<p-accordionTab id="overrideAccordion" header="Unsubmitted Forms" class="accordionOverride">
<p-table [value]="unsubmittedForms" [paginator]="true" [rows]="5">
<ng-template pTemplate="header">
<tr>
<th>Form Name</th>
<th>Consultation Purpose</th>
<th>Due Date</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-formInstance>
<tr>
<td><a
href="/general-eforms-screen/{{formInstance.formInstanceId}}">{{formInstance.formTemplateMapping.formTemplateName}}</a>
</td>
<td>{{formInstance.booking.consultationPurpose.consultationPurposeName}}</td>
<td>{{formInstance.booking.bookingSlot.startDateTime | date:'dd/MM/yyyy HH:mm'}}</td>
</tr>
</ng-template>

</p-table>
</p-accordionTab>
</p-accordion>

</p-card>
</div>
<div class="p-col-12 p-lg-6">
<p-card >
<p-header>
<img src="../../../assets/doctorcard.jpg" library="serenity-layout" />
</p-header>
<ng-container *ngIf="nextBooking !== undefined">
<div class="p-grid">
<div class="p-col-12 p-md-8" style="font-size: 30px; font-weight: bold;">
<h1>Upcoming Booking</h1>
</div>
<div class="p-col-12 p-md-4">
<button pButton icon="pi pi-chevron-right"
label="View Booking" routerLink="/booking-management-screen/{{nextBooking.bookingId}}"></button>
</div>
</div>

<div class="p-grid">
<div class="p-col-6">
<h4><i class="pi pi-check-square"></i> Consultation Purpose</h4>
<p>{{nextBooking.consultationPurpose.consultationPurposeName}}</p>
</div>
<div class="p-col-6">
<h4><i class="pi pi-map-marker"></i> Venue</h4>
<p>{{nextBooking.bookingSlot.medicalCentre.name}}</p>
</div>
<div class="p-col-6">
<h4><i class="pi pi-calendar"></i> Date</h4>
<p>{{nextBooking.bookingSlot.startDateTime | date:'dd/MM/yyyy HH:mm'}}</p>
</div>
</div>
</ng-container>
<ng-container *ngIf="nextBooking === undefined">
<div class="p-grid">
<div class="p-col-12 p-md-8" style="font-size: 30px; font-weight: bold;">
<h1>Upcoming Booking</h1>

</div>
<div class="p-col-12">
<p>You have no upcoming booking</p>
</div>

</div>
</ng-container>


<!-- <p-table [value]="upcomingBookings" [paginator]="true" [rows]="10" [rowsPerPageOptions]="[10,25,50]">
<ng-template pTemplate="header">
<tr>
<th>Consultation Purpose</th>
<th>Booking Slot</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-booking>
<tr>
<td><a
href="/booking-management-screen/{{booking.bookingId}}">{{booking.consultationPurpose.consultationPurposeName}}</a>
</td>
<td>{{booking.bookingSlot.startDateTime | date:'dd/MM/yyyy'}}
{{booking.bookingSlot.startDateTime | date:'HH:mm' }} -
{{booking.bookingSlot.endDateTime | date:'HH:mm' }}</td>
</tr>
</ng-template>
</p-table> -->

</p-card>
</div>
<div class="p-grid p-fluid">

<div class="p-col-12 p-lg-6">
<div>


<p-card>
<p-header>
<img src="../../../assets/medreview.jpg" library="serenity-layout" style="height: 280px;" />
</p-header>
<ng-container *ngIf="upcomingMedicalBoard !== undefined">
<div class="p-grid">
<div class="p-col-12 p-md-8" style="font-size: 30px; font-weight: bold;">
<h1>Upcoming Medical Review</h1>
</div>
<div class="p-col-12 p-md-4">
<button pButton icon="pi pi-chevron-right" label="View Medical Review"
routerLink="/medical-review-screen/{{upcomingMedicalBoard.medicalBoardCase.medicalBoardCaseId}}"></button>
</div>
</div>

<div class="p-grid">
<div class="p-col-6">
<h4><i class="pi pi-calendar" style="font-size: 1rem"></i> Date</h4>
<p>{{upcomingMedicalBoard.scheduledStartDate | date:'dd/MM/yyyy' }}</p>
</div>
<div class="p-col-6">
<h4><i class="pi pi-clock" style="font-size: 1rem"></i> Time</h4>
<p>{{upcomingMedicalBoard.scheduledStartDate | date:'HH:mm' }}</p>
</div>
<div class="p-col-6">
<h4><i class="pi pi-id-card" style="font-size: 1rem"></i> Assigned Chairman</h4>
<p>Dr. {{upcomingMedicalBoard.chairman}}</p>
</div>
</div>
</ng-container>
<ng-container *ngIf="upcomingMedicalBoard === undefined">
<div class="p-grid">
<div class="p-col-12 p-md-8" style="font-size: 30px; font-weight: bold;">
<h1>Upcoming Medical Review</h1>

</div>
<div class="p-col-12">
<p>You have no upcoming medical Review</p>
</div>

</div>
</ng-container>
</p-card>

</div>
<div style="margin-top: 10px">
<p-card class="cardBackgroundOverride">
<div class="p-grid" *ngIf="unsubmittedForms.length !== 0">
<div class="p-col-12 p-md-8" style="font-size: 30px; font-weight: bold;">
<i class="pi pi-exclamation-triangle" style="font-size: 0.8em;"></i> {{unsubmittedForms.length}}
unsubmitted forms
</div>
<div class="p-col-12 p-md-4">
<button pButton icon="pi pi-chevron-right" label="View All Forms"
routerLink="/general-eforms-screen"></button>
</div>
</div>

<h4 style=" color: red;">You are required to submit these forms before your consultation!</h4>
<p-accordion id="overrideAccordion">
<p-accordionTab id="overrideAccordion" header="Unsubmitted Forms" class="accordionOverride">
<p-table [value]="unsubmittedForms" [paginator]="true" [rows]="5">
<ng-template pTemplate="header">
<tr>
<th>Form Name</th>
<th>Consultation Purpose</th>
<th>Due Date</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-formInstance>
<tr>
<td><a
href="/general-eforms-screen/{{formInstance.formInstanceId}}">{{formInstance.formTemplateMapping.formTemplateName}}</a>
</td>
<td>{{formInstance.booking.consultationPurpose.consultationPurposeName}}</td>
<td>{{formInstance.booking.bookingSlot.startDateTime | date:'dd/MM/yyyy HH:mm'}}</td>
</tr>
</ng-template>

</p-table>
</p-accordionTab>
</p-accordion>

</p-card>
</div>
</div>
<div class="p-col-12 p-lg-6">
<p-card>
<p-header>
<img src="../../../assets/doctorcard.jpg" library="serenity-layout" style="height: 280px;" />
</p-header>
<ng-container *ngIf="nextBooking !== undefined">
<div class="p-grid">
<div class="p-col-12 p-md-8" style="font-size: 30px; font-weight: bold;">
<h1>Upcoming Booking</h1>
</div>
<div class="p-col-12 p-md-4">
<button pButton icon="pi pi-chevron-right" label="View Booking"
routerLink="/booking-management-screen/{{nextBooking.bookingId}}"></button>
</div>
</div>

<div class="p-grid">
<div class="p-col-6">
<h4><i class="pi pi-check-square"></i> Consultation Purpose</h4>
<p>{{nextBooking.consultationPurpose.consultationPurposeName}}</p>
</div>
<div class="p-col-6">
<h4><i class="pi pi-map-marker"></i> Venue</h4>
<p>{{nextBooking.bookingSlot.medicalCentre.name}}</p>
</div>
<div class="p-col-6">
<h4><i class="pi pi-calendar"></i> Date</h4>
<p>{{nextBooking.bookingSlot.startDateTime | date:'dd/MM/yyyy HH:mm'}}</p>
</div>
</div>
</ng-container>
<ng-container *ngIf="nextBooking === undefined">
<div class="p-grid">
<div class="p-col-12 p-md-8" style="font-size: 30px; font-weight: bold;">
<h1>Upcoming Booking</h1>

</div>
<div class="p-col-12">
<p>You have no upcoming booking</p>
</div>

</div>
</ng-container>
</p-card>
</div>
</div>
</body>

</html>
</html>
Loading

0 comments on commit 4bb8e88

Please sign in to comment.