code: public Expression optimizeDateRangeInQuery(Expression where, AliasedQuerySource aqs) {
          if (aqs.getExpression() instanceof Retrieve) {
              Retrieve retrieve = (Retrieve) aqs.getExpression();
              String alias = aqs.getAlias();
              if ((where instanceof IncludedIn || where instanceof In) && attemptDateRangeOptimization((BinaryExpression) where, retrieve, alias)) {
                  where = null;
              }
              else if (where instanceof And && attemptDateRangeOptimization((And) where, retrieve, alias)) {
                  // Now optimize out the trues from the Ands
                  where = consolidateAnd((And) where);
              }
          }
          return where;
      }
docs: Some systems may wish to optimize performance by restricting retrieves with available date ranges.  Specifying
  date ranges in a retrieve was removed from the CQL grammar, but it is still possible to extract date ranges from
  the where clause and put them in the Retrieve in ELM.  The <code>optimizeDateRangeInQuery</code> method
  attempts to do this automatically.  If optimization is possible, it will remove the corresponding "during" from
  the where clause and insert the date range into the Retrieve.
  
  @param aqs   the AliasedQuerySource containing the ClinicalRequest to possibly refactor a date range into.
  @param where the Where clause to search for potential date range optimizations
  @return the where clause with optimized "durings" removed, or <code>null</code> if there is no longer a Where
  clause after optimization.