Bug 816

Summary: Infinite loop when input an invalid dob once in create patient
Product: 2023 CS3343 Group 20 System Reporter: mhlee64-c
Component: PatientAssignee: mhlee64-c
Status: RESOLVED FIXED    
Severity: major CC: hfwong56-c
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Windows   
Attachments: Test case for infinite loop when user input invalid DOB

Description mhlee64-c 2023-12-07 23:09:07 HKT
Created attachment 164 [details]
Test case for infinite loop when user input invalid DOB

When creating new patient, if the user input an invalid date of birth, the system should ask the user to input again until a valid date of birth is entered, but when the user input an invalid date for the first time, the system keep asking the user to input a valid date even when the user indeed entered a valid date of birth.
--------------------------------------------------------------------------------
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: 0
======================================== Patient Mangement =========================================
0.	View Patient
1.	Create Patient
2.	Edit Patient
Please select a function: 1
========================================== Create Patient ==========================================
Please enter the patient's details below
Name: Patient1
HKID: Y1234567
Date of Birth (YYYY-MM-DD): 1
java.time.format.DateTimeParseException: Text '1' could not be parsed at index 0
Date of Birth (YYYY-MM-DD): 1999-01-01
Date of Birth (YYYY-MM-DD): 1999-10-10
Date of Birth (YYYY-MM-DD):