Skip to content

Commit

Permalink
Merge pull request #245 from chonguschonguschongus/branch-fixingDocs
Browse files Browse the repository at this point in the history
Update DG and UG
  • Loading branch information
kohkaijie committed Nov 13, 2023
2 parents a237ab7 + fcc8078 commit 93b05d4
Show file tree
Hide file tree
Showing 23 changed files with 185 additions and 311 deletions.
10 changes: 6 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,16 @@ How the parsing works:

**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java)

<img src="images/ModelClassDiagram.png" width="450" />
<img src="images/NewModelClassDiagram.png" width="450" />
<img src="images/PersonPackageClassDiagram.png" width="450" />


The `Model` component,

* stores the address book data i.e., all `Person` objects (which are contained in a `UniquePersonList` object).
* stores the currently 'selected' `Person` objects (e.g., results of a search query) as a separate _filtered_ list which
is exposed to outsiders as an unmodifiable `ObservableList<Person>` that can be 'observed' e.g. the UI can be bound to
* stores the address book data i.e., all `Patient`, `Doctor` and `Appointment` objects.
* all objects are stored in the respective implementations of an abstract `UniqueObjectList`
* stores the currently 'selected' `Patient`, `Doctor` or `Appointment` objects (e.g., results of a search query) as a separate _filtered_ list which
is exposed to outsiders as an unmodifiable `ObservableList<T>` (where T is a `Patient`, `Doctor` or `Appointment`) that can be 'observed' e.g. the UI can be bound to
this list so that the UI automatically updates when the data in the list change.
* stores a `UserPref` object that represents the user’s preferences. This is exposed to the outside as
a `ReadOnlyUserPref` objects.
Expand Down
29 changes: 16 additions & 13 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ hospital management tasks done faster than current GUI apps in the industry.
4. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar MediLink.jar` command
to run the application.<br>
A GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.<br>
![Ui](images/Ui.png)
![quickview](images/quickorientation.png)

5. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will
open the help window.<br>
Expand Down Expand Up @@ -283,6 +283,9 @@ Finds persons that match the query.

Format: `find KEYWORD [MORE_KEYWORDS]`

<div markdown="block" class="alert alert-info">
**:information_source: Take Note:**<br>

* When searching names, the search is case-insensitive. e.g `hans` will match `Hans`.
* When searching names, the order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans`.
* When searching names, only full words will be matched e.g. `Han` will not match `Hans`.
Expand All @@ -291,6 +294,8 @@ Format: `find KEYWORD [MORE_KEYWORDS]`
* Note that if the name coincides with other find commands, it will be interpreted as the other find command first and extraneous paremeters will be ignored. e.g. `find F Kennedy John` will search for all female persons.
* It is recommended to use `list` to restore the view of all data after a `find` command.

</div>

Examples:

* `find John` returns `john` and `John Doe`.
Expand All @@ -304,9 +309,14 @@ Finds person that matches the NRIC query.

Format: `find NRIC`

<div markdown="block" class="alert alert-info">
**:information_source: Take Note:**<br>

* NRIC input must be capitalised!
* It is recommended to use `list` to restore the view of all data after a `find` command.

</div>

Examples:

* `find T1125726G` returns the person with the matching NRIC.
Expand All @@ -317,24 +327,17 @@ Finds all persons with matching gender.

Format: `find M` or `find F`

<div markdown="block" class="alert alert-info">
**:information_source: Take Note:**<br>

* M and F must be capitalised.
* It is recommended to use `list` to restore the view of all data after a `find` command.

Examples:

* `find M` returns all male persons.

### Locating people by blood types : `find Blood Type` ###

Finds all Patients with query blood type.

Format: `find Blood Type QUERY`

* It is recommended to use `list` to restore the view of all data after a `find` command.
</div>

Examples:

* `find Blood Type A+` returns all Patients with blood type A+.
* `find M` returns all male persons.

<div markdown="block" class="alert alert-info">
**:information_source: Take Note:**<br>
Expand Down
88 changes: 49 additions & 39 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,61 @@ skinparam arrowThickness 1.1
skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR

