Uploaded image for project: 'Reporting Module'
  1. Reporting Module
  2. REPORT-486

Make evaluationDate available to LogicDataDefinitions

    XMLWordPrintable

    Details

    • Complexity:
      Low

      Description

      LogicDataEvaluator uses the LogicService to evaluate a logic expression, passing it parameters, like so:

      Map<Integer, Result> m = Context.getLogicService().eval(
          cohort, 
          def.getLogicQuery(), 
          context.getParameterValues());
      

      The Logic rule has no access to the evaluationDate from the reporting context, and therefore cannot be time-sensitive. It does, however, have access to the LogicContext indexDate property. This can be set by a LogicCriteria; otherwise it is essentially a new Date(). I propose modifying this by changing the second parameter to a LogicCriteria object and using the asOf() method, like so:

      Map<Integer, Result> m = Context.getLogicService().eval(
          cohort, 
          new LogicCriteria(def.getLogicQuery()).asOf(context.getEvaluationDate()), 
          context.getParameterValues());
      

        Attachments

          Activity

            People

            Assignee:
            jeremy Jeremy Keiper
            Reporter:
            jeremy Jeremy Keiper
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: