Tabnine Logo
Expression.getExpression
Code IndexAdd Tabnine to your IDE (free)

How to use
getExpression
method
in
org.hisp.dhis.expression.Expression

Best Java code snippets using org.hisp.dhis.expression.Expression.getExpression (Showing top 9 results out of 315)

origin: dhis2/dhis2-core

@Override
public Set<DataElement> getDataElements( ValidationRule validationRule )
{
  Set<DataElement> elements = new HashSet<>();
  elements.addAll( expressionService.getDataElementsInExpression( validationRule.getLeftSide().getExpression() ) );
  elements.addAll( expressionService.getDataElementsInExpression( validationRule.getRightSide().getExpression() ) );
  return elements;
}
origin: dhis2/dhis2-core

/**
 * Gets all DimensionalItemObjects from the expressions and skip test.
 *
 * @param expressions set of expressions.
 * @param skipTest the skip test expression (if any).
 * @return set of all dimensional item objects found in all expressions.
 */
private Set<DimensionalItemObject> getDimensionItems( Set<String> expressions, Expression skipTest )
{
  Set<DimensionalItemObject> operands = new HashSet<>();
  for ( String expression : expressions )
  {
    operands.addAll( expressionService.getDimensionalItemObjectsInExpression( expression ) );
  }
  if ( skipTest != null )
  {
    operands.addAll( expressionService.getDimensionalItemObjectsInExpression( skipTest.getExpression() ) );
  }
  return operands;
}
origin: dhis2/dhis2-core

@Override
public Double getExpressionValue( Expression expression, Map<? extends DimensionalItemObject, Double> valueMap,
  Map<String, Double> constantMap, Map<String, Integer> orgUnitCountMap, Integer days,
  ListMap<String, Double> aggregateMap )
{
  String expressionString = generateExpression( expression.getExpression(),
    valueMap, constantMap, orgUnitCountMap, days, expression.getMissingValueStrategy(),
    aggregateMap );
  return expressionString != null ? calculateExpression( expressionString ) : null;
}
origin: dhis2/dhis2-core

@Override
public Collection<ValidationRule> getValidationRulesForDataSet( DataSet dataSet )
{
  Set<String> elementsAndOptionCombos = new HashSet<>();
  for ( DataSetElement dataSetElement : dataSet.getDataSetElements() )
  {
    DataElement dataElement = dataSetElement.getDataElement();
    elementsAndOptionCombos.add( dataElement.getUid() );
    CategoryCombo catCombo = dataSetElement.hasCategoryCombo()
      ? dataSetElement.getCategoryCombo()
      : dataElement.getCategoryCombo();
    for ( CategoryOptionCombo optionCombo : catCombo.getOptionCombos() )
    {
      elementsAndOptionCombos.add( dataElement.getUid() + Expression.SEPARATOR + optionCombo.getUid() );
    }
  }
  Set<ValidationRule> rulesForDataSet = new HashSet<>();
  for ( ValidationRule rule : getAllFormValidationRules() )
  {
    if ( !Sets.intersection( expressionService.getElementsAndOptionCombosInExpression( rule.getLeftSide().getExpression() ), elementsAndOptionCombos ).isEmpty() ||
      !Sets.intersection( expressionService.getElementsAndOptionCombosInExpression( rule.getRightSide().getExpression() ), elementsAndOptionCombos ).isEmpty() )
    {
      rulesForDataSet.add( rule );
    }
  }
  return rulesForDataSet;
}
origin: dhis2/dhis2-core

@Override
public SortedMap<ValidationRule, String> getInvalidValidationRuleLeftSideExpressions()
{
  SortedMap<ValidationRule, String> invalids = new TreeMap<>();
  I18n i18n = i18nManager.getI18n();
  for ( ValidationRule rule : validationRuleService.getAllValidationRules() )
  {
    ExpressionValidationOutcome result = expressionService.expressionIsValid( rule.getLeftSide().getExpression() );
    if ( !result.isValid() )
    {
      invalids.put( rule, i18n.getString(result.getKey()) );
    }
  }
  return invalids;
}
origin: dhis2/dhis2-core

private void upgradeExpressions()
{
  Collection<Expression> expressions = expressionService.getAllExpressions();
  for ( Expression expression : expressions )
  {
    String expr = upgradeExpression( expression.getExpression() );
    if ( expr != null )
    {
      expression.setExpression( expr );
      expressionService.updateExpression( expression );
    }
  }
}
origin: dhis2/dhis2-core

@Override
public SortedMap<ValidationRule, String> getInvalidValidationRuleRightSideExpressions()
{
  SortedMap<ValidationRule, String> invalids = new TreeMap<>();
  I18n i18n = i18nManager.getI18n();
  for ( ValidationRule rule : validationRuleService.getAllValidationRules() )
  {
    ExpressionValidationOutcome result = expressionService.expressionIsValid( rule.getRightSide().getExpression() );
    if ( !result.isValid() )
    {
      invalids.put( rule, i18n.getString(result.getKey()) );
    }
  }
  return invalids;
}
origin: dhis2/dhis2-core

  .getDimensionalItemIdsInExpression( rule.getLeftSide().getExpression() );
dimensionItemIdentifiers.putValues(
  expressionService.getDimensionalItemIdsInExpression( rule.getRightSide().getExpression() ) );
origin: dhis2/dhis2-core

expressionService.getAggregatesAndNonAggregatesInExpression( generator.getExpression(), aggregates, nonAggregates );
Map<String, Double> constantMap = constantService.getConstantMap();
Set<Period> outputPeriods = getPeriodsBetweenDates( predictor.getPeriodType(), startDate, endDate );
org.hisp.dhis.expressionExpressiongetExpression

Popular methods of Expression

  • <init>
    Constructor with all the parameters.
  • setExpression
  • equals
  • getMissingValueStrategy
  • setDescription
  • getDescription
  • getId
  • getSlidingWindow
  • matchExpression
  • setMissingValueStrategy

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • JTextField (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • IsNull (org.hamcrest.core)
    Is the value null?
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now