forked from nus-cs2103-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from choowengyan/fix/duplicate-prefix
v1.3 Fix EditCommand to disallow duplicated prefixes for Name, PreferredName and PID
- Loading branch information
Showing
9 changed files
with
211 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@startuml | ||
|
||
start | ||
:User wants to add a patient; | ||
:User runs the "add" command with id/PATIENT_HOSPITAL_ID n/NAME p/PREFERRED_NAME f/FOOD_PREFERENCE c/FAMILY_CONDITION h/HOBBY; | ||
if () then ([Required prefixes present]) | ||
if () then ([Valid command format]) | ||
:PatientSync checks if the input format for the respective prefix is valid; | ||
if () then ([Valid input format]) | ||
:PatientSync creates Patient object; | ||
if () then ([Valid Patient Hospital ID]) | ||
:PatientSync adds patient to model; | ||
:PatientSync generates success message; | ||
:PatientSync returns success message to output; | ||
else ([else]) | ||
:PatientSync throws command exception; | ||
:PatientSync generates error message; | ||
:PatientSync returns error message; | ||
endif | ||
else ([else]) | ||
:PatientSync throws parse exception; | ||
:PatientSync generates error message; | ||
:PatientSync returns error message; | ||
endif | ||
else ([else]) | ||
:PatientSync throws parse exception; | ||
:PatientSync generates error message; | ||
:PatientSync returns error message; | ||
endif | ||
else ([else]) | ||
:PatientSync throws parse exception; | ||
:PatientSync generates error message; | ||
:PatientSync returns error message; | ||
endif | ||
:PatientSync displays output message on GUI; | ||
stop | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@startuml | ||
start | ||
:User wants to edit information (eg. hobby) of a patient; | ||
:User runs the "edit" command with patient index, details of fields (eg. hobby with command h/Reading h/Singing); | ||
if () then ([else]) | ||
:PatientSync throws an error; | ||
:PatientSync adds error message to output; | ||
else ([Valid command format]) | ||
:PatientSync checks if the patient index is valid; | ||
if () then ([else]) | ||
:PatientSync throws an error; | ||
:PatientSync adds error message to output; | ||
else ([Valid patient index]) | ||
:PatientSync checks if the prefix(s) is valid; | ||
if () then ([else]) | ||
:PatientSync throws an error; | ||
:PatientSync adds error message to output; | ||
else ([Valid prefix]) | ||
:PatientSync checks if the input format for the respective prefix is valid; | ||
if () then ([else]) | ||
:PatientSync throws an error; | ||
:PatientSync adds error message to output; | ||
else ([Valid input format]) | ||
:PatientSync generates the information to be edited; | ||
:PatientSync edits the specified event; | ||
:PatientSync updates the set of events for the patient; | ||
:PatientSync updates the displayed patient list; | ||
:PatientSync adds success message to output; | ||
endif | ||
endif | ||
endif | ||
endif | ||
:PatientSync displays output message on GUI; | ||
stop | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.