Package Model as ModelPackage <<Rectangle>>{
Class "<<interface>>\nReadOnlyAddressBook" as ReadOnlyAddressBook
Class "<<interface>>\nReadOnlyUserPrefs" as ReadOnlyUserPrefs
Class "<<interface>>\nModel" as Model
Class AddressBook
Class ModelManager
Class UserPrefs

Class UniquePersonList
Class Person
Class Address
Class Email
Class Name
Class Phone
Class Tag

Class I #FFFFFF
Package Model {
Class "<<interface>>\nModel" as Model
Class "<<interface>>\nReadOnlyAddressBook" as ReadOnlyAddressBook
Class "<<interface>>\nReadOnlyUserPrefs" as ReadOnlyUserPrefs

Class "ModelManager" as ModelManager
Class "AddressBook" as AddressBook
Class "UserPrefs" as UserPrefs

Class "UniqueObjectList" as UniqueObjectList
Class "UniqueAppointmentList" as UniqueAppointmentList


Package Person {
Class "Person" as Person

Package Doctor {
Class "UniqueDoctorList" as UniqueDoctorList
Class "Doctor" as Doctor
}
Package Patient {
Class "UniquePatientList" as UniquePatientList
Class "Patient" as Patient
}

Doctor.Doctor -down-|>Person
Patient.Patient -down-|> Person
}

Class HiddenOutside #FFFFFF
HiddenOutside ..> Model
ModelManager ---> "~* filteredDoctors" Person.Doctor.Doctor
ModelManager ---> "~* filteredPatients" Person.Patient.Patient
ModelManager ---> "~* filteredAppointments" Appointment

AddressBook *-down--> UniqueDoctorList
AddressBook *-down--> UniquePatientList
AddressBook *-down--> UniqueAppointmentList

AddressBook .up.|> ReadOnlyAddressBook
UniqueDoctorList .up.|> UniqueObjectList
UniquePatientList .up.|> UniqueObjectList
UniqueAppointmentList .up.|> UniqueObjectList

ModelManager .up.|> Model
Model .right.> ReadOnlyUserPrefs
Model .left.> ReadOnlyAddressBook
ModelManager -left-> "1" AddressBook
ModelManager -right-> "1" UserPrefs
UserPrefs .up.|> ReadOnlyUserPrefs
UniqueDoctorList -down---> "~* all" Person.Doctor.Doctor
UniquePatientList -down----> "~* all" Person.Patient.Patient
UniqueAppointmentList -down----> "~* all" Appointment

AddressBook *--> "1" UniquePersonList
UniquePersonList --> "~* all" Person
Person *--> Name
Person *--> Phone
Person *--> Email
Person *--> Address
Person *--> "*" Tag
Appointment --> "2" Ic
Appointment --> "1" AppointmentTime

Person -[hidden]up--> I
UniquePersonList -[hidden]right-> I
AddressBook .up.|> ReadOnlyAddressBook
ModelManager .up.|> Model
UserPrefs .up.|> ReadOnlyUserPrefs

Name -[hidden]right-> Phone
Phone -[hidden]right-> Address
Address -[hidden]right-> Email
ModelManager -down-> "1" AddressBook
UserPrefs "1" <- ModelManager

ModelManager --> "~* filtered" Person

}
@enduml
39 changes: 39 additions & 0 deletions docs/diagrams/PersonPackageClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR

Package Person {
Class Person
Class Email
Class Name
Class Address
Class Phone
Class Tag
Class Appointments

Person *--> "1" Email
Person *--> "1" Name
Person *--> "1" Phone
Person *--> "1" Address
Person *--> "*" Appointments
Person *--> "*" Tag

Package Doctor {
Class Doctor

Doctor -up---|> Person.Person

}

Package Patient {
Class Condition
Class BloodType

Patient -up---|> Person.Person
Patient *--> "1" Condition
Patient *--> "1" BloodType
}
}
@enduml
Binary file added docs/diagrams/UiClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/NewModelClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/PersonPackageClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/UiClassDiagram.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ Class UiManager
Class MainWindow
Class HelpWindow
Class ResultDisplay
Class PersonListPanel
Class PersonCard
Class PatientListPanel
Class PatientCard
Class DoctorListPanel
Class DoctorCard
Class AppointmentListPanel
Class AppointmentCard
Class StatusBarFooter
Class CommandBox
}
Expand All @@ -32,26 +36,29 @@ UiManager .left.|> Ui
UiManager -down-> "1" MainWindow
MainWindow *-down-> "1" CommandBox
MainWindow *-down-> "1" ResultDisplay
MainWindow *-down-> "1" PersonListPanel
MainWindow *-down-> "1" PatientListPanel
MainWindow *-down-> "1" DoctorListPanel
MainWindow *-down-> "1" AppointmentListPanel
MainWindow *-down-> "1" StatusBarFooter
MainWindow --> "0..1" HelpWindow

