-
Notifications
You must be signed in to change notification settings - Fork 43
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
Allow caret and insert rules to be applied to concepts within a ValueSet #1315
Conversation
Elements within value set concept components can be set by caret value rules. The concept must already be added to the value set in order to use it in a caret rule. The concept can be in either the include or exclude arrays. Concept rules with a single code establish a path context that can be used by an indented rule that follows it.
Because caret value rules can be applied to concepts, it is also reasonable to want to apply a rule set containing caret value rules at a concept. This uses the existing grammar rule for a codeCaretRule, but only one concept is allowed for the insert rule's path.
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 isn't as messy as you lead me to believe. That's good!
I do have a few questions and suggestions I'd like you to consider.
Thanks!
The syntax that was used to support listing multiple concepts in a single rule is removed. Tests related to this syntax are removed. Add more tests for making sure that rule context is handled properly in various combinations of rules on a ValueSet.
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.
Fantastic. This works well and has a great set of tests. I tried it out with all the examples in the balloted spec and they went great!
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.
Still good!
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 just had one question that could easily just be due to something I missed. Other than that, it looks great and I didn't notice anything else.
/Only one concept may be listed before an insert rule on a ValueSet\..*File: Insert\.fsh.*Line: 3\D*/s | ||
); |
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 have a question about this case. We log an error if there are multiple concepts listed before the insert rule, but I don't think we log any error if the caret value rule is included after multiple concepts. For example, something like this doesn't log any errors and adds the designation to the hippo concept. Is that expected?
ValueSet: ZooVS
* ZOO#hippo "Hippopotamus"
* ZOO#rhino
* ZOO#hippo ZOO#rhino ^designation.value = "hipopótamo"
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.
Oh dang. Yeah, multiple concepts in a VS should trigger an error no matter what. Good find.
…IR/sushi into cimpl-1130-compose-caret-rule
@jafeltra thank you for pointing out that case with the caret rule! I've added a test for that and resolved the issue. |
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.
How many times can I approve the same PR? Hopefully this is the last one! (But if not, that is OK).
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.
Thanks for making that update! Looks good to me!
Completes task CIMPL-1130.
Some of the elements within
ValueSet.compose.include.concept
andValueSet.compose.exclude.concept
can't be reached using the normal concept component rules on a ValueSet. To access those elements, you can now use a caret rule with a path that is a contained concept. Similarly, you can insert a RuleSet at such a path. These rules are similar to the code caret rules and code insert rules used by CodeSystem, but since theconcept
elements are a flat list, the path has to be exactly once concept long.A concept component rule with exactly one concept in it establishes a context for an indented rule to appear after it. So, these two rules:
are equivalent to these two rules:
The grammar changes to support these rules resulted in some different parser errors in cases where commas are used to list concepts. Additionally, these rules represent a sort of weird case where a rule may set a context, but not itself be indented. Rather than change the set of rules that are allowed to be used in context operations, I added a flag to the context-operation functions so that errors relating to improper indents only get logged once.