public void putMap( MapMap<T, U, V> map ) { for ( Map.Entry<T, Map<U, V>> entry : map.entrySet() ) { this.putEntries( entry.getKey(), entry.getValue() ); } }
? null : valueMap.get( orgUnitId ).get( NON_AOC ); aocValues = new MapMap<>(); aocValues.putEntries( context.getDefaultAttributeCombo().getUid(), nonAocValues ); for ( Map.Entry<String, Map<DimensionalItemObject, Double>> entry : aocValues.entrySet() )
MapMap<Integer, Integer, Integer> lowBoundMapMap = new MapMap<>(); // catOptionComboId, orgUnitId, lowBound MapMap<Integer, Integer, Integer> highBoundMapMap = new MapMap<>(); // catOptionComboId, orgUnitId, highBound int highBound = (int) Math.round( MathUtils.getHighBound( measures.getStandardDeviation(), stdDevFactor, measures.getAverage() ) ); lowBoundMapMap.putEntry( measures.getCategoryOptionComboId(), measures.getOrgUnitId(), lowBound ); highBoundMapMap.putEntry( measures.getCategoryOptionComboId(), measures.getOrgUnitId(), highBound ); Map<Integer, Integer> lowBoundMap = lowBoundMapMap.get( categoryOptionCombo.getId() ); Map<Integer, Integer> highBoundMap = highBoundMapMap.get( categoryOptionCombo.getId() );
nonAggregateDataMap.get( period ), new MapMap<>() ); Sets.union( aggregateSampleMap.keySet(), nonAggregateSampleMap.keySet() ) : defaultOptionComboAsSet; Map<DimensionalItemObject, Double> nonAggregateSampleMapNonAoc = nonAggregateSampleMap.get( NON_AOC ); Map<DimensionalItemObject, Double> nonAggregateValueMap = combine( nonAggregateSampleMap.get( aoc ), nonAggregateSampleMapNonAoc );
MapMap<Class<? extends IdentifiableObject>, String, IdentifiableObject> idMap = new MapMap<>(); idMap.putEntries( e.getKey(), idObjectManager.get( e.getKey(), e.getValue() ).stream() .collect( Collectors.toMap( IdentifiableObject::getUid, o -> o ) ) ); (DataElement) idMap.getValue( DataElement.class, getIdPart( id, 0 ) ), (CategoryOptionCombo) idMap .getValue( CategoryOptionCombo.class, getIdPart( id, 1 ) ) ); (Program) idMap.getValue( Program.class, getIdPart( id, 0 ) ), (DataElement) idMap.getValue( DataElement.class, getIdPart( id, 1 ) ) ); (Program) idMap.getValue( Program.class, getIdPart( id, 0 ) ), (TrackedEntityAttribute) idMap.getValue( TrackedEntityAttribute.class, getIdPart( id, 1 ) ) ); ProgramIndicator pi = (ProgramIndicator) idMap.getValue( ProgramIndicator.class, id );
/** * Evaluates the skip test expression for any sample periods in which * skip test data occurs. For any combination of period and attribute * option combo where the skip test is true, removes all sample data with * that combination of period and attribute option combo. * * @param dataMap all data values (both skip and aggregate). * @param skipTest the skip test expression. * @param constantMap constants to use in skip expression if needed. */ private void applySkipTest( MapMapMap<Period, String, DimensionalItemObject, Double> dataMap, Expression skipTest, Map<String, Double> constantMap ) { if ( skipTest != null && dataMap != null ) { for ( Period period : dataMap.keySet() ) { MapMap<String, DimensionalItemObject, Double> periodData = dataMap.get( period ); for ( String aoc : periodData.keySet() ) { Double testValue = expressionService.getExpressionValue( skipTest, periodData.get( aoc ), constantMap, null, period.getDaysInPeriod() ); if ( testValue != null && !MathUtils.isZero( testValue ) ) { periodData.remove( aoc ); } } } } }
public V getValue( S key1, T key2, U key3 ) { return this.get( key1 ) == null ? null : this.get( key1 ).getValue( key2, key3 ); }
Map<Integer, Boolean> deDataPresent = ouDataPresent.get( deo.getDataElement().getId() );
/** * Returns a mapping of permutations keys (org unit id or null) and mappings * of org unit group and counts, based on the given mapping of dimension option * keys and counts. */ public static Map<String, Map<String, Integer>> getPermutationOrgUnitGroupCountMap( Map<String, Double> orgUnitCountMap ) { MapMap<String, String, Integer> countMap = new MapMap<>(); for ( String key : orgUnitCountMap.keySet() ) { List<String> keys = Lists.newArrayList( key.split( DIMENSION_SEP ) ); // Org unit group always at last index, org unit potentially at first int ougInx = keys.size() - 1; String oug = keys.get( ougInx ); ListUtils.removeAll( keys, ougInx ); String permKey = StringUtils.trimToNull( StringUtils.join( keys, DIMENSION_SEP ) ); Integer count = orgUnitCountMap.get( key ).intValue(); countMap.putEntry( permKey, oug, count ); } return countMap; }
/** * Creates a mapping of permutation keys and mappings of data element operands * and values based on the given mapping of dimension option keys and * aggregated values. The data element dimension will be at index 0. * * @param aggregatedDataMap the aggregated data map. * @return a mapping of permutation keys and mappings of data element operands * and values. */ public static MapMap<String, DimensionalItemObject, Double> getPermutationDimensionalItemValueMap( Map<String, Double> aggregatedDataMap ) { MapMap<String, DimensionalItemObject, Double> permutationMap = new MapMap<>(); for ( String key : aggregatedDataMap.keySet() ) { List<String> keys = Lists.newArrayList( key.split( DIMENSION_SEP ) ); String dimItem = keys.get( DX_INDEX ); keys.remove( DX_INDEX ); BaseDimensionalItemObject dimItemObject = new BaseDimensionalItemObject( dimItem ); String permKey = StringUtils.join( keys, DIMENSION_SEP ); Double value = aggregatedDataMap.get( key ); permutationMap.putEntry( permKey, dimItemObject, value ); } return permutationMap; }