PersonListPanel -down-> "*" PersonCard
PatientListPanel -down-> "*" PatientCard
DoctorListPanel -down-> "*" DoctorCard
AppointmentListPanel -down-> "*" AppointmentCard

MainWindow -left-|> UiPart

ResultDisplay --|> UiPart
CommandBox --|> UiPart
PersonListPanel --|> UiPart
PersonCard --|> UiPart
StatusBarFooter --|> UiPart
HelpWindow --|> UiPart

PersonCard ..> Model
PatientCard ..> Model
DoctorCard ..> Model
AppointmentCard ..> Model
UiManager -right-> Logic
MainWindow -left-> Logic

PersonListPanel -[hidden]left- HelpWindow
HelpWindow -[hidden]left- CommandBox
CommandBox -[hidden]left- ResultDisplay
ResultDisplay -[hidden]left- StatusBarFooter
Expand Down
Binary file modified docs/images/findpickettpickensresult.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/quickorientation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
import seedu.address.model.appointment.Appointment;

/**
* Finds and lists all persons in in address book whose attributes match the predicate.
* Finds and lists all appointments in address book that has personnel that match the Ic query.
* Keyword matching is case insensitive.
*/
public class FindAppointmentCommand extends Command {

public static final String COMMAND_WORD = "find-appt";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all appointments who involve the "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all appointments that involve the "
+ "the specified case-sensitive NRIC and displays them as a list with index numbers.\n"
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\n"
+ "Example: " + COMMAND_WORD + " T1234567Z";

private final Predicate<Appointment> predicate;
/**
* Finds and lists all persons in address book whose attributes match the predicate.
* Finds and lists all appointments in address book that has personnel matching the Ic query.
* Keyword matching is case-insensitive.
*/
public FindAppointmentCommand(Predicate<Appointment> predicate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import seedu.address.logic.parser.exceptions.ParseException;

/**
* Parses input arguments and creates a new DeleteCommand object
* Parses input arguments and creates a new DeleteAppointmentCommand object
*/
public class DeleteAppointmentCommandParser implements Parser<DeleteAppointmentCommand> {
private static final Logger logger = LogsCenter.getLogger(DeleteCommandParser.class);
/**
* Parses the given {@code String} of arguments in the context of the DeleteCommand
* and returns a DeleteCommand object for execution.
* Parses the given {@code String} of arguments in the context of the DeleteAppointmentCommand
* and returns a DeleteAppointmentCommand object for execution.
*
* @throws ParseException if the user input does not conform the expected format
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import seedu.address.model.appointment.AppointmentIcPredicate;

/**
* Parses input arguments and creates a new FindCommand object
* Parses input arguments and creates a new FindAppointmentCommand object
*/
public class FindAppointmentCommandParser implements Parser<FindAppointmentCommand> {
private static final Logger logger = LogsCenter.getLogger(FindAppointmentCommandParser.class);

/**
* Parses the given {@code String} of arguments in the context of the FindCommand
* and returns a FindCommand object for execution.
* Parses the given {@code String} of arguments in the context of the FindAppointmentCommand
* and returns a FindAppointmentCommand object for execution.
*
* @throws ParseException if the user input does not conform the expected format
*/
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/seedu/address/logic/parser/KeywordParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import seedu.address.model.person.BloodTypePredicate;
import seedu.address.model.person.GenderPredicate;
import seedu.address.model.person.IcContainsKeywordsPredicate;
import seedu.address.model.person.NameContainsKeywordsPredicate;
Expand All @@ -28,15 +27,6 @@ public static Predicate<Person> parseInput(String[] input) {
Matcher genderMatcher = genderPattern.matcher(input[0]);
Matcher nricMatcher = nricPattern.matcher(input[0]);

if (input.length >= 3) {
Matcher bloodTypeMatcher = bloodTypePattern.matcher(input[2]);
if (bloodTypeMatcher.matches()) {
return new BloodTypePredicate(input[2]);
} else {
return new NameContainsKeywordsPredicate(Arrays.asList(input));
}
}

if (nricMatcher.matches()) {
return new IcContainsKeywordsPredicate(input[0]);
} else if (genderMatcher.matches()) {
Expand Down
Loading

0 comments on commit 93b05d4

Please sign in to comment.