-
Notifications
You must be signed in to change notification settings - Fork 6
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
Extract rules for Invariants. Use keyword for Invariant description, rules for everything else #251
Conversation
When extracting an Invariant, create assignment rules for properties that are not represented using keywords. Use the same functions as the InstanceProcessor for this. Add the paths for these elements to the returned list of paths so that caret rules will not be created for these elements.
When producing FSH for an Invariant, use the Description keyword for the description element. For all other metadata elements, use assignment rules instead. These rules will always come before any other rules on the Invariant.
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 generally looks good, but I'm wondering if the metadataToFSH()
code should actually be in SUSHI rather than here.
constructor(name: string) { | ||
super(name); | ||
} | ||
|
||
metadataToFSH(): string { |
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.
Is there a benefit to overriding the metadateToFSH()
here vs updating it in SUSHI? It seems to me that updating it in SUSHI would provide the most consistent implementation.
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 looks really good and works nicely! I only had a similar question to Chris's question, but I didn't notice anything else. I tried it on US Core and the few invariants with additional rules on them are now extract to the invariant!
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 looks good -- and running it against US Core gets the expected results on invariants.
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.
Looks good!
Fixes #235 and completes task CIMPL-1164.
When extracting an Invariant, create assignment rules for properties that are not represented using keywords. Use the same functions as the InstanceProcessor for this. Add the paths for these elements to the returned list of paths so that caret rules will not be created for these elements.
When producing FSH for an Invariant, use the Description keyword for the description element. For all other metadata elements, use assignment rules instead. These rules will always come before any other rules on the Invariant.