Closed martingall87 closed 1 year ago
Also similar situation with the following rule:
subRefinement = eclAttributeSet / eclAttributeGroup / "(" ws eclRefinement ws ")"
the "(" ws eclRefinement ws ")"
component of the rule does not seem to be used because the eclattributeset
rule is greedy.
For example:
ECL:
< 19829001 |Disorder of lung| :
(116676008 |Associated morphology| = 79654002 |Edema|)
Parse Hierarchy:
Hi @martingall87, thanks for the question.
The conjunctionrefinementset
and disjunctionrefinementset
elements are only needed when using conjunction or disjunction with attribute groups, these use curly braces { }
.
For example:
* : * = *, { * = * }
Or something like:
< 131148009 |Bleeding (finding)| :
{ 363698007 |Finding site (attribute)| = << 422897007 |Vascular structure of stomach (body structure)|,
116676008 |Associated morphology (attribute)| = 50960005 |Hemorrhage (morphologic abnormality)| },
42752001 |Due to (attribute)| = << 312131008 |Viral infection of the digestive tract (disorder)|
If no attribute groups are needed then I think you are correct that the conjunctionrefinementset
element will not be used.
I hope that helps. See ECL Guide Attribute Groups
Thank you so much for your reply @kaicode. Apologies I completely missed the dependency on the Attribute Groups so that makes sense!
No worries at all, I'm glad you asked. It was good to check! Cheers.
Hi,
I've been investigating the SNOMED ECL ANTLR grammar for use with a language other than Java. Whilst experimenting with the ANTLR tooling, I've observed that the following rules may not be reachable in the grammar:
conjunctionrefinementset
disjunctionrefinementset
Link to rules
The
subrefinement
rule appears to be greedy in theeclrefinement
rule they are used in. All conjunction / disjunction combinations I've tried seem to just use theconjunctionattributeset
/disjunctionattributeset
rules.Example below using the latest ANTLR grammar in ANTLR Lab:
ECL:
Parse Hierarchy:
Are there scenarios that do use these two rules or could the grammar be simplified?