Skip to content
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

latest from Tx Server #621

Merged
merged 13 commits into from
Jan 31, 2025
Merged

latest from Tx Server #621

merged 13 commits into from
Jan 31, 2025

Conversation

TahaAttari
Copy link
Collaborator

@TahaAttari TahaAttari commented Dec 21, 2024

APHL-1326

This ticket is for the $release operation parameter latestFromTxServer, it should pull the latest versions of ValueSets from the Tx server at release time if they do not have versions specified on the canonical references in their parents.

Remaining work:

  • tests
  • polishing
  • Code Quality

@TahaAttari TahaAttari marked this pull request as draft December 21, 2024 00:55
Copy link

github-actions bot commented Dec 21, 2024

Formatting check succeeded!

Copy link

codecov bot commented Dec 21, 2024

Codecov Report

Attention: Patch coverage is 91.20000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 74.20%. Comparing base (999f487) to head (cb2bc89).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...rg/opencds/cqf/fhir/cr/visitor/ReleaseVisitor.java 91.20% 6 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #621      +/-   ##
============================================
+ Coverage     74.17%   74.20%   +0.03%     
  Complexity       19       19              
============================================
  Files           363      363              
  Lines         19083    19099      +16     
  Branches       2532     2530       -2     
============================================
+ Hits          14155    14173      +18     
+ Misses         3590     3589       -1     
+ Partials       1338     1337       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 249 to 271
private Optional<IKnowledgeArtifactAdapter> latestComponentRespectingVersions(
String preReleaseReference, IEndpointAdapter endpoint, boolean latestFromTxServer, boolean isOwned) {
Optional<IKnowledgeArtifactAdapter> latest = Optional.empty();
var resourceType = Canonicals.getResourceType(preReleaseReference);
var prereleaseReferenceVersion = Canonicals.getVersion(preReleaseReference);
if (isOwned) {
// get the latest version regardless of status because we own the resource so Drafts are ok (they'll be
// updated as part of $release)
latest = VisitorHelper.tryGetLatestVersion(preReleaseReference, repository);
} else if (resourceType != null
&& resourceType.equals(VALUESET)
&& prereleaseReferenceVersion == null
&& latestFromTxServer) {
// ValueSets we don't own go to the Tx Server if latestFromTxServer is true
latest = terminologyServerClient
.getResource(endpoint, preReleaseReference, this.fhirVersion())
.map(r -> (IKnowledgeArtifactAdapter) createAdapterForResource(r));
} else {
// get the latest ACTIVE version only because it's NOT owned
latest = VisitorHelper.tryGetLatestVersionWithStatus(preReleaseReference, repository, ACTIVE);
}
return latest;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sliver007 Wanted to check that the logic here is correct, for components, if latestFromTxServer is true it should only query the Tx Server if:

  1. The component is NOT owned
  2. The reference does not have a version
  3. The component is referencing a ValueSet

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some level of 'authoritativeSource' awareness that is needed here - similar to other areas of $release?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes there is, thanks 😬

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't get the actual authoritative source though, we can only check to see if the URL on the endpoint matches the URL in the reference and then 🤞🏾

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per our Slack discussion left it as is and added a comment explaining the assumption 👍🏾 (we assume the caller knows what they're doing, at worst the VSets are just not resolved)

@TahaAttari TahaAttari marked this pull request as ready for review January 31, 2025 00:10
@TahaAttari TahaAttari requested a review from sliver007 January 31, 2025 00:10
Copy link

Copy link
Collaborator

@sliver007 sliver007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you!

@sliver007 sliver007 merged commit 9c7e2c6 into master Jan 31, 2025
9 checks passed
@sliver007 sliver007 deleted the aphl-1326-latest-from-tx-server branch January 31, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants