In DataRequirementsVisitor.gatherDependenciesWithClassification(), the resolvedCache is keyed by Canonicals.getUrl(dependency.getReference()) which strips the version from the canonical. This means if two dependencies reference different versions of the same artifact (e.g. http://example.org/ValueSet/my-vs|1.0.0 and http://example.org/ValueSet/my-vs|2.0.0), only the first version resolved will be cached and returned for both lookups.
Location: cqf-fhir-cr/src/main/java/org/opencds/cqf/fhir/cr/visitor/DataRequirementsVisitor.java
var dependencyUrl = Canonicals.getUrl(dependency.getReference()); // strips version
// ...
if (resolvedCache.containsKey(dependencyUrl)) {
dependencyAdapter = resolvedCache.get(dependencyUrl);
} else {
dependencyAdapter = tryResolveDependencyReadOnly(...);
resolvedCache.put(dependencyUrl, dependencyAdapter);
}
Suggested fix:
Use the full reference (including version) as the cache key:
var cacheKey = dependency.getReference();
This preserves version-specific resolution while still de-duplicating identical references. Unversioned references will still cache correctly since their full reference has no version suffix.
In DataRequirementsVisitor.gatherDependenciesWithClassification(), the resolvedCache is keyed by Canonicals.getUrl(dependency.getReference()) which strips the version from the canonical. This means if two dependencies reference different versions of the same artifact (e.g. http://example.org/ValueSet/my-vs|1.0.0 and http://example.org/ValueSet/my-vs|2.0.0), only the first version resolved will be cached and returned for both lookups.
Location: cqf-fhir-cr/src/main/java/org/opencds/cqf/fhir/cr/visitor/DataRequirementsVisitor.java
Suggested fix:
Use the full reference (including version) as the cache key:
var cacheKey = dependency.getReference();This preserves version-specific resolution while still de-duplicating identical references. Unversioned references will still cache correctly since their full reference has no version suffix.