Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patient Tracker API

A small Java Spring Boot REST API for tracking patients and their current care status.

This project is intentionally focused on one healthcare backend workflow: add patients, view patients, find a patient by id, and update patient status.

Tech Stack

  • Java 17
  • Spring Boot
  • Spring Web
  • Bean Validation
  • Springdoc OpenAPI / Swagger UI
  • JUnit 5
  • Maven

Features

  • Add a patient
  • List all patients
  • Find a patient by id
  • Update a patient's status
  • Validate request bodies
  • Return clean JSON error responses
  • Test requests with IntelliJ HTTP Client, Postman, or Swagger UI

Screenshots

API Docs

Patient Tracker API docs

Example Patient Workflow

Patient Tracker API example workflow

Patient Model

{
  "id": 1,
  "name": "Alex Carter",
  "age": 34,
  "status": "WAITING"
}

Allowed statuses:

  • WAITING
  • IN_TREATMENT
  • DISCHARGED

The API also accepts common treatment-status variants like IN-TREATMENT and IN TREATMENT.

Endpoints

Method Endpoint Description
GET / Health check
GET /patients List all patients
GET /patients/{id} Find a patient by id
POST /patients Add a patient
PATCH /patients/{id}/status Update patient status

Setup

mvn clean install

Run the API

mvn spring-boot:run

The API will run locally at:

http://localhost:8080

Open Swagger UI:

http://localhost:8080/swagger-ui.html

Example Requests

Add a Patient

POST /patients
Content-Type: application/json
{
  "id": 1,
  "name": "Alex Carter",
  "age": 34,
  "status": "WAITING"
}

List Patients

GET /patients

Find Patient By Id

GET /patients/1

Update Patient Status

PATCH /patients/1/status
Content-Type: application/json
{
  "status": "IN_TREATMENT"
}

Testing With IntelliJ Or Postman

IntelliJ users can run the prepared HTTP requests in:

docs/requests.http

Postman users can create requests using the endpoint table above and http://localhost:8080 as the base URL.

Run Tests

mvn test

Current Data Storage

Patients are stored in memory with a ConcurrentHashMap. Data resets when the application restarts.

Next Improvements

  • Add SQL/PostgreSQL persistence
  • Add repository and database layers
  • Expand validation and error handling
  • Add controller/integration tests
  • Add Docker support
  • Deploy to Azure

About

Java Spring Boot REST API for tracking patients, managing care statuses, and practicing healthcare backend development.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages