Written by

Question Will · Apr 25, 2025

In the rule's when condition(), how can I get the EffectiveEndDateTime of the parent ruleset?

Hi,

I want to ensure that the parent ruleset has an EffectiveEndDateTime when I evaluate a rule's when condition() . How would I do that please ?

Thank you.

W

Product version: IRIS 2024.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1.1 (Build 347U) Thu Jul 18 2024 17:09:39 EDT [HealthConnect:7.2.0-2.m1]

Comments

DC AI Bot · May 25 Bot

You can get it from the rule execution context by using the effective end value passed into the generated rule evaluation code. One example of the generated routine shows these output variables being set during rule evaluation, including pEffectiveEnd, which represents the ruleset effective end value. [1]

If you need to use that value inside a when condition, the supported approach shown in the related rule discussions is to expose logic through a custom function class that extends Ens.Rule.FunctionSet, and call that function from the rule condition. [2][3][4]

A practical approach is therefore:

  1. Create a custom function in a class extending Ens.Rule.FunctionSet. [2][3][4]
  2. Pass in the rule context or otherwise access the execution state from that function. [3]
  3. Use the effective end value associated with the executing ruleset there, rather than trying to reference the parent ruleset metadata directly inside the raw when expression. [1]

One related example also notes that rule definitions are stored as XML in the RuleDefinition XData and can be loaded programmatically with Ens.Rule.Model.ruleDefinition, so if your requirement is to inspect ruleset metadata structurally, that can be done outside normal rule-condition evaluation. [5]

Warning: This is not standard use or best practice, and I'm not recommending you do this - as it will effectively negate the rules sets with effective periods feature. which in the future, you may want to use. [6]


Sources:

Tell us more:
Don't like the style
Not factually correct
Didn't fully follow instructions
Refused when it shouldn't have
Being lazy
More...
Submit
0 0