-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ValueSet code case sensitivity #7395
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
base: master
Are you sure you want to change the base?
Conversation
|
Formatting check succeeded! |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…matching Updated testExpandValueSet_CaseSensitiveCodeSystem_CodesWithDifferentCase to use FRAGMENT content mode and include entire system instead of enumerating specific concepts. This ensures the test exercises the Hibernate Search code path where the case-sensitivity bug manifests, providing proper TDD validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…ontent When a user persists a CodeSystem that overrides a built-in HL7 CodeSystem, the JPA-persisted version should take precedence over the built-in default. This is critical for case-sensitive CodeSystems where codes differ only by case (e.g., "drug" vs "Drug"). The fix: - Add removeCodeSystem/removeValueSet methods to DefaultProfileValidationSupport to selectively remove URLs from the in-memory cache - At startup, scan JPA for persisted CodeSystem/ValueSet URLs and remove them from the default profile cache so JPA versions take precedence - When a CodeSystem or ValueSet is created/updated, remove its URL from the default profile cache and invalidate validation caches - Fix lazy initialization issue where removal was silently ignored if the terminology maps hadn't been initialized yet - Add null checks for delete operations where the resource may be null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Adds changelog documenting the new JpaStorageSettings.setAllowDatabaseValidationOverride() setting which allows database-stored CodeSystem and ValueSet resources to take precedence over built-in default profile validation resources. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Documents the new JpaStorageSettings.setAllowDatabaseValidationOverride(boolean) setting in the validation support modules documentation, explaining how it can be used to give database-stored terminology resources precedence over built-in HL7 definitions during validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7395 +/- ##
=========================================
Coverage 83.80% 83.80%
- Complexity 30194 30200 +6
=========================================
Files 1833 1833
Lines 116644 116656 +12
Branches 14816 14817 +1
=========================================
+ Hits 97752 97768 +16
+ Misses 12594 12591 -3
+ Partials 6298 6297 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jmarchionatto
left a comment
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.
Looks good! Approved with a question
| type: add | ||
| issue: 7394 | ||
| title: "A new setting JpaStorageSettings.setAllowDatabaseValidationOverride(boolean) has been added. | ||
| When enabled, database-stored CodeSystem and ValueSet resources take precedence over built-in |
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.
Is the precedence only for validation purposes or any request?
If it is only for validation, it could be indicated here.
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.
good catch!
This MR adds a new configuration setting that allows database-stored terminology resources (CodeSystem, ValueSet) to take precedence over built-in default profile validation resources during validation. This addresses scenarios where users need to store custom CodeSystems that override HL7 defaults.
JpaStorageSettings.setAllowDatabaseValidationOverride(boolean)setting that controls the order of validation support modules in the chainJpaValidationSupportChain.postConstruct()to conditionally reorder the JPA validation support before or after the default profile validation support based on the new settingCode Review Suggestions
allowDatabaseValidationOverrideclearly conveys what it does - it specifically changes the order of validation support modules rather than a broad override mechanismQA Test Suggestions
Setup
http://terminology.hl7.org/CodeSystem/insurance-plan-type)Test Cases
(See original bug report for reproduction steps)
Default behavior (setting disabled): Create a CodeSystem with the same URL as a built-in HL7 CodeSystem but with different case sensitivity. Verify that ValueSet expansion uses the built-in definition's case sensitivity, not the database version.
Override enabled: Enable
allowDatabaseValidationOverride=true, create a case-sensitive CodeSystem with codes that differ only by case (e.g., "drug" and "Drug"). Verify that ValueSet expansion includes both case variants when the database CodeSystem takes precedence.Validation behavior: With the override enabled, validate a resource against a ValueSet that references the overridden CodeSystem. Verify that validation uses the database CodeSystem's properties.
Setting change at runtime: If the setting is changed after server startup, verify behavior is consistent (note: may require server restart or cache invalidation).
FRAGMENT content mode: Test specifically with CodeSystems using FRAGMENT content mode, as this is the scenario where users need to supplement built-in definitions with additional codes.