Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 75b7c4d

Browse files
committed
Project Commit: This project has been completed awhile ago.
0 parents  commit 75b7c4d

File tree

94 files changed

+2782
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2782
-0
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/uiDesigner.xml

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HospitalApplication.iml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/Tests" isTestSource="true" />
7+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
8+
</content>
9+
<orderEntry type="inheritedJdk" />
10+
<orderEntry type="sourceFolder" forTests="false" />
11+
<orderEntry type="module-library" scope="TEST">
12+
<library name="JUnit5.4">
13+
<CLASSES>
14+
<root url="jar://$MODULE_DIR$/lib/junit-jupiter-5.4.2.jar!/" />
15+
<root url="jar://$MODULE_DIR$/lib/junit-jupiter-api-5.4.2.jar!/" />
16+
<root url="jar://$MODULE_DIR$/lib/apiguardian-api-1.0.0.jar!/" />
17+
<root url="jar://$MODULE_DIR$/lib/opentest4j-1.1.1.jar!/" />
18+
<root url="jar://$MODULE_DIR$/lib/junit-platform-commons-1.4.2.jar!/" />
19+
<root url="jar://$MODULE_DIR$/lib/junit-jupiter-params-5.4.2.jar!/" />
20+
<root url="jar://$MODULE_DIR$/lib/junit-jupiter-engine-5.4.2.jar!/" />
21+
<root url="jar://$MODULE_DIR$/lib/junit-platform-engine-1.4.2.jar!/" />
22+
</CLASSES>
23+
<JAVADOC />
24+
<SOURCES />
25+
</library>
26+
</orderEntry>
27+
<orderEntry type="module-library">
28+
<library>
29+
<CLASSES>
30+
<root url="jar://$MODULE_DIR$/lib/junit-jupiter-5.4.2.jar!/" />
31+
<root url="jar://$MODULE_DIR$/lib/junit-jupiter-api-5.4.2.jar!/" />
32+
<root url="jar://$MODULE_DIR$/lib/apiguardian-api-1.0.0.jar!/" />
33+
<root url="jar://$MODULE_DIR$/lib/opentest4j-1.1.1.jar!/" />
34+
<root url="jar://$MODULE_DIR$/lib/junit-platform-commons-1.4.2.jar!/" />
35+
<root url="jar://$MODULE_DIR$/lib/junit-jupiter-params-5.4.2.jar!/" />
36+
<root url="jar://$MODULE_DIR$/lib/junit-jupiter-engine-5.4.2.jar!/" />
37+
<root url="jar://$MODULE_DIR$/lib/junit-platform-engine-1.4.2.jar!/" />
38+
</CLASSES>
39+
<JAVADOC />
40+
<SOURCES />
41+
</library>
42+
</orderEntry>
43+
</component>
44+
</module>

Notes

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Notes about flow and patterns
2+
3+
1. Login
4+
5+
Login is done by authenticating user first then depending on the status returned (200, 400, 404, etc...)
6+
the program will direct GUI to appropriate UI and load user data from database
7+
8+
2. Registration
9+
10+
Data will be entered by user then sent to data base first, then Data will be loaded into the object itself.
11+
12+
Reason for this is that sending data to database successfully is important, the User if allowed to use program
13+
with data not yet entered in Database can cause logistical issues.
14+
15+
3. Update
16+
17+
Everytime something is sent update will get all data from database
18+
19+
4. Slot
20+
21+
Slot will show the appointments in all days of the month by getting the date NOW from outside the class and passing
22+
that date into the instance in a loop that goes for as long as the month is
23+
24+
It will get appointments by looping months, to days, to slot number to see if it equals, if it does it will set
25+
appointment.
26+
27+
Slot will go in database to get the appointment related to it

Tests/APITest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import org.junit.jupiter.api.Test;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
5+
class APITest {
6+
7+
//Want to check if I can edit data from class in two separate objects
8+
9+
@Test
10+
void factoryTestForTrue(){
11+
API obj1 = API.getInstance();
12+
API obj2 = API.getInstance();
13+
14+
obj1.getPatients().get(0).setFirstname("Kathy");
15+
16+
assertTrue(obj2.getPatients().get(0).getFirstname().equals("Kathy"));
17+
}
18+
19+
@Test
20+
void factoryTestForFalse(){
21+
API obj1 = API.getInstance();
22+
API obj2 = API.getInstance();
23+
24+
obj1.getPatients().get(0).setFirstname("Kathy");
25+
26+
assertFalse(obj2.getPatients().get(0).getFirstname().equals("Dave"));
27+
}
28+
29+
}

