yo i got stuff

This commit is contained in:
2025-03-11 20:22:47 -05:00
commit 65376b95cd
27 changed files with 437 additions and 0 deletions

3
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

13
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="my-app" />
</profile>
</annotationProcessing>
</component>
</project>

20
.idea/jarRepositories.xml generated Normal file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

12
.idea/material_theme_project_new.xml generated Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MaterialThemeProjectNewConfig">
<option name="metadata">
<MTProjectMetadataState>
<option name="migrated" value="true" />
<option name="pristineConfig" value="false" />
<option name="userId" value="-154f2d0:19587d90df0:-7ffe" />
</MTProjectMetadataState>
</option>
</component>
</project>

12
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="21 (2)" project-jdk-type="JavaSDK" />
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

39
pom.xml Normal file
View File

@@ -0,0 +1,39 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.ayyalasomayajula.net</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<mainClass>net.ayyalasomayajula.net.App</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,10 @@
package net.ayyalasomayajula.net;
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@@ -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());
}
}

View File

@@ -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<String> medicalNotes;
private List<Appointment> appointmentLog;
private final LocalDateTime dob;
private final LocalDateTime joinDate;
private List<Path> 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<String> medicalNotes, List<Appointment> appointmentLog,
LocalDateTime dob, LocalDateTime joinDate, List<Path> 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<String> 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<Appointment> 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<Path> 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);
}
}

View File

@@ -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.
}
}

View File

@@ -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;
}
}

View File

@@ -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 );
}
}

BIN
target/classes/EHR.class Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
artifactId=my-app
groupId=net.ayyalasomayajula.net
version=1.0-SNAPSHOT

View File

@@ -0,0 +1 @@
net/ayyalasomayajula/net/App.class

View File

@@ -0,0 +1 @@
/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/src/main/java/net/ayyalasomayajula/net/App.java

View File

@@ -0,0 +1 @@
net/ayyalasomayajula/net/AppTest.class

View File

@@ -0,0 +1 @@
/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/src/test/java/net/ayyalasomayajula/net/AppTest.java

Binary file not shown.

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd" version="3.0" name="net.ayyalasomayajula.net.AppTest" time="0.009" tests="1" errors="0" skipped="0" failures="0">
<properties>
<property name="java.specification.version" value="21"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.class.path" value="/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/target/test-classes:/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/target/classes:/home/kbot/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:"/>
<property name="java.vm.vendor" value="Arch Linux"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.vendor.url" value="https://openjdk.org/"/>
<property name="os.name" value="Linux"/>
<property name="java.vm.specification.version" value="21"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="user.country" value="US"/>
<property name="sun.boot.library.path" value="/usr/lib/jvm/java-21-openjdk/lib"/>
<property name="sun.java.command" value="/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/target/surefire/surefirebooter-20250226005604968_3.jar /home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/target/surefire 2025-02-26T00-56-04_936-jvmRun1 surefire-20250226005604968_1tmp surefire_0-20250226005604968_2tmp"/>
<property name="jdk.debug" value="release"/>
<property name="surefire.test.class.path" value="/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/target/test-classes:/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/target/classes:/home/kbot/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:"/>
<property name="sun.cpu.endian" value="little"/>
<property name="user.home" value="/home/kbot"/>
<property name="user.language" value="en"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.version.date" value="2025-01-21"/>
<property name="java.home" value="/usr/lib/jvm/java-21-openjdk"/>
<property name="file.separator" value="/"/>
<property name="basedir" value="/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app"/>
<property name="java.vm.compressedOopsMode" value="Zero based"/>
<property name="line.separator" value="&#10;"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="surefire.real.class.path" value="/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app/target/surefire/surefirebooter-20250226005604968_3.jar"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="java.runtime.version" value="21.0.6+7"/>
<property name="user.name" value="kbot"/>
<property name="stdout.encoding" value="UTF-8"/>
<property name="path.separator" value=":"/>
<property name="os.version" value="6.13.2-arch1-1"/>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="localRepository" value="/home/kbot/.m2/repository"/>
<property name="java.vendor.url.bug" value="https://bugreport.java.com/bugreport/"/>
<property name="java.io.tmpdir" value="/tmp"/>
<property name="java.version" value="21.0.6"/>
<property name="user.dir" value="/home/kbot/Downloads/Comp-Sci-IA-Forms/Forms/Product/my-app"/>
<property name="os.arch" value="amd64"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="native.encoding" value="UTF-8"/>
<property name="java.library.path" value="/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="stderr.encoding" value="UTF-8"/>
<property name="java.vendor" value="Arch Linux"/>
<property name="java.vm.version" value="21.0.6+7"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="java.class.version" value="65.0"/>
</properties>
<testcase name="testApp" classname="net.ayyalasomayajula.net.AppTest" time="0.001"/>
</testsuite>

View File

@@ -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