-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/update versions and libraries #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Saskia32123
wants to merge
6
commits into
main
Choose a base branch
from
chore/update-versions-and-libraries
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ed636f4
Reorganize dependencies in `pom.xml` and configure Lombok annotation …
773d1cb
Update Spring Boot and Java versions in `pom.xml`
89229c3
Upgrade dependencies in `pom.xml` and add Maven plugins for static an…
bd0f7ec
Add dependency and dependency tree reports for project libraries
f40b665
Add Qodana static analysis configuration file
ff2a689
Revert "Add dependency and dependency tree reports for project librar…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| # SampleXChange - AI Agent Guidelines | ||
|
|
||
| This document provides guidelines for AI agents working on the SampleXChange codebase, a Spring Boot application for FHIR resource conversion between BBMRI and MII KDS profiles. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| - **Technology Stack**: Java 17, Spring Boot 3.4.0, HAPI FHIR 6.8.8, Maven | ||
| - **Purpose**: Convert FHIR resources between BBMRI Profiles and MII KDS Profiles for biobank data interchange | ||
| - **Architecture**: Component-based Spring application with FHIR mapping layers | ||
|
|
||
| ## Build and Development Commands | ||
|
|
||
| ```bash | ||
| # Build the project | ||
| mvn clean install | ||
|
|
||
| # Build without tests | ||
| mvn clean package -DskipTests | ||
|
|
||
| # Run the application | ||
| mvn spring-boot:run | ||
|
|
||
| # Run with specific profile | ||
| mvn spring-boot:run -Dspring-boot.run.arguments="--profile=BBMRI2MII" | ||
|
|
||
| # Run tests (when implemented) | ||
| mvn test | ||
|
|
||
| # Run single test class (when implemented) | ||
| mvn test -Dtest=ClassName | ||
|
|
||
| # Run single test method (when implemented) | ||
| mvn test -Dtest=ClassName#methodName | ||
|
|
||
| # Docker operations | ||
| docker build -t samplexchange . | ||
| docker-compose up | ||
| ``` | ||
|
|
||
| ## Code Style Guidelines | ||
|
|
||
| ### Package Structure | ||
| ``` | ||
| de.samply.samplexchange/ | ||
| ├── configuration/ # Spring configuration classes | ||
| ├── converters/ # Data conversion utilities | ||
| ├── enums/ # Enumerations for fixed values | ||
| ├── exceptions/ # Custom exception classes | ||
| ├── mapper/fhir/ # FHIR mapping logic (bbmri/, mii/ subpackages) | ||
| ├── models/ # Data model classes | ||
| ├── readers/ # FHIR resource readers | ||
| ├── resources/ # Resource mapping classes | ||
| ├── repository/ # Repository layer | ||
| ├── utils/fhir/ # FHIR utility classes | ||
| └── writers/fhir/ # FHIR writer classes | ||
| ``` | ||
|
|
||
| ### Naming Conventions | ||
| - **Classes**: PascalCase (e.g., `SpecimenMapping`, `TemperatureConverter`) | ||
| - **Methods**: camelCase with descriptive names (e.g., `fromBbrmiToMii`, `toMii`) | ||
| - **Variables**: camelCase (e.g., `bbmriId`, `miiSubject`) | ||
| - **Constants**: UPPER_SNAKE_CASE (e.g., `URL`, `DEFAULT_TIMEOUT`) | ||
| - **Packages**: lowercase with dots (e.g., `de.samply.samplexchange.converters`) | ||
|
|
||
| ### Import Organization | ||
| 1. Standard Java imports (`java.*`) | ||
| 2. Third-party imports (`org.springframework.*`, `ca.uhn.fhir.model.*`) | ||
| 3. Local imports (`de.samply.samplexchange.*`) | ||
|
|
||
| ### Code Patterns | ||
| - **Lombok Usage**: Heavy use of `@Slf4j`, `@Data`, `@Getter`, `@Setter` | ||
| - **Spring Annotations**: `@Component`, `@Value`, `@Service`, `@Repository` | ||
| - **Documentation**: JavaDoc required for all public classes and methods | ||
| - **Access Modifiers**: Public for API, private for internal utilities | ||
|
|
||
| ## Type Safety and Generics | ||
| - Use generic types in template classes: `ConvertClass<T1, T2>` | ||
| - Strong typing with FHIR model classes from HAPI FHIR | ||
| - Enum usage for fixed value sets (`ProfileFormats`) | ||
| - Avoid raw types where possible | ||
|
|
||
| ## Error Handling | ||
| - Custom exceptions extend `Exception` (not `RuntimeException`) | ||
| - Use proper exception chaining with descriptive messages | ||
| - Checked exceptions for expected error conditions | ||
| - Log errors appropriately using `@Slf4j` | ||
|
|
||
| ## FHIR-Specific Guidelines | ||
| - Use HAPI FHIR R4 structures exclusively | ||
| - Separate mappers for BBMRI↔MII conversions | ||
| - Handle extensions properly for custom data fields | ||
| - Follow FHIR resource structure conventions | ||
| - Validate resources before conversion | ||
|
|
||
| ## Configuration Management | ||
| - Environment variables: `PROFILE`, `DISABLESSL`, `SOURCE_URL`, `TARGET_URL`, etc. | ||
| - Configuration in `application.yml` | ||
| - Support for both BBMRI2MII and MII2BBMRI profiles | ||
| - Proper binding of environment-specific properties | ||
|
|
||
| ## Testing Guidelines (When Implemented) | ||
| - Use JUnit 4.13.2 with Spring Boot Test framework | ||
| - Mockito for mocking dependencies | ||
| - Testcontainers for integration tests | ||
| - Follow AAA pattern (Arrange, Act, Assert) | ||
| - Test both successful conversions and error scenarios | ||
|
|
||
| ## Architecture Patterns | ||
| - **Template Method**: Use `ConvertClass<T1, T2>` as base class | ||
| - **Strategy Pattern**: Different mappers for profile conversions | ||
| - **Factory Pattern**: Resource creation in readers/writers | ||
| - **Dependency Injection**: Spring component management | ||
|
|
||
| ## Development Best Practices | ||
| - Maintain separation of concerns between layers | ||
| - Use Spring's dependency injection properly | ||
| - Follow FHIR best practices for resource handling | ||
| - Ensure thread safety for component classes | ||
| - Add appropriate logging at INFO/DEBUG/ERROR levels | ||
| - Validate inputs at service boundaries | ||
|
|
||
| ## Environment Setup | ||
| - Java 17 required | ||
| - Maven 3.6+ for building | ||
| - Docker for containerization | ||
| - Environment variables for configuration (see application.yml) | ||
|
|
||
| ## When Making Changes | ||
| 1. Understand the FHIR profile differences (BBMRI vs MII KDS) | ||
| 2. Check for existing mapper patterns before creating new ones | ||
| 3. Ensure proper exception handling for FHIR parsing errors | ||
| 4. Add appropriate logging for debugging conversion issues | ||
| 5. Test with both source and target profiles when applicable | ||
| 6. Verify resource validity after conversion | ||
|
|
||
| ## Common Pitfalls to Avoid | ||
| - Don't mix FHIR versions (use R4 consistently) | ||
| - Avoid hardcoded URLs or credentials | ||
| - Don't ignore SSL certificate validation in production | ||
| - Ensure proper resource ID handling during conversion | ||
| - Don't break existing mapper contracts when extending functionality | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #-------------------------------------------------------------------------------# | ||
| # Qodana analysis is configured by qodana.yaml file # | ||
| # https://www.jetbrains.com/help/qodana/qodana-yaml.html # | ||
| #-------------------------------------------------------------------------------# | ||
|
|
||
| ################################################################################# | ||
| # WARNING: Do not store sensitive information in this file, # | ||
| # as its contents will be included in the Qodana report. # | ||
| ################################################################################# | ||
| version: "1.0" | ||
|
|
||
| #Specify inspection profile for code analysis | ||
| profile: | ||
| name: qodana.starter | ||
|
|
||
| #Enable inspections | ||
| #include: | ||
| # - name: <SomeEnabledInspectionId> | ||
|
|
||
| #Disable inspections | ||
| #exclude: | ||
| # - name: <SomeDisabledInspectionId> | ||
| # paths: | ||
| # - <path/where/not/run/inspection> | ||
|
|
||
| projectJDK: "25" #(Applied in CI/CD pipeline) | ||
|
|
||
| #Execute shell command before Qodana execution (Applied in CI/CD pipeline) | ||
| #bootstrap: sh ./prepare-qodana.sh | ||
|
|
||
| #Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) | ||
| #plugins: | ||
| # - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com) | ||
|
|
||
| # Quality gate. Will fail the CI/CD pipeline if any condition is not met | ||
| # severityThresholds - configures maximum thresholds for different problem severities | ||
| # testCoverageThresholds - configures minimum code coverage on a whole project and newly added code | ||
| # Code Coverage is available in Ultimate and Ultimate Plus plans | ||
| #failureConditions: | ||
| # severityThresholds: | ||
| # any: 15 | ||
| # critical: 5 | ||
| # testCoverageThresholds: | ||
| # fresh: 70 | ||
| # total: 50 | ||
|
|
||
| #Specify Qodana linter for analysis (Applied in CI/CD pipeline) | ||
| linter: jetbrains/qodana-jvm:2025.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this than be updated to the newest versions as well?