Tests/AppointmentTest.java

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import org.junit.jupiter.api.Test;
2+
3+
import java.time.LocalDate;
4+
5+
import static org.junit.jupiter.api.Assertions.*;
6+
7+
class AppointmentTest {
8+
9+
@Test
10+
void isNotificationStatusWorking(){
11+
LocalDate date = LocalDate.now();
12+
Patient patient = new Patient();
13+
patient.setFirstname("Dave");
14+
patient.setLastname("William");
15+
Administrator administrator = new Administrator();
16+
Specialist specialist = new Specialist();
17+
specialist.setLastname("Luis");
18+
specialist.setFirstname("Jeff");
19+
Appointment appointment = new Appointment(3, date, patient, specialist);
20+
appointment.setBookingCode("WBOD"); //Would be null without
21+
appointment.subscribeAdministrator(administrator);
22+
23+
patient.isActive = true;
24+
25+
administrator.appointmentSubscribed(appointment);
26+
patient.appointmentSubscribed(appointment);
27+
specialist.appointmentSubscribed(appointment);
28+
29+
appointment.setStatus("Cancelled");
30+
appointment.notifyUsers();
31+
patient.notificationCheck();
32+
assertTrue(patient.getAppointments().get(0).getStatus().equals("Cancelled"));
33+
assertTrue(specialist.getAppointments().get(0).getStatus().equals("Cancelled"));
34+
assertTrue(administrator.getAppointments().get(0).getStatus().equals("Cancelled"));
35+
36+
}
37+
38+
@Test
39+
void isNotificationBookingCodeWorking(){
40+
LocalDate date = LocalDate.now();
41+
Patient patient = new Patient();
42+
Administrator administrator = new Administrator();
43+
Specialist specialist = new Specialist();
44+
Appointment appointment = new Appointment(3, date, patient, specialist);
45+
appointment.setBookingCode("WBOD");
46+
appointment.subscribeAdministrator(administrator);
47+
48+
administrator.appointmentSubscribed(appointment);
49+
patient.appointmentSubscribed(appointment);
50+
specialist.appointmentSubscribed(appointment);
51+
52+
appointment.setStatus("Cancelled");
53+
appointment.notifyUsers();
54+
55+
assertTrue(patient.getAppointments().get(0).getBookingCode().equals("WBOD"));
56+
assertTrue(specialist.getAppointments().get(0).getBookingCode().equals("WBOD"));
57+
assertTrue(administrator.getAppointments().get(0).getBookingCode().equals("WBOD"));
58+
}
59+
60+
61+
}

lib/apiguardian-api-1.0.0.jar

2.11 KB
Binary file not shown.

lib/junit-jupiter-5.4.2.jar

5.77 KB
Binary file not shown.

lib/junit-jupiter-api-5.4.2.jar

131 KB
Binary file not shown.

lib/junit-jupiter-engine-5.4.2.jar

174 KB
Binary file not shown.

lib/junit-jupiter-params-5.4.2.jar

500 KB
Binary file not shown.

lib/junit-platform-commons-1.4.2.jar

87.3 KB
Binary file not shown.

lib/junit-platform-engine-1.4.2.jar

139 KB
Binary file not shown.

lib/opentest4j-1.1.1.jar

6.95 KB
Binary file not shown.
5.55 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
942 Bytes
Binary file not shown.
1002 Bytes
Binary file not shown.
839 Bytes
Binary file not shown.
886 Bytes
Binary file not shown.
8.53 KB
Binary file not shown.
Binary file not shown.
468 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
620 Bytes
Binary file not shown.
619 Bytes
Binary file not shown.
632 Bytes
Binary file not shown.
631 Bytes
Binary file not shown.
630 Bytes
Binary file not shown.
618 Bytes
Binary file not shown.
Binary file not shown.
794 Bytes
Binary file not shown.
7.79 KB
Binary file not shown.
823 Bytes
Binary file not shown.
4.19 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1.09 KB
Binary file not shown.
Binary file not shown.

resources/admin_icon.png

2.04 KB

resources/doctor_icon.png

3.33 KB

resources/hospital.gif

6.39 KB

resources/patient_icon.png

3.26 KB

0 commit comments

Comments
 (0)