commit 65376b95cde553d16da893f6650373954cc00983 Author: Mars Ultor Date: Tue Mar 11 20:22:47 2025 -0500 yo i got stuff diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..6e7dddc --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..a6e0fa4 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a7acce9 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..3bcf8aa --- /dev/null +++ b/pom.xml @@ -0,0 +1,39 @@ + + 4.0.0 + net.ayyalasomayajula.net + my-app + jar + 1.0-SNAPSHOT + my-app + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.3.0 + + net.ayyalasomayajula.net.App + + + + org.apache.maven.plugins + maven-compiler-plugin + + 16 + 16 + + + + + diff --git a/src/main/java/net/ayyalasomayajula/net/App.java b/src/main/java/net/ayyalasomayajula/net/App.java new file mode 100644 index 0000000..c29e7d7 --- /dev/null +++ b/src/main/java/net/ayyalasomayajula/net/App.java @@ -0,0 +1,10 @@ +package net.ayyalasomayajula.net; + + +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/src/main/java/net/ayyalasomayajula/net/shared/Appointment.java b/src/main/java/net/ayyalasomayajula/net/shared/Appointment.java new file mode 100644 index 0000000..d1c281b --- /dev/null +++ b/src/main/java/net/ayyalasomayajula/net/shared/Appointment.java @@ -0,0 +1,20 @@ +package net.ayyalasomayajula.net.shared; + +import java.time.LocalDateTime; +import java.util.UUID; + +/** + * Represents an appointment using a record. + * + * @author Krishna Ayyalasomayajula + * @version 1.0 + */ +public record Appointment(UUID uuid, UUID patient, LocalDateTime time, boolean attendance, String description) { + /** + * Evaluates whether the allotted time has already passed. + * @return boolean object, true if date time is past + */ + public boolean isPast() { + return time.isBefore(LocalDateTime.now()); + } +} diff --git a/src/main/java/net/ayyalasomayajula/net/shared/EHR.java b/src/main/java/net/ayyalasomayajula/net/shared/EHR.java new file mode 100644 index 0000000..3c766be --- /dev/null +++ b/src/main/java/net/ayyalasomayajula/net/shared/EHR.java @@ -0,0 +1,156 @@ +import net.ayyalasomayajula.net.shared.Appointment; +import net.ayyalasomayajula.net.shared.Message; + +import java.nio.file.Path; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * Electronic health record of the patient. + * + * This class stores and manages patient information, including medical notes, appointments, and X-ray records. + * + * @author Krishna Ayyalasomayajula + * @version 1.0 + */ +public class EHR { + private String patientName; + private UUID uuid; + private List medicalNotes; + private List appointmentLog; + private final LocalDateTime dob; + private final LocalDateTime joinDate; + private List xrays; + + /** + * Constructs an Electronic Health Record (EHR) for a patient. + * + * @param patientName The name of the patient. + * @param uuid Unique identifier for the patient. + * @param medicalNotes List of medical notes related to the patient. + * @param appointmentLog List of appointments associated with the patient. + * @param dob Date of birth of the patient. + * @param joinDate Date the patient joined the system. + * @param xrays List of X-ray file paths. + */ + public EHR(String patientName, UUID uuid, List medicalNotes, List appointmentLog, + LocalDateTime dob, LocalDateTime joinDate, List xrays) { + this.patientName = patientName; + this.uuid = uuid; + this.medicalNotes = new ArrayList<>(medicalNotes); + this.appointmentLog = new ArrayList<>(appointmentLog); + this.dob = dob; + this.joinDate = joinDate; + this.xrays = new ArrayList<>(xrays); + } + + /** + * Gets the patient's name. + * + * @return The patient's name. + */ + public String getPatientName() { + return patientName; + } + + /** + * Sets the patient's name. + * + * @param patientName The new patient name. + */ + public void setPatientName(String patientName) { + this.patientName = patientName; + } + + /** + * Gets the unique identifier of the patient. + * + * @return The patient's UUID. + */ + public UUID getUuid() { + return uuid; + } + + /** + * Sets the unique identifier of the patient. + * + * @param uuid The new UUID. + */ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + * Gets the list of medical notes. + * + * @return List of medical notes. + */ + public List getMedicalNotes() { + return medicalNotes; + } + + /** + * Adds a medical note to the record. + * + * @param note The medical note to add. + */ + public void addMedicalNote(String note) { + this.medicalNotes.add(note); + } + + /** + * Gets the appointment log. + * + * @return List of appointments. + */ + public List getAppointmentLog() { + return appointmentLog; + } + + /** + * Adds an appointment to the log. + * + * @param appointment The appointment to add. + */ + public void addAppointment(Appointment appointment) { + this.appointmentLog.add(appointment); + } + + /** + * Gets the patient's date of birth. + * + * @return The date of birth. + */ + public LocalDateTime getDob() { + return dob; + } + + /** + * Gets the patient's join date. + * + * @return The join date. + */ + public LocalDateTime getJoinDate() { + return joinDate; + } + + /** + * Gets the list of X-ray file paths. + * + * @return List of X-ray file paths. + */ + public List getXrays() { + return xrays; + } + + /** + * Adds an X-ray file path to the record. + * + * @param xray The X-ray file path to add. + */ + public void addXray(Path xray) { + this.xrays.add(xray); + } +} diff --git a/src/main/java/net/ayyalasomayajula/net/shared/Message.java b/src/main/java/net/ayyalasomayajula/net/shared/Message.java new file mode 100644 index 0000000..4dbe7da --- /dev/null +++ b/src/main/java/net/ayyalasomayajula/net/shared/Message.java @@ -0,0 +1,18 @@ +package net.ayyalasomayajula.net.shared; + +/** + * Encapsulates the socket message objects using a record. + * + * @author Krishna Ayyalasomayajula + * @version 1.0 + */ +public record Message(MessageVariant messageVariant, String messageQuery, int timeoutSeconds, byte[] data) { + /** + * Constructor for Message record. + * @author Krishna Ayyalasomayajula + * @version 1.0 + */ + public Message { + // Validation or preprocessing can be added here if necessary. + } +} diff --git a/src/main/java/net/ayyalasomayajula/net/shared/MessageVariant.java b/src/main/java/net/ayyalasomayajula/net/shared/MessageVariant.java new file mode 100644 index 0000000..c8af66b --- /dev/null +++ b/src/main/java/net/ayyalasomayajula/net/shared/MessageVariant.java @@ -0,0 +1,22 @@ +package net.ayyalasomayajula.net.shared; + +public enum MessageVariant{ + GET("GET"), SET("SET"), UPSERT("UPSERT"), INSERT("INSERT"); + + + private final String text; + /** + * Constructor that stores the text of the enum field + */ + MessageVariant(String key){ + text=key; + } + /** + * Override toString method + * @return string text of the MessageVariant + */ + @Override + public String toString(){ + return this.text; + } +} \ No newline at end of file diff --git a/src/test/java/net/ayyalasomayajula/net/AppTest.java b/src/test/java/net/ayyalasomayajula/net/AppTest.java new file mode 100644 index 0000000..8504dfd --- /dev/null +++ b/src/test/java/net/ayyalasomayajula/net/AppTest.java @@ -0,0 +1,38 @@ +package net.ayyalasomayajula.net; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/target/classes/EHR.class b/target/classes/EHR.class new file mode 100644 index 0000000..857c79b Binary files /dev/null and b/target/classes/EHR.class differ diff --git a/target/classes/net/ayyalasomayajula/net/App.class b/target/classes/net/ayyalasomayajula/net/App.class new file mode 100644 index 0000000..2972f5c Binary files /dev/null and b/target/classes/net/ayyalasomayajula/net/App.class differ diff --git a/target/classes/net/ayyalasomayajula/net/Appointment.class b/target/classes/net/ayyalasomayajula/net/Appointment.class new file mode 100644 index 0000000..c436a56 Binary files /dev/null and b/target/classes/net/ayyalasomayajula/net/Appointment.class differ diff --git a/target/classes/net/ayyalasomayajula/net/Message.class b/target/classes/net/ayyalasomayajula/net/Message.class new file mode 100644 index 0000000..e7950b8 Binary files /dev/null and b/target/classes/net/ayyalasomayajula/net/Message.class differ diff --git a/target/classes/net/ayyalasomayajula/net/MessageVariant.class b/target/classes/net/ayyalasomayajula/net/MessageVariant.class new file mode 100644 index 0000000..3f9ce51 Binary files /dev/null and b/target/classes/net/ayyalasomayajula/net/MessageVariant.class differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..406f13a --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=my-app +groupId=net.ayyalasomayajula.net +version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..2075889 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +net/ayyalasomayajula/net/App.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..b8396fa --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/src/main/java/net/ayyalasomayajula/net/App.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..c92b681 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1 @@ +net/ayyalasomayajula/net/AppTest.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..4dc6fa0 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/src/test/java/net/ayyalasomayajula/net/AppTest.java diff --git a/target/my-app-1.0-SNAPSHOT.jar b/target/my-app-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..98354dc Binary files /dev/null and b/target/my-app-1.0-SNAPSHOT.jar differ diff --git a/target/surefire-reports/TEST-net.ayyalasomayajula.net.AppTest.xml b/target/surefire-reports/TEST-net.ayyalasomayajula.net.AppTest.xml new file mode 100644 index 0000000..9143578 --- /dev/null +++ b/target/surefire-reports/TEST-net.ayyalasomayajula.net.AppTest.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/net.ayyalasomayajula.net.AppTest.txt b/target/surefire-reports/net.ayyalasomayajula.net.AppTest.txt new file mode 100644 index 0000000..fdd8c1c --- /dev/null +++ b/target/surefire-reports/net.ayyalasomayajula.net.AppTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: net.ayyalasomayajula.net.AppTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 s -- in net.ayyalasomayajula.net.AppTest diff --git a/target/test-classes/net/ayyalasomayajula/net/AppTest.class b/target/test-classes/net/ayyalasomayajula/net/AppTest.class new file mode 100644 index 0000000..c584818 Binary files /dev/null and b/target/test-classes/net/ayyalasomayajula/net/AppTest.class differ