Skip to content

Repository files navigation

ORGANized Records

ORGANized Records is a Java-based patient record management system developed as an ICS4U1 Computer Science CPT project.

The application demonstrates object-oriented programming, Java collections, file persistence, Maven project organization, JUnit 5 testing, and automated continuous integration with GitHub Actions.

It simulates a simple command-line record management system that allows users to create, search, update, delete, save, and load patient records.

Features

  • Create new patient records
  • View all stored patient records
  • Search for patients by ID
  • Update existing patient information
  • Delete patient records
  • Add medical notes to patients
  • Save patient information between program sessions
  • Load saved patient records when the program starts
  • Text-based command-line interface
  • Automated testing with JUnit 5
  • GitHub Actions CI on pushes and pull requests to main

Technologies

  • Java 17+
  • Maven
  • JUnit 5
  • GitHub Actions
  • Object-Oriented Programming
  • Java Collections Framework
  • LinkedList
  • ArrayList
  • Java File I/O

Object-Oriented Design

The project separates responsibilities across several Java classes.

Patient

Represents an individual patient and stores:

  • Patient ID
  • Name
  • Age
  • Contact information
  • Medical notes

Each Patient contains a collection of MedicalNote objects, demonstrating composition.

private List<MedicalNote> notes = new ArrayList<>();

MedicalNote

Represents a medical note associated with a patient.

Each note stores:

  • Date
  • Note contents
public class MedicalNote {
    private String date;
    private String note;
}

RecordManager

Manages the collection of patient records and provides operations for:

  • Adding patients
  • Searching by patient ID
  • Updating patient information
  • Deleting patients
  • Saving records
  • Loading records

Patient records are maintained using a LinkedList:

private LinkedList<Patient> records = new LinkedList<>();

MainMenu

Provides the command-line interface and handles user interaction with the record-management system.

Main

Contains the application's entry point.

When the application starts, it creates a RecordManager, loads saved patient information, and launches the menu.

Savable

Defines the persistence operations implemented by RecordManager.

public interface Savable {
    void save();
    void load();
}

Project Structure

ORGANized-Records/
├── .github/
│   └── workflows/
│       └── ci.yml
├── data/
│   └── patients.txt
├── src/
│   ├── main/
│   │   └── java/
│   │       └── com/
│   │           └── organizedrecords/
│   │               ├── Main.java
│   │               ├── MainMenu.java
│   │               ├── MedicalNote.java
│   │               ├── Patient.java
│   │               ├── RecordManager.java
│   │               └── Savable.java
│   └── test/
│       └── java/
│           └── com/
│               └── organizedrecords/
│                   ├── PatientTest.java
│                   └── RecordManagerTest.java
├── .gitignore
├── pom.xml
└── README.md

Running the Program

Requirements

  • Java 17 or newer
  • Maven

Check Java:

java -version

Check Maven:

mvn -version

Run from VS Code or IntelliJ

Open:

src/main/java/com/organizedrecords/Main.java

Then run the main method:

public static void main(String[] args)

Run Tests

mvn clean test

Build the Project

mvn package

Example Menu

=== ORGANized Records ===

1. Add Patient
2. View Records
3. Search Patient
4. Update Patient
5. Delete Patient
6. Add Medical Note
0. Save and Exit

Data Persistence

Patient information is stored in:

data/patients.txt

Records are saved using a pipe-separated format:

patientId|name|age|contact

Example:

1234567890|Sample Patient|25|4165551234

When the program starts, RecordManager.load() reads the file and reconstructs the patient records.

When the user selects Save and Exit, RecordManager.save() writes the current patient records back to the file.

Persistence Limitation

The current version permanently stores:

  • Patient ID
  • Name
  • Age
  • Contact information

Medical notes are stored in memory while the application is running but are not currently written to patients.txt.

This means medical notes do not persist after the program is closed.

Persistent medical-note storage is a potential future improvement.

Data Structures

LinkedList

Patient records are stored using:

private LinkedList<Patient> records = new LinkedList<>();

The linked list acts as the central collection managed by RecordManager.

ArrayList

Each patient maintains medical notes using:

private List<MedicalNote> notes = new ArrayList<>();

This demonstrates a composition relationship between Patient and MedicalNote.

Testing

The project uses JUnit 5 to test core record-management functionality.

Tests are located in:

src/test/java/com/organizedrecords/

Current tests cover:

  • Adding patient records
  • Searching for patients by ID
  • Updating patient information
  • Deleting patient records
  • Adding medical notes
  • Record-management behavior

Run all tests with:

mvn test

Example:

@Test
void testAddNote() {
    Patient patient = new Patient(
        "3544456222",
        "Daniyal",
        18,
        "6479118713"
    );

    patient.addNote(
        new MedicalNote(
            "2024-05-12",
            "Annual checkup"
        )
    );

    assertEquals(1, patient.getNotes().size());
}

Continuous Integration

The project uses GitHub Actions for automated continuous integration.

The workflow is located at:

.github/workflows/ci.yml

The CI workflow runs automatically on:

  • Pushes to main
  • Pull requests targeting main

The workflow:

  1. Checks out the repository
  2. Sets up Temurin Java 17
  3. Runs Maven
  4. Compiles the project
  5. Executes all JUnit tests
  6. Fails if compilation or testing fails

The main CI command is:

mvn clean verify

This ensures that every change pushed to the repository is automatically tested.

Concepts Demonstrated

This project demonstrates:

  • Object-oriented programming
  • Classes and objects
  • Encapsulation
  • Composition
  • Interfaces
  • Java collections
  • Linked lists
  • Array lists
  • CRUD operations
  • Searching and record retrieval
  • File persistence
  • Maven project organization
  • Unit testing with JUnit 5
  • Continuous integration with GitHub Actions

Future Improvements

Possible improvements include:

  • Persist medical notes between program sessions
  • Add stronger input validation
  • Prevent duplicate patient IDs
  • Add authentication and user accounts
  • Encrypt stored records
  • Replace text-file storage with a database
  • Add a graphical user interface
  • Improve exception handling
  • Add additional automated tests

Purpose

The goal of ORGANized Records is to apply fundamental Java and computer science concepts to a practical software problem.

The project demonstrates how information can be represented using objects, organized using data structures, retrieved through search operations, persisted using files, tested automatically, and managed through a command-line interface.

Authors

David Abraham
Daniyal Tauseef

ICS4U1 Computer Science CPT
June 2025

About

Java-based patient record management system featuring CRUD operations, file persistence, object-oriented design, linked lists, and JUnit 5 testing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages