Skip to content

Commit

Permalink
Merge pull request #21 from jianyiee96/medical-review
Browse files Browse the repository at this point in the history
Medical review
  • Loading branch information
jianyiee96 authored Nov 13, 2020
2 parents 33068b8 + 66c2748 commit 0e438de
Show file tree
Hide file tree
Showing 25 changed files with 684 additions and 25 deletions.
5 changes: 5 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ const routes: Routes = [
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]
}
]
},
{
Expand Down
18 changes: 18 additions & 0 deletions src/app/classes/booking-slot/booking-slot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Booking } from '../booking/booking';
import { MedicalBoardSlotStatusEnum } from '../medical-board-slot-status-enum.enum';
import { MedicalCentre } from '../medical-centre/medical-center';

export abstract class Slot {
Expand All @@ -15,4 +16,21 @@ export class BookingSlot extends Slot{
this.booking = booking
this.medicalCentre = medicalCentre
}
}

export class MedicalBoardSlot extends Slot {
medicalBoardSlotStatusEnum: MedicalBoardSlotStatusEnum
estimatedTimeForEachBoardInPresenceCase: number
estimatedTimeForEachBoardInAbsenceCase: number
medicalOfficerOneKey: string
medicalOfficerTwoKey: string
constructor(medicalBoardSlotStatusEnum?: MedicalBoardSlotStatusEnum, estimatedTimeForEachBoardInPresenceCase?: number,
estimatedTimeForEachBoardInAbsenceCase?: number, medicalOfficerOneKey?: string, medicalOfficerTwoKey?: string) {
super();
this.medicalBoardSlotStatusEnum = medicalBoardSlotStatusEnum
this.estimatedTimeForEachBoardInAbsenceCase = estimatedTimeForEachBoardInAbsenceCase
this.estimatedTimeForEachBoardInPresenceCase = estimatedTimeForEachBoardInPresenceCase
this.medicalOfficerOneKey = medicalOfficerOneKey
this.medicalOfficerTwoKey = medicalOfficerTwoKey
}
}
7 changes: 7 additions & 0 deletions src/app/classes/condition-status/condition-status.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ConditionStatus } from './condition-status';

describe('ConditionStatus', () => {
it('should create an instance', () => {
expect(new ConditionStatus()).toBeTruthy();
});
});
36 changes: 36 additions & 0 deletions src/app/classes/condition-status/condition-status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { MedicalBoardCase } from '../medical-board-case-wrapper/medical-board-case-wrapper'
import { Serviceman } from '../serviceman/serviceman'

export class ConditionStatusWrapper {

conditionStartDate: Date
conditionStatus: ConditionStatus
medicalBoardCaseId: number

constructor(conditionStartDate?: Date, conditionStatus?: ConditionStatus, medicalBoardCaseId?: number) {

this.conditionStartDate = conditionStartDate
this.conditionStatus = conditionStatus
this.medicalBoardCaseId = medicalBoardCaseId

}

}

export class ConditionStatus {

conditionStatusId: number
description: string
isActive: boolean
statusEndDate: Date

constructor(conditionStatusId?: number, description?: string, isActive?: boolean, statusEndDate?: Date) {

this.conditionStatusId = conditionStatusId
this.description = description
this.isActive = isActive
this.statusEndDate = statusEndDate

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { MedicalBoardCaseWrapper } from './medical-board-case-wrapper';

describe('MedicalBoardCaseWrapper', () => {
it('should create an instance', () => {
expect(new MedicalBoardCaseWrapper()).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { MedicalBoardSlot } from '../booking-slot/booking-slot'
import { ConditionStatus, ConditionStatusWrapper } from '../condition-status/condition-status'
import { Consultation } from '../consultation/consultation'
import { MedicalBoardCaseStatusEnum } from '../medicalboardcase-enum'
import { MedicalBoardTypeEnum } from '../medicalboardtype-enum'
import { PesStatusEnum } from '../pes-status-enum.enum'

export class MedicalBoardCaseWrapper {

chairman: String
conditionStatuses: ConditionStatusWrapper[]
medicalBoardCase: MedicalBoardCase
scheduledEndDate: Date
scheduledStartDate: Date

constructor(
chairman?: string,
conditionStatuses?: ConditionStatusWrapper[],
medicalBoardCase?: MedicalBoardCase,
scheduledEndDate?: Date,
scheduledStartDate?: Date
) {

this.chairman = chairman
this.conditionStatuses = conditionStatuses
this.medicalBoardCase = medicalBoardCase
this.scheduledEndDate = scheduledEndDate
this.scheduledStartDate = scheduledStartDate

}
}

export class MedicalBoardCase {

finalPesStatus: PesStatusEnum
isSigned: boolean
medicalBoardCaseId: number
medicalBoardCaseStatus: MedicalBoardCaseStatusEnum
medicalBoardType: MedicalBoardTypeEnum

constructor(
finalPesStatus?: PesStatusEnum,
isSigned?: boolean,
medicalBoardCaseId?: number,
medicalBoardCaseStatus?: MedicalBoardCaseStatusEnum,
medicalBoardType?: MedicalBoardTypeEnum
) {

this.finalPesStatus = finalPesStatus
this.isSigned = isSigned
this.medicalBoardCaseId = medicalBoardCaseId
this.medicalBoardCaseStatus = medicalBoardCaseStatus
this.medicalBoardType = medicalBoardType

}

}
13 changes: 13 additions & 0 deletions src/app/classes/medical-board-slot-status-enum.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export enum MedicalBoardSlotStatusEnum {
UNASSIGNED="Board Members Not Assigned",
// No cases have been allocated yet
ASSIGNED="Board Members Assigned",
// Cases have been allocated
ALLOCATED="Board Cases Allocated",
// Board is currently ongoing
ONGOING="Board Ongoing",
// Cases were allocated and board was already done
COMPLETED="Board Completed",
// No cases were allocated and the slot has already expired, expiration at the end of the day [to be done]
EXPIRED="Expired"
}
5 changes: 5 additions & 0 deletions src/app/classes/medicalboardcase-enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum MedicalBoardCaseStatusEnum {
WAITING, //No date, not assigned medical board entity
SCHEDULED, //Assigned medical board entity, upcoming
COMPLETED //Completed
}
4 changes: 4 additions & 0 deletions src/app/classes/medicalboardtype-enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum MedicalBoardTypeEnum {
ABSENCE,
PRESENCE
}
3 changes: 2 additions & 1 deletion src/app/classes/notificationtype-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export enum NotificationTypeEnum{
BOOKING = ('BOOKING'),
CONSULTATION = ("CONSULTATION"),
FORM = ("FORM"),
GENERAL = ("GENERAL")
GENERAL = ("GENERAL"),
MEDICAL_BOARD = ("MEDICAL BOARD")
}
13 changes: 13 additions & 0 deletions src/app/classes/pes-status-enum.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export enum PesStatusEnum {
A="Suitable for frontline operational vocations",
B1="Suitable for frontline operational vocations",
B2="Suitable for some frontline operational vocations, and frontline support vocations",
B3="Suitable for some frontline operational vocations, and frontline support vocations",
B4="Suitable for some frontline operational vocations, and frontline support vocations",
BP="Fit for Obese BRT",
C2="Suitable for some frontline support vocations",
C9="Suitable for some frontline support vocations",
E1="Suitable for administrative support vocations",
E9="Suitable for administrative support vocations",
F="Medically unfit for any form of service"
}
5 changes: 4 additions & 1 deletion src/app/classes/serviceman/serviceman.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BloodTypeEnum } from '../bloodtype-enum'
import { GenderEnum } from '../gender-enum'
import { PesStatusEnum } from '../pes-status-enum.enum'
import { ServicemanRoleEnum } from '../servicemanrole-enum'


Expand All @@ -16,10 +17,11 @@ export class Serviceman {
address: Address
isActivated: boolean
role : ServicemanRoleEnum
pesStatus: PesStatusEnum
token : string

constructor(servicemanId?: number, name?: string, email?: string , phoneNumber?: string, rod?: Date,
gender?: GenderEnum, bloodType?: BloodTypeEnum, password?: string, address?: Address, isActivated?: boolean, role?: ServicemanRoleEnum,
gender?: GenderEnum, bloodType?: BloodTypeEnum, password?: string, address?: Address, isActivated?: boolean, role?: ServicemanRoleEnum, pesStatus?: PesStatusEnum,
token?: string) {

this.servicemanId = servicemanId
Expand All @@ -33,6 +35,7 @@ export class Serviceman {
this.address = address
this.isActivated = isActivated
this.role = role
this.pesStatus = pesStatus
this.token = token
}

Expand Down
10 changes: 2 additions & 8 deletions src/app/layout/app-menu/app-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ export class AppMenuComponent implements OnInit {
{label: 'Home Page', icon: 'pi pi-fw pi-home', routerLink: ['/home-screen']},
{label: 'Account Information', icon: 'pi pi-fw pi-id-card', routerLink: ['/account-screen']},
{label: 'Booking Management', icon: 'pi pi-fw pi-calendar', routerLink: ['/booking-management-screen']},
{label: 'General eForms', icon: 'pi pi-fw pi-file', routerLink: ['/general-eforms-screen']},
{label: 'Consultation', icon: 'pi pi-fw pi-list', routerLink: ['/consultation-screen']},
{
label: 'eForm Management', icon: 'pi pi-fw pi-folder', routerLink: ['/information'],
items: [

{label: 'General eForms', icon: 'pi pi-fw pi-file', routerLink: ['/general-eforms-screen']},
{label: 'Medical Board eForms', icon: 'pi pi-fw pi-file', routerLink: ['/medical-screen']}
]
},
{label: 'Medical Review', icon: 'pi pi-fw pi-search-plus', routerLink: ['/medical-review-screen']},

];
}
Expand Down
18 changes: 4 additions & 14 deletions src/app/layout/app-topbar/app-topbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
<ul class="topbar-menu fadeInDown" [ngClass]="{'topbar-menu-active': app.topbarMenuActive}" (click)="app.onTopbarMenuClick($event)">
<li #profile class="profile-item" [ngClass]="{'active-topmenuitem': app.activeTopbarItem === profile}" (click)="app.onTopbarRootItemClick($event, profile)">
<a href="#">
<span class="profile-image-wrapper">
<img src="assets/layout/images/avatar1.png"/>
</span>
<span class="topbar-item-name profile-name">{{serviceman.name}}</span>
<span class="topbar-item-name profile-name" style="margin: 12px; font-size: 20px;">{{serviceman.name}}</span>
</a>
<ul class="fadeInDown">
<li role="menuitem">
Expand Down Expand Up @@ -82,13 +79,13 @@
</ng-container>
<ng-container *ngFor="let notification of this.allNotifications">
<li role="menuitem" (mouseover)="notiHover=true" (mouseout)="notiHover=false">
<a (click)="redirecting(notification)" style="width:500px;" [ngClass]="{ 'unread' : !notification.isRead}" pTooltip="{{notification.message}}" tooltipPosition="bottom"
[tooltipDisabled]="numLines(notification.message) <= 3">
<a (click)="redirecting(notification)" style="width:500px;" [ngClass]="{ 'unread' : !notification.isRead}" pTooltip="{{notification.message}}"
[tooltipDisabled]="false">

<div class="p-grid">
<div *ngIf="notification.isRead" class="p-col-10">
<h5>{{notification.title}}</h5>
<span>{{notification.message}}</span>
<span id="msg">{{notification.message}}</span>
<br/>
<p style="font-size:0.8rem; color: #65676b">{{notification.notificationDate | date:'dd/MM/yyyy HH:mm'}}</p>
</div>
Expand Down Expand Up @@ -123,11 +120,4 @@ <h5 style="font-weight: bold;">{{notification.title}}</h5>
</ul>
</div>
</div>
<p-dialog header="{{displayNotfication.title}}" [(visible)]="display">
<h4>
{{displayNotfication.message}}
</h4>

</p-dialog>


11 changes: 11 additions & 0 deletions src/app/layout/app-topbar/app-topbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export class AppTopbarComponent implements OnInit {

}

toDisable() {
return document.getElementById('msg').innerHTML.includes('...')
}

deleteNotification(notification) {
this.notificationService.deleteNotification(notification.notificationId).subscribe(
response => {
Expand Down Expand Up @@ -144,6 +148,13 @@ export class AppTopbarComponent implements OnInit {
url = url + "/" + notification.dynamicId
}
}
if (notification.notificationTypeEnum === NotificationTypeEnum.MEDICAL_BOARD) {
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 @@ -19,7 +19,7 @@ export class ConsultationScreenComponent implements OnInit {

constructor(private breadcrumbService: BreadcrumbService, private consultationService: ConsultationService) {
this.breadcrumbService.setItems([
{ label: 'Manage Booking' }
{ label: 'Manage Consultation' }
])
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MedicalReviewScreenComponent } from './medical-review-screen.component';

const routes: Routes = [
{
path: '',
component: MedicalReviewScreenComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class MedicalReviewScreenRoutingModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.form-status-badge {
border-radius: 2px;
padding: .25em .5rem;
text-transform: uppercase;
font-weight: 700;
letter-spacing: .3px;
}

.status-badge {
font-size: 15px;
margin: 3px;
background: #406E7E;
color: #FFFFFF;
}

.marginCard {
margin: 2px;
}

.status-badge-active {
font-size: 14px;
padding: 2px;
margin: 3px;
background: #4db806;
color: #FFFFFF;
}

.status-badge-expired {
font-size: 14px;
padding: 2px;
margin: 3px;
background: #ff4d4d;
color: #FFFFFF;
}
Loading

0 comments on commit 0e438de

Please sign in to comment.