Stream: shorthand
Topic: Using RuleSet with Repeating Element
Jason Evans (Sep 30 2020 at 17:45):
Is there a way to insert a ruleset on an <element> the same way the obeys keyword allows? This is the syntax that I would expect:
- insert {RuleSet name} -- this works
- <element> insert {RuleSet name} -- is there a way to do this?
My goal is to consolidate PlanDefinition.action elements that exist in multiple PlanDefinition instances. For example: PlanDefinition1 has actions { A, B, C, D }, PlanDefinition2 has actions { A, B }, and PlanDefinition3 as actions { A, D }. Right now I'm faced with copy-pasting the action[A] into each definition, but I'd like to have a single source of truth for that action definition.
RuleSet: A
- title = "Title A"
RuleSet: B
- title = "Title B"
RuleSet: C
- title = "Title C"
RuleSet: D
- title = "Title D"
Instance: PlanDefinition1
InstanceOf: PlanDefinition
- action[0] insert A
- action[1] insert B
- action[2] insert C
- action[3] insert D
Instance: PlanDefinition2
InstanceOf: PlanDefinition
- action[0] insert A
- action[1] insert B
Instance: PlanDefinition3
InstanceOf: PlanDefinition
- action[0] insert A
- action[1] insert D
Chris Moesel (Sep 30 2020 at 17:55):
Unfortunately, the short answer to your question is "No, that's not supported." But we have some features planned for STU2 that I think would work really well for what you're wanting to do. See the Wicked FSH powerpoint for a quick overview of what you might expect to see in STU2.
Jason Evans (Sep 30 2020 at 17:58):
Thanks for responding! I had hoped there was an undocumented way to achieve this, but I'll deal with keeping the multiple sources of truth in lockstep for now.
Chris Moesel (Sep 30 2020 at 18:02):
Well, in your example above, I think you could at least extract action A, right? You said Action A is in common across all of them, and assuming Action A is always at action[0]
you could have:
RuleSet: A
* action[0].title = "Title A"
// ...
then
Instance: PlanDefinition1
InstanceOf: PlanDefinition
* insert A
// ...
Jason Evans (Sep 30 2020 at 18:03):
Agreed, A could be extracted (and probably B given my naive example), but D could not.
Jason Evans (Sep 30 2020 at 18:07):
I think the STU2 release would solve my issue with the soft indexing feature. I'm looking forward to that!
Last updated: Apr 12 2022 at 19:14 UTC