Skip to content

Commit

Permalink
Merge pull request #255 from laney0808/dg-addvisit
Browse files Browse the repository at this point in the history
Dg addvisit
  • Loading branch information
jovantanyk authored Apr 15, 2024
2 parents d6ab583 + b2524d9 commit 240f396
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ The `create` command is facilitated by `CreateCommand` and `CreateCommandParser`
* `CreateCommand#execute` is responsible for executing the command and adding the new patient to the system.
* `ImmuniMate#addPerson(Person)` is called to add the patient to the internal list of patients.
* `UniquePersonList#add(Person)` is used to add the new patient to the system.

`ModelManager#addPerson(Person)` is called to add the patient to the system. It calls `ImmuniMate.addPerson(Person)` which calls `UniquePersonList#add(Person)` to add the patient to the internal list of patients.

The command checks for duplicates in the system before adding the new patient.
* `Person#equals(Object)` is overridden to check if two patients are duplicates.
* `UniquePersonList#contains(Person)` is used to check if the patient already exists in the system's list of patients.
Expand Down Expand Up @@ -241,15 +243,17 @@ This `deleteinfo` command is facilitated by `DeleteInfoCommand` and `DeleteInfoC
* `DeleteInfoCommandParser#parse` is responsible for parsing the user input and creating a new `DeleteInfoCommand` instance.
* `DeleteInfoCommand#execute` is responsible for executing the command and removing the field of information from the patient.
* `Model#getFilteredPersonList()` is called to get the list of patients in the system.
* `Model#setField` where `Field` refers to whichever field specified to be deleted, is responsible for removing the field of information from the patient.
* `Observablelist<Persons>#filtered(Predicate)` is called to obtain `Person` object of patient with specified NRIC.
* `Observablelist<Persons>#get(int)` is called to obtain `Person` object in the filtered list.
* `Person#setField` where `Field` refers to whichever field specified to be deleted, is responsible for removing the field of information from the patient.
`DeleteInfoCommand` checks if the patient exists in the system before removing the field of information.
* `ModelManager#hasPerson(Person)` is called to check if the patient already exists in the system. It calls `ImmuniMate.hasPerson(Person)` which calls `UniquePersonList#contains(Person)` to check if the patient already exists in the internal list of patients.

Step 1. `DeleteInfoCommandParser` interprets the user's input for NRIC and the fields to be deleted, and creates a new `DeleteInfoCommand` instance.

Step 2. The `DeleteInfoCommand#execute` is called by the `LogicManager`. The `DeleteInfoCommand` checks if the patient exists in the system by calling `model.hasPerson(person)`.

Step 3. If the patient exists, the `DeleteInfoCommand` calls `model.setField` (where the field is the specified field to delete) to get the list of patients in the system.
Step 3. If the patient exists, the `DeleteInfoCommand` calls `model.getFilteredPersonList().filtered().get()` to get the specified patients in the system.

Step 4. `DeleteInfoCommand#execute` check which fields are to be deleted, and remove the field of information using `Person#setField(null)`. Where `Field` is the field to be deleted.

Expand Down
3 changes: 3 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ If your name has any special characters, kindly remove them for compliance. For
**Q**: Why is it when I update a patient's diagnosis, his/her status is not automatically updated to "UNWELL"?<br>
**A**: This is intended behaviour. We wish to leave it to your expertise to determine when a patient has truly contracted a disease, as there are some ambiguous cases which might not necessitate an "UNWELL" status, such as asymptomatic coronavirus cases.

**Q**: Why is it that when I update a person's field to the exact same content as the current one, no error is shown? Similarly, why is that when I delete a field that originally was not filled, no error message is shown?<br>
**A**: This is intended behaviour. This operation does not cause error in the system as the content is the same, and we do not want to interrupt your workflow with unnecessary error messages.
--------------------------------------------------------------------------------------------------------------------

## Known issues
Expand All @@ -710,3 +712,4 @@ If your name has any special characters, kindly remove them for compliance. For
4. **The `email` field** is case-sensitive, but in practical usage, email is case-insensitive.
5. **The `NRIC` field** cannot yet take NRIC numbers starting with F, G or M, which might cause inconvenience to a small segment of the Singapore population.
6. **The ImmuniMate icon** cannot be displayed on Windows systems, instead showing up as a brown square with a person icon. This is simply a cosmetic issue, so it should not pose other technical issues to Windows users.
7. **The `DateOfBirth`, `DateOfVisit` and `DateOfAdmission` fields** do allow future dates to be added, which might cause inconsistent entry if input is wrong.

0 comments on commit 240f396

Please sign in to comment.