Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9ed1a08
Variables
Kedelin261 Feb 19, 2026
f8aab09
Added Patient class to uml diagram
Bferg2002 Feb 20, 2026
d750655
Added checkIn field to Patient class
Bferg2002 Feb 21, 2026
d0b119a
Merge pull request #1 from Bferg2002/Bryant-branch
Bferg2002 Feb 21, 2026
c14d2e7
Made patient class
Kedelin261 Feb 21, 2026
7e5c178
added test file
Feb 21, 2026
00b7a33
Test
Kedelin261 Feb 21, 2026
d32becc
Merge pull request #2 from Bferg2002/kennys-branch
Kedelin261 Feb 21, 2026
f2734c3
Merge branch 'main' into mesheik-branch
Feb 21, 2026
d499a0e
Patient Class Updated
Kedelin261 Feb 21, 2026
d9750ef
Merge branch 'main' into kennys-branch
Kedelin261 Feb 21, 2026
69bbd35
Updated Diagram
Bferg2002 Feb 21, 2026
57d78db
Merge pull request #3 from Bferg2002/mesheik-branch
Mesheik Feb 21, 2026
ca13659
Commented out the appointments ArrayList
Bferg2002 Feb 21, 2026
7a6b91a
added variables
Feb 21, 2026
70c9dcf
Getters and Setters done
Feb 21, 2026
b8e26f6
Appointment Class is set up.
Feb 21, 2026
e73f371
deleted the test class and added the clinicapp class
Bferg2002 Feb 23, 2026
5c0ade8
Removed appointments array from the patient class to the clinicsystem…
Bferg2002 Feb 23, 2026
e360963
Added multiple functions to clinicsystem class
Bferg2002 Feb 23, 2026
e6f4ee8
finished clinicSystem class
Bferg2002 Feb 23, 2026
058e981
finished up my portion of the assignment
Bferg2002 Feb 23, 2026
9d87c14
Merge pull request #4 from Bferg2002/Bryant-branch
Bferg2002 Feb 23, 2026
b735f1f
Added a case to mark an appointment as completed
Bferg2002 Feb 23, 2026
392338e
Merge pull request #5 from Bferg2002/Bryant-branch
Bferg2002 Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions src/diagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
@startuml

class Patient {
- patientId : int
- name : String
- species : String
- ownersPhoneNumber : String
- checkedIn : boolean

+ Patient(species : String, name : String, checkedIn : boolean, ownersPhoneNumber : String)

+ getPatientId() : int
+ getName() : String
+ getSpecies() : String
+ getOwnersPhoneNumber() : String
+ isCheckedIn() : boolean

+ setName(name : String) : void
+ setSpecies(species : String) : void
+ setOwnersPhoneNumber(ownersPhoneNumber : String) : void
+ setCheckedIn(checkedIn : boolean) : void
}

class Appointment {
- reason : String
- date : String
- time : String
- completed : boolean

+ Appointment(date : String, time : String, reason : String)

+ getReason() : String
+ getDate() : String
+ getTime() : String
+ isCompleted() : boolean

+ markCompleted() : void
}

class ClinicSystem {
- patients : ArrayList<Patient>
- waitingList : ArrayList<Patient>
- appointments : ArrayList<Appointment>
- dailyTimeSlots : String[]

+ ClinicSystem()

+ addPatient(patient : Patient) : void
+ viewAllPatients() : void
+ lookUpPatient(name : String, phoneNumber : String) : void
+ lookUpPatientById(id : int) : void
+ checkInPatient(patient : Patient) : void

+ scheduleAppointment(date : String, time : String, reason : String) : void
+ cancelAppointment(date : String, time : String) : void
+ viewFullSchedule() : void
+ dailySummary(date : String) : void

+ addedToWaitingList(patient : Patient) : void
+ viewWaitList() : void
}

class ClinicApp {
+ main(args : String[]) : void
}

' =========================================
' RELATIONSHIPS EXPLAINED
' =========================================

' One ClinicSystem manages zero or many Patients.
' "1" means one ClinicSystem.
' "0..*" means the system can manage zero or many Patient objects.
' o-- means aggregation (Patients can exist independently of the ClinicSystem).
ClinicSystem "1" o-- "0..*" Patient


' One ClinicSystem manages zero or many Appointments.
' "1" means one ClinicSystem.
' "0..*" means the system can manage zero or many Appointment objects.
' o-- means aggregation (Appointments can exist independently of the ClinicSystem).
ClinicSystem "1" o-- "0..*" Appointment


' ClinicApp depends on ClinicSystem.
' This means the main application class uses ClinicSystem to run the program.
' --> represents a dependency relationship.
ClinicApp --> ClinicSystem

@enduml
158 changes: 158 additions & 0 deletions src/main/java/org/codedifferently/BryantClinicApp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
package org.codedifferently;

import java.util.Scanner;

public class BryantClinicApp {

public static void main(String[] args) {

Scanner input = new Scanner(System.in); //Scanner object called input
BryantClinicSystem clinic = new BryantClinicSystem(); //instance of the BryantClinicSystem class called clinic
int choice;

do {
displayClinicMenu();
try {
choice = input.nextInt();
input.nextLine();
} catch (Exception e) {
System.out.println("Invalid input. Please enter a number from the menu.");
input.nextLine(); // clear bad input
choice = -1; // force default case
}

//Actions based on the menu number the user selects
switch (choice) {
case 1:
System.out.print("Enter patient's species: ");
String species = input.nextLine();
System.out.print("Enter patient's name: ");
String name = input.nextLine();
System.out.print("Enter owner's phone number(no dashes): ");
String phone = input.nextLine();
KennyPatient newPatient = new KennyPatient(species, name, false, phone);
clinic.addPatient(newPatient);
break;

case 2:
clinic.viewAllPatients();
break;

case 3:
System.out.print("Enter patient ID to check in: ");
String checkInId = input.nextLine();
KennyPatient patient = clinic.getPatientById(Integer.parseInt(checkInId));
if (patient != null) {
clinic.checkInPatient(patient);
clinic.lookUpPatientById(Integer.parseInt(checkInId));

} else {
System.out.println("Patient not found.");
System.out.println("---------------------------");
}
break;

case 4:
System.out.print("Enter patient ID: ");
String id = input.nextLine();
clinic.lookUpPatientById(Integer.parseInt(id));
break;

case 5:
System.out.print("Enter patient's name: ");
name = input.nextLine();
System.out.println("Enter the owner's phone number (no dashes): ");
phone = input.nextLine();
clinic.lookUpPatient(name,phone);
break;

case 6:
System.out.print("Enter the date of your appointment (MM/DD/YYYY): ");
String date = input.nextLine();
System.out.print("Enter the time you want to schedule the appointment: ");
String time = input.nextLine().toUpperCase();
System.out.print("Enter the reason for scheduling this appointment: ");
String reason = input.nextLine();
System.out.println("Enter the patient's id: ");
String patientID = input.nextLine();
clinic.scheduleAppointment(Integer.parseInt(patientID), date, time, reason);
break;

case 7:
System.out.print("Enter the date of your appointment (MM/DD/YYYY): ");
String cancelDate = input.nextLine();
System.out.print("Enter the time of your appointment: ");
String cancelTime = input.nextLine().toUpperCase();
clinic.cancelAppointment(cancelDate, cancelTime);
break;

case 8:
clinic.viewFullSchedule();
break;

case 9:
System.out.print("Enter date for summary (MM/DD/YYYY): ");
String summaryDate = input.nextLine();

clinic.dailySummary(summaryDate);
break;

case 10:
clinic.viewWaitList();
break;

case 11:
System.out.print("Enter patient's species: ");
species = input.nextLine();
System.out.print("Enter patient's name: ");
name = input.nextLine();
System.out.print("Enter owner's phone number(no dashes): ");
phone = input.nextLine();
KennyPatient newPatient2 = new KennyPatient(species, name, false, phone);
clinic.addedToWaitingList(newPatient2);
break;

case 12:
System.out.print("Enter appointment date (MM/DD/YYYY): ");
String compDate = input.nextLine();

System.out.print("Enter appointment time: ");
String compTime = input.nextLine().toUpperCase();

clinic.completeAppointment(compDate, compTime);
break;

case 0:
System.out.println("Exiting system. Goodbye!");
break;

default:
System.out.println("Invalid choice. Please try again.");
}

} while (choice != 0);

input.close();
}

//helper function to display the menu options
public static void displayClinicMenu(){
System.out.println("\n**** Welcome to the Community Clinic System! ****");
System.out.println("Please select an option:");
System.out.println("1. Add New Patient");
System.out.println("2. View All Patients");
System.out.println("3. Check In Patient");
System.out.println("4. Search Patient by ID");
System.out.println("5. Search Patient by Name and Phone Number");
System.out.println("6. Schedule Appointment");
System.out.println("7. Cancel Appointment");
System.out.println("8. View Full Schedule");
System.out.println("9. Daily Summary Report");
System.out.println("10. View Waitlist");
System.out.println("11. Add Patient to Waitlist");
System.out.println("12. Mark an Appointment as Completed");
System.out.println("0. Exit");
System.out.println();
System.out.print("Enter choice: ");
}
}// ends class
Loading