Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #402 +/- ##
==========================================
+ Coverage 89.21% 89.33% +0.11%
==========================================
Files 60 60
Lines 5081 5110 +29
Branches 1451 1462 +11
==========================================
+ Hits 4533 4565 +32
+ Misses 317 312 -5
- Partials 231 233 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
DRAFT because these features are not supported in the translator yet. Do not merge this until the translator is updated and we confirm these work with real ELM. In addition there are some open TODOs and questions, see below.
This PR adds support for the new
Retrieve.codeComparatoroptions introduced in CQL 2.0:~in,contains, and~contains. Note that because of how Retrieves work, there's not really any overlap in the implementations of thesecodeComparatoroptions and the same operators as standalone operators (see #388 for those, but I can merge everything into one PR when ready, if that's preferable)In general, these
codeComparatoroptions work the same way as the corresponding standalone operators, but in the context of a Retrieve,~containshas some additional special meaning. https://cql.hl7.org/v2.0-changelog.html#contains-in-a-retrieveThe description there isn't as complete as I personally needed to understand the use case so here's a deeper explanation (some of this is also included in the code comments)
The example there comes from QICore, so let's look at QICore negation more broadly: https://hl7.org/fhir/us/qicore/STU7.0.2/negation.html#extent-of-negation
When something is negated, it can either be a single code that is negated, or an entire class of concepts that are negated.
MedicationAdministrationNotDoneis represented inmedicationCodeableConcept.codingMedicationAdministrationNotDoneismedicationCodeableConcept.extension:codeOptions, whose value is acanonical(ValueSet)So let's say we want a Retrieve for "MedicationAdministrationNotDone representing penicillin", we want to write
[MedicationAdministrationNotDone: "Penicillin"]where that "Penicillin" is a single RxNorm code. We want to find bothmedicationCodeableConcept.coding = RxNorm 834046ANDexpand(medicationCodeableConcept.extension:codeOptions) contains RxNorm 834046. The way that's going to work is with thevalueSetPropertyof the Retrieve: https://cql.hl7.org/04-logicalspecification.html#valuesetpropertyTo fully support this use case, we also need to support the
valueSetPropertyof the retrieve. https://cql.hl7.org/04-logicalspecification.html#valuesetpropertySo this PR also adds support for
valueSetPropertyby fetching a referenced ValueSet and, if thecodeComparatoris~contains, checking if that VS contains the code in question.There are still some open questions on what to do when, eg, a referenced ValueSet is unknown and there's no configured terminology service to look it up.
Also TODO, fully populate the tests with real examples. The tests added here were created by Codex, and I think should cover the full set of cases we need to consider, but the examples need to be real, once the translator supports it.
Pull requests into cql-execution require the following.
Submitter and reviewer should ✔ when done.
For items that are not-applicable, mark "N/A" and ✔.
Submitter:
npm run checkto run tests, lint, and prettier)Reviewer:
Name: