Repository navigation
fix(ocl): make OCL ConceptMaps work with $translate - #306
Open
italomacedo wants to merge 2 commits into
Open
italomacedo wants to merge 2 commits into
italomacedo wants to merge 2 commits into
Conversation
OCL NARROWER-THAN / BROADER-THAN were emitted as the non-FHIR codes 'narrower-than' / 'broader-than', so $translate discarded them. Map them to the R5 ConceptMapRelationship codes (source-is-narrower-than-target, source-is-broader-than-target), accept NOT-SAME-AS as not-related-to, and normalise spacing/underscore variants of the map type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
$translate resolves a ConceptMap's sourceScope as a ValueSet and checks the code against it, failing the whole operation with not-found when it cannot. The OCL provider set sourceScopeUri/targetScopeUri to OCL repo paths (from_source_url, from_collection_url) or, for aggregated maps, to CodeSystem canonicals, none of which is a ValueSet, so every OCL translation failed: The value set '/orgs/MS/sources/BRCIAP2/', which is the source scope of the ConceptMap '/orgs/MS/sources/BRCIAP2/mappings/6888/', could not be found Leave the scopes unset; the group's source/target carry the systems. Verified against the live OCL instance: BRCIAP2 K86 -> BRCID10 I10, A99 -> 40 matches. Co-Authored-By: Claude Opus 5.5 <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.
Two bugs in the OCL ConceptMap provider made
$translatefail for OCL mappings.1. Non-FHIR relationship codes. OCL
map_typevalues were mapped tonarrower-than/broader-than, which are not ConceptMapRelationship codes, so$translatediscarded those mappings: onlySAME-ASmappings ever translated.SAME-AS→equivalentNARROWER-THAN→source-is-narrower-than-targetBROADER-THAN→source-is-broader-than-targetNOT-SAME-AS/NOT-EQUIVALENT→not-related-torelated-toThe map type is also normalised (case, spaces and underscores).
2. OCL repo paths declared as ConceptMap scopes.
$translateresolves a ConceptMap'ssourceScopeas a ValueSet and fails the operation with not-found when it cannot. The provider setsourceScopeUri/targetScopeUrito OCL repo paths (from_source_url,from_collection_url) or, for aggregated maps, to CodeSystem canonicals, none of which is a ValueSet:The scopes are now left unset; the group's source/target carry the systems.
Unit tests cover both. Verified end to end against a live OCL instance: BRCIAP2
K86→ BRCID10I10(equivalencewider), andA99→ all 40 of its mappings.🤖 Generated with Claude Code