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

Insert RuleSet at code path #942

Merged
merged 4 commits into from
Oct 27, 2021
Merged

Insert RuleSet at code path #942

merged 4 commits into from
Oct 27, 2021

Conversation

mint-thompson
Copy link
Collaborator

Completes task CIMPL-808.

An insert rule on a CodeSystem or RuleSet can start with a code path. This allows the code path to act as the context for the rules contained in the inserted RuleSet. When an InsertRule has a code path, it is applied to ConceptRules and CaretValueRules in the inserted RuleSet. An InsertRule with a code path on an entity other than a CodeSystem or RuleSet is syntactically invalid.

An insert rule on a CodeSystem or RuleSet can start with a code path.
This allows the code path to act as the context for the rules contained
in the inserted RuleSet. When an InsertRule has a code path, it is
applied to ConceptRules and CaretValueRules in the inserted RuleSet. An
InsertRule with a code path on an entity other than a CodeSystem or
RuleSet is syntactically invalid.
Copy link
Contributor

@ngfreiter ngfreiter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeSystem: MyCS
* #cookie
  * insert MyRuleSet

RuleSet: MyRuleSet
* ^property[0].valueString = "They are strong climbers."

Seems to cause errors, but I believe this would be expected to work right?

@@ -28,10 +28,10 @@ vsMetadata: id | title | description;
vsRule: vsComponent | caretValueRule | insertRule;
codeSystem: KW_CODESYSTEM name csMetadata* csRule*;
csMetadata: id | title | description;
csRule: concept | codeCaretValueRule | insertRule;
csRule: concept | codeCaretValueRule | codeInsertRule;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will want to update the spec with this new grammar, which I think shouldn't be fine, since the grammar is just informative.

When checking if a parser context contains a code path, consider the
presence of a RULESET_REFERENCE or PARAM_RULESET_REFERENCE to be
sufficient. Although this will include insert rules that contain a
regular path, those will also get picked up by containsPathContext, so
there are no consequences.
Copy link
Contributor

@julianxcarter julianxcarter 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 to me!

Copy link
Contributor

@ngfreiter ngfreiter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Radical 🛹

@ngfreiter ngfreiter merged commit f755cd2 into master Oct 27, 2021
@ngfreiter ngfreiter deleted the cimpl-808-insert-code-path branch October 27, 2021 19:55
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.

3 participants