Skip to content

Commit

Permalink
Merge pull request #172 from jskimdev/branch-UserGuide
Browse files Browse the repository at this point in the history
Add page break
  • Loading branch information
jskimdev authored Apr 15, 2024
2 parents 3db9d95 + 18fae84 commit eb3cdaa
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 28 deletions.
20 changes: 20 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ MediTrack stands at the forefront of healthcare technology, offering an intuitiv

The purpose of this User Guide is multifaceted. Primarily, it serves as an educational tool, introducing you to the myriad features and functionalities of MediTrack. Whether you are a first-time user or looking to deepen your understanding of more advanced features, this guide is tailored to meet your needs. It provides step-by-step instructions, best practices, and troubleshooting advice to ensure that you can navigate the application with ease and confidence.


<div style="page-break-after: always;"></div>

<!-- * Table of Contents -->
<page-nav-print />

Expand Down Expand Up @@ -46,6 +49,8 @@ The purpose of this User Guide is multifaceted. Primarily, it serves as an educa

--------------------------------------------------------------------------------------------------------------------

<div style="page-break-after: always;"></div>

## Features

<box type="info" seamless>
Expand Down Expand Up @@ -133,6 +138,9 @@ Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS b/DATE_OF_BIRTH s/Sex`
Example:
* `add n/John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01 b/2001-1-1 s/Male`

<div style="page-break-after: always;"></div>


### Adding a visit to a patient: `addv`

Adds a visit to a patient.
Expand Down Expand Up @@ -169,6 +177,9 @@ Shows a list of all patients in the patient list in order of appointment.

Format: `list-by-date`

<div style="page-break-after: always;"></div>


### Listing all patients whose appointments fall or on before a certain date : `list-until-date`

Shows a list of all patients in the patient list whose appointments fall on or before the given date.
Expand All @@ -193,6 +204,8 @@ Example:
* `edit 2 n/Betsy Crower` Edits the name of the 2nd patient to be `Betsy Crower`.
* `edit n/Alex Yeoh p/88472848 n/Eugene` Edits the name of patient from `Alex Yeoh` to `Eugene`.

<div style="page-break-after: always;"></div>

### Editing the latest visit of a patient: `editv`

Edits the displayed visit of a patient.
Expand Down Expand Up @@ -257,6 +270,8 @@ Format: `delete-p n/NAME p/PHONE_NUMBER`
Example:
* `delete n/Eugene Hirose p/90807561` Deletes the patient with name exactly the same as "Eugene Hirose" and phone number exactly the same as "90807561".

<div style="page-break-after: always;"></div>

### Deleting all entries : `delete-all`

Deletes all patients' information in the patientlist.json.
Expand Down Expand Up @@ -293,6 +308,8 @@ Example:
* `deletev 1`
* `deletev n/Alex Yeoh p/87438807`

<div style="page-break-after: always;"></div>

### Exiting the program : `exit`

Lets the system know the user wants to exit the program.
Expand Down Expand Up @@ -323,6 +340,9 @@ If your changes to the data file makes its format invalid, MediTrack will discar
Furthermore, certain edits can cause the MediTrack to behave in unexpected ways (e.g., if a value entered is outside the acceptable range). Therefore, edit the data file only if you are confident that you can update it correctly.
</box>

<div style="page-break-after: always;"></div>


## FAQ

**Q**: How do I transfer my data to another Computer?<br>
Expand Down
53 changes: 25 additions & 28 deletions src/main/java/seedu/address/logic/parser/EditCommandParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,40 +46,37 @@ public EditCommand parse(String args) throws ParseException {
}

private EditCommand parseStringWithNameAndPhone(String[] splitMessages) throws ParseException {
try {
String namePrefix = splitMessages[0].substring(2) + " ";
String phonePrefix = "";
String rest = " ";
Boolean isNameFilled = false;
Boolean isPhoneFilled = false;

for (int i = 1; i < splitMessages.length; i++) {
if (!isNameFilled && splitMessages[i].substring(0, 2).equals("p/") && !isPhoneFilled) {
isNameFilled = true;
phonePrefix = splitMessages[i].substring(2);
isPhoneFilled = true;
} else if (!isNameFilled && !splitMessages[i].substring(0, 2).equals("p/")) {
namePrefix += splitMessages[i] + " ";
} else {
rest += splitMessages[i] + " ";
}
String namePrefix = splitMessages[0].substring(2) + " ";
String phonePrefix = "";
String rest = " ";
Boolean isNameFilled = false;
Boolean isPhoneFilled = false;

for (int i = 1; i < splitMessages.length; i++) {
if (!isNameFilled && splitMessages[i].substring(0, 2).equals("p/") && !isPhoneFilled) {
isNameFilled = true;
phonePrefix = splitMessages[i].substring(2);
isPhoneFilled = true;
} else if (!isNameFilled && !splitMessages[i].substring(0, 2).equals("p/")) {
namePrefix += splitMessages[i] + " ";
} else {
rest += splitMessages[i] + " ";
}
}

ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(rest, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS,
PREFIX_DATEOFBIRTH, PREFIX_SEX, PREFIX_APPOINTMENT);

ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(rest, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS,
PREFIX_DATEOFBIRTH, PREFIX_SEX, PREFIX_APPOINTMENT);
argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS,
PREFIX_DATEOFBIRTH, PREFIX_SEX, PREFIX_APPOINTMENT);

argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS,
PREFIX_DATEOFBIRTH, PREFIX_SEX, PREFIX_APPOINTMENT);
EditPatientDescriptor editPatientDescriptor = new EditPatientDescriptor();

EditPatientDescriptor editPatientDescriptor = new EditPatientDescriptor();
setEditPatientDescriptor(editPatientDescriptor, argMultimap);

setEditPatientDescriptor(editPatientDescriptor, argMultimap);
return new EditCommand(new Name(namePrefix.trim()), new Phone(phonePrefix.trim()), editPatientDescriptor);

return new EditCommand(new Name(namePrefix.trim()), new Phone(phonePrefix.trim()), editPatientDescriptor);
} catch (Exception e) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE));
}
}

private EditCommand parseStringWithIndex(String args) throws ParseException {
Expand Down

0 comments on commit eb3cdaa

Please sign in to comment.