From c876585e8a4b6efacee237f3e3d22c4239c8b468 Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Thu, 3 Oct 2024 10:07:38 +0800 Subject: [PATCH 1/2] Fix Gradle checkstyle compliance issues --- src/main/java/BookBob/Main.java | 1 - src/main/java/BookBob/entity/Patient.java | 14 +++++++------- .../java/BookBob/functions/SaveAndRetrieve.java | 12 +++++++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/BookBob/Main.java b/src/main/java/BookBob/Main.java index 1d5191dd83..29d3e640d8 100644 --- a/src/main/java/BookBob/Main.java +++ b/src/main/java/BookBob/Main.java @@ -1,5 +1,4 @@ package BookBob; - import BookBob.entity.Records; import BookBob.functions.CommandHandler; import BookBob.functions.SaveAndRetrieve; diff --git a/src/main/java/BookBob/entity/Patient.java b/src/main/java/BookBob/entity/Patient.java index 8eab39f97a..145c6e7fd2 100644 --- a/src/main/java/BookBob/entity/Patient.java +++ b/src/main/java/BookBob/entity/Patient.java @@ -1,13 +1,12 @@ package BookBob.entity; import java.util.ArrayList; -import java.util.List; public class Patient { private String name; private String NRIC; private String diagnosis; - private ArrayList medication; + private ArrayList medications; private int phoneNumber; private String dateOfBirth; private String homeAddress; @@ -18,20 +17,21 @@ public Patient(String name, String NRIC) { this.NRIC = NRIC; this.phoneNumber = 0; this.homeAddress = ""; - this.medication = new ArrayList<>(); + this.medications = new ArrayList<>(); this.diagnosis = ""; this.dateOfBirth = ""; } //constructor used in retrieving data - public Patient(String name, String NRIC, String phoneNumber, String dateOfBirth, String homeAddress, String diagnosis, ArrayList medications) { + public Patient(String name, String NRIC, String phoneNumber, String dateOfBirth, + String homeAddress, String diagnosis, ArrayList medications) { this.name = name; this.NRIC = NRIC; this.phoneNumber = Integer.parseInt(phoneNumber); this.dateOfBirth = dateOfBirth; this.homeAddress = homeAddress; this.diagnosis = diagnosis; - this.medication = medications; + this.medications = medications; } //getters and setters @@ -60,11 +60,11 @@ public void setDiagnosis(String diagnosis) { } public ArrayList getMedication() { - return medication; + return medications; } public void setMedication(ArrayList medication) { - this.medication = medication; + this.medications = medication; } public int getPhoneNumber() { diff --git a/src/main/java/BookBob/functions/SaveAndRetrieve.java b/src/main/java/BookBob/functions/SaveAndRetrieve.java index c0cf3efe7b..2fbcb4e452 100644 --- a/src/main/java/BookBob/functions/SaveAndRetrieve.java +++ b/src/main/java/BookBob/functions/SaveAndRetrieve.java @@ -29,9 +29,11 @@ public static void initFile(Records records){ private static String convertPatientToOutputText(Patient patient) { String output = ""; - output += "Name: " + patient.getName() + " | " + "NRIC: " + patient.getNRIC() + " | " + "Phone Number: " + patient.getPhoneNumber() + " | " - + "Date_Of_Birth: " + patient.getDateOfBirth() + " | " + "Home Address: " + patient.getHomeAddress() + " | " + "Diagnosis: " + patient.getDiagnosis() + " | " - + "Medication: "; + output += "Name: " + patient.getName() + " | " + "NRIC: " + + patient.getNRIC() + " | " + "Phone Number: " + + patient.getPhoneNumber() + " | " + "Date_Of_Birth: " + patient.getDateOfBirth() + + " | " + "Home Address: " + patient.getHomeAddress() + " | " + + "Diagnosis: " + patient.getDiagnosis() + " | " + "Medication: "; ArrayList medications = patient.getMedication(); for(int i = 0; i < medications.size(); i++) { output += medications.get(i) + ";"; @@ -72,12 +74,12 @@ public static void retrieveData(Records records){ for(int i = 0; i < rawMedications.length; i++) { medications.add(rawMedications[i].trim()); } - Patient patient = new Patient(name, NRIC, phoneNumber, dateOfBirth, homeAddress, diagnosis, medications); + Patient patient = new Patient(name, NRIC, phoneNumber, + dateOfBirth, homeAddress, diagnosis, medications); records.addPatient(patient); } } catch (FileNotFoundException e) { throw new RuntimeException(e); } } - } From 7b5e013ac468def140bb43bde7689847cbed7c5a Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Thu, 3 Oct 2024 10:29:12 +0800 Subject: [PATCH 2/2] Update AboutUs.md for YenTheng --- docs/AboutUs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 3f6993240c..56d3014dc7 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -1,5 +1,5 @@ # About us -Display | Name | Github Profile | Portfolio ---------|:----------:|:-----------------------------------------:|:---------: -![](https://via.placeholder.com/100.png?text=Photo) | Cora Zhang | [Github](https://github.com/coraleaf0602) | [Portfolio](docs/team/corazhang.md) +Display | Name | Github Profile | Portfolio +--------|:--------------:|:-----------------------------------------:|:---------: +![](https://via.placeholder.com/100.png?text=Photo) | Wong Yen Theng | [Github](https://github.com/yentheng0110) | [Portfolio](docs/team/wongyentheng.md)