-
Notifications
You must be signed in to change notification settings - Fork 37
Validate measure library URL before CQL evaluation #768
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
base: master
Are you sure you want to change the base?
Validate measure library URL before CQL evaluation #768
Conversation
…e library if the URL from the measure is in conflict.
|
Formatting check succeeded! |
…ing-enforcement-with-library
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #768 +/- ##
============================================
- Coverage 73.01% 72.93% -0.08%
Complexity 235 235
============================================
Files 538 539 +1
Lines 25170 25237 +67
Branches 3190 3207 +17
============================================
+ Hits 18377 18406 +29
- Misses 5270 5300 +30
- Partials 1523 1531 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite a bit of logic to handle non-compliant libraries. Why not just require the libraries to be compliant?
…tential error messages but otherwise leave the logic the same as in master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that we ought to be using this class:
There are some tricky edge cases in dealing with canonical references, and this class wraps them all up nicely, we shouldn't be re-inventing that logic here, just re-use what's in the Canonicals class, yes?
…R4VersionedLibraryIdentifierUtils and add system to Canonicals.
…ing-enforcement-with-library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, a few comments on the Canonicals class
| String url = getUrl(canonical); | ||
| String id = getIdPart(canonical); | ||
| String resourceType = getResourceType(canonical); | ||
| String system = getSystem(canonical, resourceType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest that we call this "canonicalBase", that's the term that is used to describe this portion of a FHIR canonical URL, whereas the term "system" typically means the canonical URL of a naming or code system.
For a VersionedIdentifier, we are using the "canonicalBase" of the FHIR URL as the "system" for our identifiers, so when we talk about it in VersionIdentifier, system is the right term, but here in the general utilities for dealing with FHIR canonical URLs, it's the canonicalBase.
| checkNotNull(canonical); | ||
|
|
||
| String url = getUrl(canonical); | ||
| String id = getIdPart(canonical); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're in here making changes, I strongly recommend that we change the name of this part to "tail", not "id" to help avoid the almost universal confusion between FHIR ids and FHIR canonical urls.
I suggest that we deprecate getIdPart() and that we introduce getTail()
| } | ||
|
|
||
| @Nonnull | ||
| private static Library validateBundle( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I'm not really sure what to do here because this validation will in general fail in ways that it shouldn't because it's not doing version resolution, and I really don't know that we should be doing version resolution here as part of validation.
If you have a version-less reference from a measure, it's not wrong for there to be multiple versions of that library on the server, the version-less reference should resolve to the latest.
If you have a versioned reference from a measure, then it should only resolve to that version of the library.
But.... putting that logic here means that we're making decisions about how to do version selection as part of this validation. Seems wrong to me.
I think all we ought to be saying here is:
- If the reference from the measure is version less, then any library that matches that url, regardless of version, is valid.
- If the reference from the measure is versioned, then only a library matching that url and version is valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then... in the case of a versionless reference do you validate each possible library and make sure that it's name matches it's URL?
|



Closes #766