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

Extract rules for Invariants. Use keyword for Invariant description, rules for everything else #251

Merged
merged 4 commits into from
Jan 12, 2024

Conversation

mint-thompson
Copy link
Collaborator

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.

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.
Copy link
Member

@cmoesel cmoesel left a 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 {
Copy link
Member

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.

Copy link
Collaborator

@jafeltra jafeltra left a 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!

Copy link
Member

@cmoesel cmoesel left a 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.

Copy link
Collaborator

@jafeltra jafeltra 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!

@mint-thompson mint-thompson merged commit a8eee62 into master Jan 12, 2024
14 checks passed
@mint-thompson mint-thompson deleted the cimpl-1164-invariant-rules branch January 12, 2024 14:31
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.

Support FSH 3.0 Invariant Rules
3 participants