@Override public DataValue getDataValue( DataElement dataElement, Period period, OrganisationUnit source, CategoryOptionCombo categoryOptionCombo ) { CategoryOptionCombo defaultOptionCombo = categoryService.getDefaultCategoryOptionCombo(); return dataValueStore.getDataValue( dataElement, period, source, categoryOptionCombo, defaultOptionCombo ); }
attrOptCombo = categoryService.getCategoryOptionCombo( categoryCombo, categoryOptions ); attrOptCombo = categoryService.getCategoryOptionCombo( attributeOptionCombo ); attrOptCombo = categoryService.getDefaultCategoryOptionCombo();
categoryService.addCategoryOptionCombo( optionCombo ); categoryService.deleteCategoryOptionComboNoRollback( optionCombo ); categoryService.deleteCategoryOptionCombo( optionCombo ); categoryService.updateCategoryCombo( categoryCombo );
boolean canSeeAllDimensions = CollectionUtils.isEmpty( categoryService.getCoDimensionConstraints( userCredentials ) ) && CollectionUtils.isEmpty( categoryService.getCogDimensionConstraints( userCredentials ) ); ( aclService.canRead( user, cogs ) && !CollectionUtils.isEmpty( categoryService.getCategoryOptionGroups( cogs ) ) );
private CategoryOptionCombo getAttributeOptionCombo( String key, CategoryCombo categoryCombo, Set<CategoryOption> categoryOptions ) { return attributeOptionComboCache.get( key, () -> categoryService.getCategoryOptionCombo( categoryCombo, categoryOptions ) ); }
.withPersistResults( parameters.isPersistResults() ) .withAttributeCombo( parameters.getAttributeOptionCombo() ) .withDefaultAttributeCombo( categoryService.getDefaultCategoryOptionCombo() ) .withMaxResults( parameters.getMaxResults() ); categoryService.getCoDimensionConstraints( currentUser.getUserCredentials() ) ) .withCogDimensionConstraints( categoryService.getCogDimensionConstraints( currentUser.getUserCredentials() ) );
categoryService.addCategoryOptionCombo( optionCombo ); categoryService.deleteCategoryOptionCombo( optionCombo ); categoryCombo.getOptionCombos().remove( optionCombo ); categoryService.updateCategoryCombo( categoryCombo );
private CategoryOptionCombo getAttributeOptionComboInternal( String cc, String cp, boolean skipFallback ) { Set<String> opts = TextUtils.splitToArray( cp, TextUtils.SEMICOLON ); // --------------------------------------------------------------------- // Attribute category combo validation // --------------------------------------------------------------------- if ( (cc == null && opts != null || (cc != null && opts == null)) ) { throw new IllegalQueryException( "Both or none of category combination and category options must be present" ); } CategoryCombo categoryCombo = null; if ( cc != null && (categoryCombo = idObjectManager.get( CategoryCombo.class, cc )) == null ) { throw new IllegalQueryException( "Illegal category combo identifier: " + cc ); } if ( categoryCombo == null && opts == null ) { if ( skipFallback ) { return null; } categoryCombo = categoryService.getDefaultCategoryCombo(); } return getAttributeOptionCombo( categoryCombo, opts, null, IdScheme.UID ); }
@Override public List<CategoryCombo> getInvalidCategoryCombos() { List<CategoryCombo> categoryCombos = categoryService.getAllCategoryCombos(); return categoryCombos.stream().filter( c -> !c.isValid() ).collect( Collectors.toList() ); }
@Override public void deleteCategoryOption( CategoryOption categoryOption ) { Iterator<CategoryOptionCombo> iterator = categoryOption.getCategoryOptionCombos().iterator(); while ( iterator.hasNext() ) { CategoryOptionCombo optionCombo = iterator.next(); iterator.remove(); categoryService.deleteCategoryOptionCombo( optionCombo ); } }
@Override public Set<CategoryOptionCombo> getOptionCombosInExpression( String expression ) { return getIdObjectsInExpression( CATEGORY_OPTION_COMBO_OPERAND_PATTERN, expression, ( m ) -> categoryService.getCategoryOptionCombo( m.group( GROUP_CATEGORORY_OPTION_COMBO ) ) ); }
/** * @param uniqueCharacter A unique character to identify the object. * @param periodType The period type. * @param categoryCombo The category combo. */ public static DataSet createDataSet( char uniqueCharacter, PeriodType periodType, CategoryCombo categoryCombo ) { DataSet dataSet = new DataSet(); dataSet.setAutoFields(); dataSet.setUid( BASE_DS_UID + uniqueCharacter ); dataSet.setName( "DataSet" + uniqueCharacter ); dataSet.setShortName( "DataSetShort" + uniqueCharacter ); dataSet.setCode( "DataSetCode" + uniqueCharacter ); dataSet.setPeriodType( periodType ); if ( categoryCombo != null ) { dataSet.setCategoryCombo( categoryCombo ); } else if ( categoryService != null ) { dataSet.setCategoryCombo( categoryService.getDefaultCategoryCombo() ); } return dataSet; }
@Override public void addAndPruneAllOptionCombos() { List<CategoryCombo> categoryCombos = categoryService.getAllCategoryCombos(); for ( CategoryCombo categoryCombo : categoryCombos ) { addAndPruneOptionCombos( categoryCombo ); } } }
@Override public void deleteCategoryCombo( CategoryCombo categoryCombo ) { Iterator<CategoryOptionCombo> iterator = categoryCombo.getOptionCombos().iterator(); while ( iterator.hasNext() ) { CategoryOptionCombo optionCombo = iterator.next(); iterator.remove(); categoryService.deleteCategoryOptionCombo( optionCombo ); } } }
private void deregisterCompleteDataSet( DataSet dataSet, Period period, OrganisationUnit organisationUnit ) { CategoryOptionCombo optionCombo = dataElementCategoryService .getDefaultCategoryOptionCombo(); // TODO CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period, organisationUnit, optionCombo ); if ( registration != null ) { registrationService.deleteCompleteDataSetRegistration( registration ); } } }
private void saveValue( OrganisationUnit unit, Period period, org.hisp.dhis.dataelement.DataElement dataElement, DataValue dv ) { String value = dv.getValue().trim(); CategoryOptionCombo catOptCombo = categoryService.getCategoryOptionCombo( dv .getCategoryOptComboID() ); org.hisp.dhis.datavalue.DataValue dataValue = dataValueService.getDataValue( dataElement, period, unit, catOptCombo ); if ( dataValue == null ) { dataValue = new org.hisp.dhis.datavalue.DataValue( dataElement, period, unit, catOptCombo, categoryService.getDefaultCategoryOptionCombo(), value, "", new Date(), "" ); dataValueService.addDataValue( dataValue ); } else { dataValue.setValue( value ); dataValue.setLastUpdated( new Date() ); dataValueService.updateDataValue( dataValue ); } }
private CategoryOptionCombo getAttributeOptionCombo( int id ) { CategoryOptionCombo aoc = context.getAocIdMap().get( id ); if ( aoc == null ) { log.trace("DataValidationTask calling getCategoryOptionCombo( id " + id + " )" ); aoc = categoryService.getCategoryOptionCombo( id ); log.trace("DataValidationTask called getCategoryOptionCombo( id " + id + ")" ); addToAocCache( aoc ); } return aoc; }
program.setCategoryCombo( categoryService.getDefaultCategoryCombo() );
@Override @Transactional public void generateDataSetOrganisationUnitCategoryTable() { resourceTableStore.generateResourceTable( new DataSetOrganisationUnitCategoryResourceTable( idObjectManager.getAllNoAcl( DataSet.class ), categoryService.getDefaultCategoryOptionCombo() ) ); }
.getCategoryOptionCombo( code.getOptionId() ); dataElementCategoryService.getDefaultCategoryOptionCombo() ); dataElementCategoryService.getDefaultCategoryOptionCombo() ); targetDataValue.setSource( orgunit ); targetDataValue.setDataElement( targetDataElement );