This project implements a secure and efficient database handling layer for an Electronic Health Record (EHR) system using Java 21, Spring Boot, and PostgreSQL, following FHIR standards.
- FHIR-compliant REST API
- Secure handling of sensitive patient data
- Comprehensive patient and medical history management
- Swagger/OpenAPI documentation
- Docker support for easy deployment
- Integration tests with TestContainers
- Java 21
- PostgreSQL 15+
- Docker and Docker Compose (for containerized deployment)
- Gradle 8.5+
net.sanyal.ehr
├── controller # REST API controllers
├── service # Business logic layer
├── repository # Database access layer
├── model # Domain models
├── config # Configuration classes
├── utils # Utility classes
└── tests # Unit and integration tests
- Clone the repository:
git clone https://github.com/yourusername/ehr-db-handler.git
cd ehr-db-handler
- Configure environment variables:
export DB_URL=jdbc:postgresql://localhost:5432/ehr_db
export DB_USERNAME=your_username
export DB_PASSWORD=your_password
export DB_POOL_SIZE=10
- Build the project:
./gradlew build
- Run the tests:
./gradlew test
- Build and run using Docker Compose:
docker-compose up --build
The application will be available at http://localhost:8080
Once the application is running, access the Swagger UI at: http://localhost:8080/swagger-ui.html
- Unit tests:
./gradlew test
- Integration tests:
./gradlew integrationTest
Integration tests use TestContainers to spin up a PostgreSQL instance automatically.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request