Bug 811

Summary: Appointment duration can be set to negative number
Product: 2023 CS3343 Group 20 System Reporter: mhlee64-c
Component: AppointmentAssignee: hfwong56-c
Status: RESOLVED FIXED    
Severity: critical    
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Windows   
Attachments: Test case for negative duration appointment

Description mhlee64-c 2023-12-06 22:42:57 HKT
Created attachment 160 [details]
Test case for negative duration appointment

An appointment is the section where the patient is going to meet the doctor, for such section, it is impossible to have a duration with negative number of minutes. However, when creating an appointment in the system, an appointment duration with negative number of minutes can be created.
--------------------------------------------------------------------------------
Welcome to CMS!
============================================== Login ===============================================
Please enter your staff ID: n
Please enter your password: n
============================================ Main Menu =============================================
Login as [Nurse] dummy Nurse | n | 
0.	Patient Mangement
1.	Appointment Management
2.	MedRecord Management
3.	Medicine Management
4.	Admin
5.	Logoff
Please select a function: 1
====================================== Appointment Mangement =======================================
0.	View Appointment History
1.	View Pending Appointment
2.	Create Appointment
3.	Update Appointment Status
4.	Earliest next Appointment
Please select a function: 2
========================================== Select Patient ==========================================
Please input patient's HKID: a123456
[Patient] Dummy patient | M | a123456 | 2020-06-29 | 
======================================== Create appointment ========================================
Please enter the date (DD/MM/YYYY): 01/01/2023
Please enter the time (HH:MM:SS): 10:10:10
Please enter the duration in minutes: -1
0.	[Doctor] Dr. dummer dr one | d | 
1.	[Doctor] Dr. dummer dr two | dd | 
Please select a doctor: 0
Do you confirm an appointment for Dummy patient with dummer dr one at 2023-01-01T10:10:10 for -1 minutes (Y/y: confirm)? Y
Appointment Created. 
============================================ Main Menu =============================================
Login as [Nurse] dummy Nurse | n | 
0.	Patient Mangement
1.	Appointment Management
2.	MedRecord Management
3.	Medicine Management
4.	Admin
5.	Logoff
Please select a function: 1
====================================== Appointment Mangement =======================================
0.	View Appointment History
1.	View Pending Appointment
2.	Create Appointment
3.	Update Appointment Status
4.	Earliest next Appointment
Please select a function: 0
===================================== View Appointment History =====================================
[Appointment] SCHEDULED | 2023-01-01T10:10:10 | -1mins | [Patient] Dummy patient | M | a123456 | 2020-06-29 |  -> [Doctor] Dr. dummer dr one | d |