Search in sources :

Example 16 with IllegalQueryException

use of org.hisp.dhis.common.IllegalQueryException in project dhis2-core by dhis2.

the class OrgUnitSplitServiceTest method testTargetOrgUnitNotFound.

@Test
void testTargetOrgUnitNotFound() {
    OrgUnitSplitQuery query = new OrgUnitSplitQuery();
    query.setSource(BASE_OU_UID + 'A');
    query.setTargets(Lists.newArrayList(BASE_OU_UID + 'B', BASE_OU_UID + 'X'));
    query.setPrimaryTarget(BASE_OU_UID + 'B');
    IllegalQueryException ex = assertThrows(IllegalQueryException.class, () -> service.getFromQuery(query));
    assertEquals(ErrorCode.E1515, ex.getErrorCode());
}
Also used : IllegalQueryException(org.hisp.dhis.common.IllegalQueryException) Test(org.junit.jupiter.api.Test) DhisSpringTest(org.hisp.dhis.DhisSpringTest)

Example 17 with IllegalQueryException

use of org.hisp.dhis.common.IllegalQueryException in project dhis2-core by dhis2.

the class SqlViewServiceTest method testValidate_InvalidVarName.

@Test
void testValidate_InvalidVarName() {
    SqlView sqlView = getSqlView("select * from dataelement where valueType = '${typö}' and aggregationtype = '${aggregationType}'");
    IllegalQueryException ex = assertThrows(IllegalQueryException.class, () -> sqlViewService.validateSqlView(sqlView, null, null));
    assertEquals(ErrorCode.E4313, ex.getErrorCode());
    assertEquals("SQL query contains variable names that are invalid: `[typö]`", ex.getMessage());
}
Also used : IllegalQueryException(org.hisp.dhis.common.IllegalQueryException) Test(org.junit.jupiter.api.Test) DhisSpringTest(org.hisp.dhis.DhisSpringTest)

Example 18 with IllegalQueryException

use of org.hisp.dhis.common.IllegalQueryException in project dhis2-core by dhis2.

the class DefaultTrackedEntityInstanceService method validate.

@Override
public void validate(TrackedEntityInstanceQueryParams params) throws IllegalQueryException {
    String violation = null;
    if (params == null) {
        throw new IllegalQueryException("Params cannot be null");
    }
    User user = params.getUser();
    if (!params.hasTrackedEntityInstances() && !params.hasOrganisationUnits() && !(params.isOrganisationUnitMode(ALL) || params.isOrganisationUnitMode(ACCESSIBLE) || params.isOrganisationUnitMode(CAPTURE))) {
        violation = "At least one organisation unit must be specified";
    }
    if (params.isOrganisationUnitMode(ACCESSIBLE) && (user == null || !user.hasDataViewOrganisationUnitWithFallback())) {
        violation = "Current user must be associated with at least one organisation unit when selection mode is ACCESSIBLE";
    }
    if (params.isOrganisationUnitMode(CAPTURE) && (user == null || !user.hasOrganisationUnit())) {
        violation = "Current user must be associated with at least one organisation unit with write access when selection mode is CAPTURE";
    }
    if (params.hasProgram() && params.hasTrackedEntityType()) {
        violation = "Program and tracked entity cannot be specified simultaneously";
    }
    if (!params.hasTrackedEntityInstances() && !params.hasProgram() && !params.hasTrackedEntityType()) {
        violation = "Either Program or Tracked entity type should be specified";
    }
    if (params.hasProgramStatus() && !params.hasProgram()) {
        violation = "Program must be defined when program status is defined";
    }
    if (params.hasFollowUp() && !params.hasProgram()) {
        violation = "Program must be defined when follow up status is defined";
    }
    if (params.hasProgramEnrollmentStartDate() && !params.hasProgram()) {
        violation = "Program must be defined when program enrollment start date is specified";
    }
    if (params.hasProgramEnrollmentEndDate() && !params.hasProgram()) {
        violation = "Program must be defined when program enrollment end date is specified";
    }
    if (params.hasProgramIncidentStartDate() && !params.hasProgram()) {
        violation = "Program must be defined when program incident start date is specified";
    }
    if (params.hasProgramIncidentEndDate() && !params.hasProgram()) {
        violation = "Program must be defined when program incident end date is specified";
    }
    if (params.hasEventStatus() && (!params.hasEventStartDate() || !params.hasEventEndDate())) {
        violation = "Event start and end date must be specified when event status is specified";
    }
    if (params.getAssignedUserSelectionMode() != null && params.hasAssignedUsers() && !params.getAssignedUserSelectionMode().equals(AssignedUserSelectionMode.PROVIDED)) {
        violation = "Assigned User uid(s) cannot be specified if selectionMode is not PROVIDED";
    }
    if (params.isOrQuery() && params.hasFilters()) {
        violation = "Query cannot be specified together with filters";
    }
    if (!params.getDuplicateAttributes().isEmpty()) {
        violation = "Attributes cannot be specified more than once: " + params.getDuplicateAttributes();
    }
    if (!params.getDuplicateFilters().isEmpty()) {
        violation = "Filters cannot be specified more than once: " + params.getDuplicateFilters();
    }
    if (params.hasLastUpdatedDuration() && (params.hasLastUpdatedStartDate() || params.hasLastUpdatedEndDate())) {
        violation = "Last updated from and/or to and last updated duration cannot be specified simultaneously";
    }
    if (params.hasLastUpdatedDuration() && DateUtils.getDuration(params.getLastUpdatedDuration()) == null) {
        violation = "Duration is not valid: " + params.getLastUpdatedDuration();
    }
    if (violation != null) {
        log.warn("Validation failed: " + violation);
        throw new IllegalQueryException(violation);
    }
}
Also used : User(org.hisp.dhis.user.User) IllegalQueryException(org.hisp.dhis.common.IllegalQueryException)

