Skip to content

feat: enhance partition settings to manage non-partitionable resourcetypes #6877

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
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

patrick-werner
Copy link
Member

🔧 Make List of Non-Partitionable Resource Types Configurable

Fixes #6875

📜 Problem

HAPI FHIR currently hardcodes a list of resource types that cannot be partitioned (e.g., Questionnaire, StructureDefinition, CodeSystem, etc.) inside BaseRequestPartitionHelperSvc.
In multi-tenant environments, this restricts flexibility — for example, tenants might require tenant-specific Questionnaire resources.

Overriding this behavior previously required:

  • Subclassing RequestPartitionHelperSvc
  • Using reflection to modify internal fields
  • Overriding Spring beans manually

This approach is brittle, non-obvious, and not guaranteed to be compatible across HAPI versions.


✅ Proposed Solution

This PR introduces a configurable list of non-partitionable resource types:

  • Defines a new static default list in PartitionSettings.DEFAULT_NON_PARTITIONABLE_RESOURCE_TYPES
  • Adds a field nonPartitionableResourceTypes with corresponding getter/setter in PartitionSettings
  • Updates BaseRequestPartitionHelperSvc to use the configured list instead of a hardcoded set

This change preserves current defaults but allows full customization via configuration.

Closes #6875

@robogary
Copy link
Contributor

This Pull Request has failed the formatting check

Please run mvn spotless:apply or mvn clean install -DskipTests to fix the formatting issues.

You can automate this auto-formatting process to execute on the git pre-push hook, by installing pre-commit and then calling pre-commit install --hook-type pre-push. This will cause formatting to run automatically whenever you push.

@robogary
Copy link
Contributor

Formatting check succeeded!

@patrick-werner patrick-werner requested a review from dotasek April 16, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make non-partitionable resource types configurable instead of hardcoded in BaseRequestPartitionHelperSvc
2 participants