Merged
Conversation
Two issues fixed in the OCL ValueSet provider: 1. #indexValueSet rejected fresh discovery metadata when a cold-cached entry already existed (different object identity check). This meant updated `lastUpdated` timestamps from OCL were never propagated, so #isCachedExpansionValid always passed and stale compose data was never invalidated. 2. #ensureComposeIncludes called #normalizeComposeIncludes which stripped `concept` arrays from compose entries built by background expansion. This caused the expand engine to fall back to "include whole CodeSystem", returning concepts that were deliberately excluded from the collection (e.g. LCVMA1DE001 appearing despite not being referenced in the ValueSet collection on OCL). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add case-insensitive fallback for concept cache lookups to handle OCL concept IDs that differ in case from FHIR codes (e.g. "y" vs "Y") - Extract #fetchConceptByCode helper and retry with lower/upper case alternatives before returning not-found - Carry over enumerated compose when re-indexing a ValueSet so that fresh discovery metadata does not discard background expansion results - Guard against overwriting enumerated concepts with system-only includes that would cause the expand engine to include all CodeSystem concepts - Skip cold cache freshness check when the in-memory cache was just invalidated, ensuring stale files do not suppress re-expansion - Preserve concept designation data in background expansion compose 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 improves the robustness and correctness of code and value set lookups in the OCL (Open Concept Lab) FHIR terminology provider. The main focus is on handling case-insensitive code lookups, improving cache management, and ensuring that value set expansions do not unintentionally broaden due to missing concept enumerations. The changes also enhance how designations are preserved and propagated in value set expansions.
Case-insensitive code lookup and caching:
conceptCachefor codes, ensuring that codes differing only by case (e.g., "y" vs "Y") are matched and cached under the requested case for faster future access.Value set cache and expansion improvements:
compose.includebut the existing cached version has one, the compose from the cache is carried over to prevent fallback to "include whole CodeSystem" behavior.Value set expansion output enhancements: