Improve multilingual support and caching for non-OCL expansions#181
Open
italomacedo wants to merge 3 commits intomainfrom
Open
Improve multilingual support and caching for non-OCL expansions#181italomacedo wants to merge 3 commits intomainfrom
italomacedo wants to merge 3 commits intomainfrom
Conversation
…pport The expansion cache was returning the same cached result regardless of displayLanguage because hashSource() never included language in the key. The root cause was hasDisplayLanguages/hasHTTPLanguages checking a non-existent .source property on the Languages class, always returning false. Additionally, OCL ValueSets with pre-built multilingual expansions from cold cache were having their expansion data deleted before reaching the expand worker, forcing a rebuild from the FHIR package CodeSystem which only has English designations. Key fixes: - Fix hasDisplayLanguages/hasHTTPLanguages to use .length instead of .source - Apply language selection to pre-built expansions via selectDisplayForLanguage - Stop clearing inline expansion from OCL ValueSets in fetchValueSet - Preserve expansion data when background cache validation fails - Guard scanValueSet against undefined compose - Add verbose=true to OCL concept fetches for designation data - Cache #fetchOrganizationIds to avoid repeated HTTP calls - Add negative URL cache for non-OCL ValueSet lookups - Remove expansion cache minimum duration threshold - Reduce verbose background job logging Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
OCL ValueSets now cache extensional compose.include (code lists) instead of full expansions, delegating expansion to the FHIR engine. This removes stale inline expansions and enables proper parameter handling by the expand worker pipeline. Note: displayLanguage for OCL-sourced translations still needs work since translations live in the OCL API, not in the core FHIR CodeSystems. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request focuses on improving performance and reducing log verbosity in the OCL terminology service codebase. It introduces caching for organization ID lookups, optimizes ValueSet fetching with negative caching, and removes many info-level log statements to make logs less noisy. Additionally, it ensures that stale ValueSet expansions are still served while background refreshes are pending.
Key changes include:
Performance and Caching Improvements
OCLCodeSystemProviderandOCLValueSetProvider, preventing redundant network requests. [1] [2] [3] [4]OCLValueSetProviderto avoid repeated failed lookups for ValueSets not present in OCL, improving fetch efficiency. [1] [2] [3]Background Expansion and Cache Handling
Logging and Verbosity Reduction
OCLSourceCodeSystemFactory,OCLBackgroundJobQueue, andOCLValueSetProviderto declutter logs, especially for routine cache loads, background job scheduling, and expansion events. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]API Improvements
OCLSourceCodeSystemProvidernow include averbose: trueparameter for more detailed responses.Code Cleanups
#clearInlineExpansionin ValueSet fetch methods, as stale expansions are now preserved until replaced. [1] [2] [3] [4] [5]These changes collectively improve system efficiency, reduce unnecessary network and CPU usage, and make operational logs more actionable.