Example 19 with IllegalQueryException

use of org.hisp.dhis.common.IllegalQueryException in project dhis2-core by dhis2.

the class DefaultTrackedEntityInstanceService method validateSearchScope.

@Override
@Transactional(readOnly = true)
public void validateSearchScope(TrackedEntityInstanceQueryParams params, boolean isGridSearch) throws IllegalQueryException {
    if (params == null) {
        throw new IllegalQueryException("Params cannot be null");
    }
    User user = currentUserService.getCurrentUser();
    if (user == null) {
        throw new IllegalQueryException("User cannot be null");
    }
    if (user.getOrganisationUnits().isEmpty()) {
        throw new IllegalQueryException("User need to be associated with at least one organisation unit.");
    }
    if (!params.hasProgram() && !params.hasTrackedEntityType() && params.hasAttributesOrFilters() && !params.hasOrganisationUnits()) {
        List<String> uniqeAttributeIds = attributeService.getAllSystemWideUniqueTrackedEntityAttributes().stream().map(TrackedEntityAttribute::getUid).collect(Collectors.toList());
        for (String att : params.getAttributeAndFilterIds()) {
            if (!uniqeAttributeIds.contains(att)) {
                throw new IllegalQueryException("Either a program or tracked entity type must be specified");
            }
        }
    }
    if (!isLocalSearch(params, user)) {
        // no limit
        int maxTeiLimit = 0;
        if (params.hasQuery()) {
            throw new IllegalQueryException("Query cannot be used during global search");
        }
        if (params.hasProgram() && params.hasTrackedEntityType()) {
            throw new IllegalQueryException("Program and tracked entity cannot be specified simultaneously");
        }
        if (params.hasAttributesOrFilters()) {
            List<String> searchableAttributeIds = new ArrayList<>();
            if (params.hasProgram()) {
                searchableAttributeIds.addAll(params.getProgram().getSearchableAttributeIds());
            }
            if (params.hasTrackedEntityType()) {
                searchableAttributeIds.addAll(params.getTrackedEntityType().getSearchableAttributeIds());
            }
            if (!params.hasProgram() && !params.hasTrackedEntityType()) {
                searchableAttributeIds.addAll(attributeService.getAllSystemWideUniqueTrackedEntityAttributes().stream().map(TrackedEntityAttribute::getUid).collect(Collectors.toList()));
            }
            List<String> violatingAttributes = new ArrayList<>();
            for (String attributeId : params.getAttributeAndFilterIds()) {
                if (!searchableAttributeIds.contains(attributeId)) {
                    violatingAttributes.add(attributeId);
                }
            }
            if (!violatingAttributes.isEmpty()) {
                throw new IllegalQueryException("Non-searchable attribute(s) can not be used during global search:  " + violatingAttributes.toString());
            }
        }
        if (params.hasTrackedEntityType()) {
            maxTeiLimit = params.getTrackedEntityType().getMaxTeiCountToReturn();
            if (!params.hasTrackedEntityInstances() && isTeTypeMinAttributesViolated(params)) {
                throw new IllegalQueryException("At least " + params.getTrackedEntityType().getMinAttributesRequiredToSearch() + " attributes should be mentioned in the search criteria.");
            }
        }
        if (params.hasProgram()) {
            maxTeiLimit = params.getProgram().getMaxTeiCountToReturn();
            if (!params.hasTrackedEntityInstances() && isProgramMinAttributesViolated(params)) {
                throw new IllegalQueryException("At least " + params.getProgram().getMinAttributesRequiredToSearch() + " attributes should be mentioned in the search criteria.");
            }
        }
        if (maxTeiLimit > 0 && params.isPaging() && params.getOffset() > 0 && (params.getOffset() + params.getPageSizeWithDefault()) > maxTeiLimit) {
            throw new IllegalQueryException("maxteicountreached");
        }
        params.setMaxTeiLimit(maxTeiLimit);
    }
}
Also used : User(org.hisp.dhis.user.User) ArrayList(java.util.ArrayList) IllegalQueryException(org.hisp.dhis.common.IllegalQueryException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 20 with IllegalQueryException

use of org.hisp.dhis.common.IllegalQueryException in project dhis2-core by dhis2.

the class AbstractEventService method getEvent.

@Transactional(readOnly = true)
@Override
public Event getEvent(ProgramStageInstance programStageInstance, boolean isSynchronizationQuery, boolean skipOwnershipCheck) {
    if (programStageInstance == null) {
        return null;
    }
    Event event = new Event();
    event.setEvent(programStageInstance.getUid());
    if (programStageInstance.getProgramInstance().getEntityInstance() != null) {
        event.setTrackedEntityInstance(programStageInstance.getProgramInstance().getEntityInstance().getUid());
    }
    event.setFollowup(programStageInstance.getProgramInstance().getFollowup());
    event.setEnrollmentStatus(EnrollmentStatus.fromProgramStatus(programStageInstance.getProgramInstance().getStatus()));
    event.setStatus(programStageInstance.getStatus());
    event.setEventDate(DateUtils.getIso8601NoTz(programStageInstance.getExecutionDate()));
    event.setDueDate(DateUtils.getIso8601NoTz(programStageInstance.getDueDate()));
    event.setStoredBy(programStageInstance.getStoredBy());
    event.setCompletedBy(programStageInstance.getCompletedBy());
    event.setCompletedDate(DateUtils.getIso8601NoTz(programStageInstance.getCompletedDate()));
    event.setCreated(DateUtils.getIso8601NoTz(programStageInstance.getCreated()));
    event.setCreatedByUserInfo(programStageInstance.getCreatedByUserInfo());
    event.setLastUpdatedByUserInfo(programStageInstance.getLastUpdatedByUserInfo());
    event.setCreatedAtClient(DateUtils.getIso8601NoTz(programStageInstance.getCreatedAtClient()));
    event.setLastUpdated(DateUtils.getIso8601NoTz(programStageInstance.getLastUpdated()));
    event.setLastUpdatedAtClient(DateUtils.getIso8601NoTz(programStageInstance.getLastUpdatedAtClient()));
    event.setGeometry(programStageInstance.getGeometry());
    event.setDeleted(programStageInstance.isDeleted());
    if (programStageInstance.getAssignedUser() != null) {
        event.setAssignedUser(programStageInstance.getAssignedUser().getUid());
        event.setAssignedUserUsername(programStageInstance.getAssignedUser().getUsername());
        event.setAssignedUserDisplayName(programStageInstance.getAssignedUser().getName());
    }
    User user = currentUserService.getCurrentUser();
    OrganisationUnit ou = programStageInstance.getOrganisationUnit();
    List<String> errors = trackerAccessManager.canRead(user, programStageInstance, skipOwnershipCheck);
    if (!errors.isEmpty()) {
        throw new IllegalQueryException(errors.toString());
    }
    if (ou != null) {
        event.setOrgUnit(ou.getUid());
        event.setOrgUnitName(ou.getName());
    }
    Program program = programStageInstance.getProgramInstance().getProgram();
    event.setProgram(program.getUid());
    event.setEnrollment(programStageInstance.getProgramInstance().getUid());
    event.setProgramStage(programStageInstance.getProgramStage().getUid());
    CategoryOptionCombo attributeOptionCombo = programStageInstance.getAttributeOptionCombo();
    if (attributeOptionCombo != null) {
        event.setAttributeOptionCombo(attributeOptionCombo.getUid());
        event.setAttributeCategoryOptions(String.join(";", attributeOptionCombo.getCategoryOptions().stream().map(CategoryOption::getUid).collect(Collectors.toList())));
    }
    if (programStageInstance.getProgramInstance().getEntityInstance() != null) {
        event.setTrackedEntityInstance(programStageInstance.getProgramInstance().getEntityInstance().getUid());
    }
    Collection<EventDataValue> dataValues;
    if (!isSynchronizationQuery) {
        dataValues = programStageInstance.getEventDataValues();
    } else {
        Set<String> dataElementsToSync = programStageInstance.getProgramStage().getProgramStageDataElements().stream().filter(psde -> !psde.getSkipSynchronization()).map(psde -> psde.getDataElement().getUid()).collect(Collectors.toSet());
        dataValues = programStageInstance.getEventDataValues().stream().filter(dv -> dataElementsToSync.contains(dv.getDataElement())).collect(Collectors.toSet());
    }
    for (EventDataValue dataValue : dataValues) {
        if (getDataElement(user.getUid(), dataValue.getDataElement())) {
            DataValue value = new DataValue();
            value.setCreated(DateUtils.getIso8601NoTz(dataValue.getCreated()));
            value.setCreatedByUserInfo(dataValue.getCreatedByUserInfo());
            value.setLastUpdated(DateUtils.getIso8601NoTz(dataValue.getLastUpdated()));
            value.setLastUpdatedByUserInfo(dataValue.getLastUpdatedByUserInfo());
            value.setDataElement(dataValue.getDataElement());
            value.setValue(dataValue.getValue());
            value.setProvidedElsewhere(dataValue.getProvidedElsewhere());
            value.setStoredBy(dataValue.getStoredBy());
            event.getDataValues().add(value);
        } else {
            log.info("Can not find a Data Element having UID [" + dataValue.getDataElement() + "]");
        }
    }
    event.getNotes().addAll(NoteHelper.convertNotes(programStageInstance.getComments()));
    event.setRelationships(programStageInstance.getRelationshipItems().stream().filter(Objects::nonNull).map((r) -> relationshipService.getRelationship(r.getRelationship(), RelationshipParams.FALSE, user)).collect(Collectors.toSet()));
    return event;
}
Also used : ListGrid(org.hisp.dhis.system.grid.ListGrid) Arrays(java.util.Arrays) CategoryService(org.hisp.dhis.category.CategoryService) FIRST_PAGE(org.hisp.dhis.common.SlimPager.FIRST_PAGE) CategoryOption(org.hisp.dhis.category.CategoryOption) ValidationUtils(org.hisp.dhis.system.util.ValidationUtils) EventRow(org.hisp.dhis.dxf2.events.report.EventRow) ProgramStageDataElement(org.hisp.dhis.program.ProgramStageDataElement) StringUtils(org.apache.commons.lang3.StringUtils) EVENT_CREATED_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_CREATED_ID) EVENT_EXECUTION_DATE_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_EXECUTION_DATE_ID) ImportSummary(org.hisp.dhis.dxf2.importsummary.ImportSummary) EnrollmentStatus(org.hisp.dhis.dxf2.events.enrollment.EnrollmentStatus) EventSyncService(org.hisp.dhis.program.EventSyncService) FileResourceService(org.hisp.dhis.fileresource.FileResourceService) Map(java.util.Map) EventDataValue(org.hisp.dhis.eventdatavalue.EventDataValue) JobConfiguration(org.hisp.dhis.scheduling.JobConfiguration) EVENT_STATUS_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_STATUS_ID) OrganisationUnitSelectionMode(org.hisp.dhis.common.OrganisationUnitSelectionMode) TrackedEntityInstance(org.hisp.dhis.trackedentity.TrackedEntityInstance) DateUtils.getMediumDateString(org.hisp.dhis.util.DateUtils.getMediumDateString) Set(java.util.Set) SchemaService(org.hisp.dhis.schema.SchemaService) TrackerOwnershipManager(org.hisp.dhis.trackedentity.TrackerOwnershipManager) Slf4j(lombok.extern.slf4j.Slf4j) CategoryOptionCombo(org.hisp.dhis.category.CategoryOptionCombo) TrackedEntityComment(org.hisp.dhis.trackedentitycomment.TrackedEntityComment) ProgramType(org.hisp.dhis.program.ProgramType) ProgramInstanceService(org.hisp.dhis.program.ProgramInstanceService) TrackedEntityCommentService(org.hisp.dhis.trackedentitycomment.TrackedEntityCommentService) EVENT_STORED_BY_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_STORED_BY_ID) QueryItem(org.hisp.dhis.common.QueryItem) ProgramStageInstance(org.hisp.dhis.program.ProgramStageInstance) IllegalQueryException(org.hisp.dhis.common.IllegalQueryException) EVENT_GEOMETRY(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_GEOMETRY) ArrayList(java.util.ArrayList) RelationshipParams(org.hisp.dhis.dxf2.events.RelationshipParams) Lists(com.google.common.collect.Lists) IdentifiableObjectManager(org.hisp.dhis.common.IdentifiableObjectManager) SlimPager(org.hisp.dhis.common.SlimPager) ImportConflicts(org.hisp.dhis.dxf2.importsummary.ImportConflicts) EventManager(org.hisp.dhis.dxf2.events.importer.EventManager) EVENT_ENROLLMENT_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_ENROLLMENT_ID) IdSchemes(org.hisp.dhis.common.IdSchemes) RelationshipService(org.hisp.dhis.dxf2.events.relationship.RelationshipService) DEFAULT_PAGE_SIZE(org.hisp.dhis.common.Pager.DEFAULT_PAGE_SIZE) ImportOptions(org.hisp.dhis.dxf2.common.ImportOptions) ImportSummaries(org.hisp.dhis.dxf2.importsummary.ImportSummaries) TrackedEntityInstanceService(org.hisp.dhis.trackedentity.TrackedEntityInstanceService) DebugUtils(org.hisp.dhis.commons.util.DebugUtils) ERROR(org.hisp.dhis.system.notification.NotificationLevel.ERROR) CodeGenerator(org.hisp.dhis.common.CodeGenerator) ProgramService(org.hisp.dhis.program.ProgramService) DateUtils(org.hisp.dhis.util.DateUtils) EVENT_PROGRAM_STAGE_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_PROGRAM_STAGE_ID) PAGER_META_KEY(org.hisp.dhis.dxf2.events.event.EventSearchParams.PAGER_META_KEY) Authorities(org.hisp.dhis.security.Authorities) Date(java.util.Date) WorkContextLoader(org.hisp.dhis.dxf2.events.importer.context.WorkContextLoader) OrganisationUnitService(org.hisp.dhis.organisationunit.OrganisationUnitService) EVENT_LAST_UPDATED_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_LAST_UPDATED_ID) ProgramStageInstanceService(org.hisp.dhis.program.ProgramStageInstanceService) NoteHelper(org.hisp.dhis.dxf2.events.NoteHelper) EVENT_PROGRAM_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_PROGRAM_ID) EVENT_DUE_DATE_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_DUE_DATE_ID) UserService(org.hisp.dhis.user.UserService) Collection(java.util.Collection) EventStatus(org.hisp.dhis.event.EventStatus) Collectors(java.util.stream.Collectors) QueryService(org.hisp.dhis.query.QueryService) EventRows(org.hisp.dhis.dxf2.events.report.EventRows) Objects(java.util.Objects) List(java.util.List) CollectionUtils.isNotEmpty(org.apache.commons.collections4.CollectionUtils.isNotEmpty) EventImporter(org.hisp.dhis.dxf2.events.importer.EventImporter) TrackerAccessManager(org.hisp.dhis.trackedentity.TrackerAccessManager) Cache(org.hisp.dhis.cache.Cache) EVENT_ORG_UNIT_NAME(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_ORG_UNIT_NAME) EVENT_CREATED_BY_USER_INFO_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_CREATED_BY_USER_INFO_ID) EVENT_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_ID) HashMap(java.util.HashMap) ObjectUtils.defaultIfNull(org.apache.commons.lang3.ObjectUtils.defaultIfNull) Program(org.hisp.dhis.program.Program) HashSet(java.util.HashSet) DataElement(org.hisp.dhis.dataelement.DataElement) WorkContext(org.hisp.dhis.dxf2.events.importer.context.WorkContext) Notifier(org.hisp.dhis.system.notification.Notifier) DbmsManager(org.hisp.dhis.dbms.DbmsManager) GridHeader(org.hisp.dhis.common.GridHeader) User(org.hisp.dhis.user.User) ImportStatus(org.hisp.dhis.dxf2.importsummary.ImportStatus) EVENT_ORG_UNIT_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_ORG_UNIT_ID) EVENT_LAST_UPDATED_BY_USER_INFO_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_LAST_UPDATED_BY_USER_INFO_ID) Collections.emptyMap(java.util.Collections.emptyMap) EVENT_DELETED(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_DELETED) Pager(org.hisp.dhis.common.Pager) Grid(org.hisp.dhis.common.Grid) OrganisationUnit(org.hisp.dhis.organisationunit.OrganisationUnit) NotificationLevel(org.hisp.dhis.system.notification.NotificationLevel) EVENT_ATTRIBUTE_OPTION_COMBO_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_ATTRIBUTE_OPTION_COMBO_ID) CurrentUserService(org.hisp.dhis.user.CurrentUserService) CachingMap(org.hisp.dhis.commons.collection.CachingMap) Collections(java.util.Collections) EVENT_COMPLETED_BY_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_COMPLETED_BY_ID) EVENT_COMPLETED_DATE_ID(org.hisp.dhis.dxf2.events.event.EventSearchParams.EVENT_COMPLETED_DATE_ID) Transactional(org.springframework.transaction.annotation.Transactional) OrganisationUnit(org.hisp.dhis.organisationunit.OrganisationUnit) User(org.hisp.dhis.user.User) Program(org.hisp.dhis.program.Program) EventDataValue(org.hisp.dhis.eventdatavalue.EventDataValue) IllegalQueryException(org.hisp.dhis.common.IllegalQueryException) DateUtils.getMediumDateString(org.hisp.dhis.util.DateUtils.getMediumDateString) EventDataValue(org.hisp.dhis.eventdatavalue.EventDataValue) CategoryOptionCombo(org.hisp.dhis.category.CategoryOptionCombo) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

IllegalQueryException (org.hisp.dhis.common.IllegalQueryException)98 Test (org.junit.jupiter.api.Test)26 ErrorMessage (org.hisp.dhis.feedback.ErrorMessage)22 HashSet (java.util.HashSet)17 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)17 User (org.hisp.dhis.user.User)14 QueryItem (org.hisp.dhis.common.QueryItem)13 ArrayList (java.util.ArrayList)12 Date (java.util.Date)11 Program (org.hisp.dhis.program.Program)11 QueryFilter (org.hisp.dhis.common.QueryFilter)10 TrackedEntityInstanceCriteria (org.hisp.dhis.webapi.controller.event.webrequest.TrackedEntityInstanceCriteria)10 Transactional (org.springframework.transaction.annotation.Transactional)10 QueryOperator (org.hisp.dhis.common.QueryOperator)9 List (java.util.List)8 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)8 DataElement (org.hisp.dhis.dataelement.DataElement)8 DhisWebSpringTest (org.hisp.dhis.webapi.DhisWebSpringTest)7 Map (java.util.Map)6 Set (java.util.Set)6