Skip to content

Commit

Permalink
Merge pull request #30 from yentheng0110/master
Browse files Browse the repository at this point in the history
Fix Checkstyle
  • Loading branch information
coraleaf0602 authored Oct 4, 2024
2 parents f0aae7d + 5756bb9 commit 538b529
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/main/java/BookBob/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.Scanner;

public class Main {

public static void main(String[] args) {
System.out.println("Welcome to BookBob, Dr. Bob!");

Expand Down Expand Up @@ -51,4 +50,4 @@ public static void main(String[] args) {
}
}
}
}
}
10 changes: 6 additions & 4 deletions src/main/java/BookBob/functions/SaveAndRetrieve.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ 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: ";
List<String> medications = patient.getMedication();
for(int i = 0; i < medications.size(); i++) {
output += medications.get(i) + ";";
Expand Down Expand Up @@ -73,7 +74,8 @@ 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) {
Expand Down

0 comments on commit 538b529

Please sign in to comment.