use of org.hisp.dhis.webapi.controller.event.webrequest.TrackedEntityInstanceCriteria in project dhis2-core by dhis2.
the class TrackedEntityCriteriaMapper method validateTrackedEntityType.
private TrackedEntityType validateTrackedEntityType(TrackedEntityInstanceCriteria criteria) {
Function<String, TrackedEntityType> getTeiType = uid -> {
if (isNotEmpty(uid)) {
return trackedEntityTypeService.getTrackedEntityType(uid);
}
return null;
};
final TrackedEntityType trackedEntityType = getTeiType.apply(criteria.getTrackedEntityType());
if (isNotEmpty(criteria.getTrackedEntityType()) && trackedEntityType == null) {
throw new IllegalQueryException("Tracked entity type does not exist: " + criteria.getTrackedEntityType());
}
return trackedEntityType;
}
Aggregations