use of org.jmesa.limit.FilterSet in project OpenClinica by OpenClinica.
the class ListDiscNotesSubjectTableFactory method getSubjectFilter.
protected ListDiscNotesSubjectFilter getSubjectFilter(Limit limit) {
ListDiscNotesSubjectFilter listDiscNotesSubjectFilter = new ListDiscNotesSubjectFilter();
FilterSet filterSet = limit.getFilterSet();
Collection<Filter> filters = filterSet.getFilters();
for (Filter filter : filters) {
String property = filter.getProperty();
String value = filter.getValue();
listDiscNotesSubjectFilter.addFilter(property, value);
}
return listDiscNotesSubjectFilter;
}
use of org.jmesa.limit.FilterSet in project OpenClinica by OpenClinica.
the class ViewRuleAssignmentTableFactory method getViewRuleAssignmentFilter.
/**
* A very custom way to filter the items. The AuditUserLoginFilter acts as a command for the Hibernate criteria object.
* Take the Limit information and filter the rows.
*
* @param limit The Limit to use.
*/
protected ViewRuleAssignmentFilter getViewRuleAssignmentFilter(Limit limit) {
ViewRuleAssignmentFilter viewRuleAssignmentFilter = new ViewRuleAssignmentFilter();
FilterSet filterSet = limit.getFilterSet();
Collection<Filter> filters = filterSet.getFilters();
for (Filter filter : filters) {
String property = filter.getProperty();
String value = filter.getValue();
if ("ruleSetRuleStatus".equals(property)) {
Status s = Status.getByI18nDescription(value, locale);
int code = s != null ? s.getCode() : -1;
value = code > 0 ? Status.getByCode(code).getCode() + "" : "0";
} else if ("actionType".equals(property)) {
ActionType a = ActionType.getByDescription(value);
value = a != null ? a.getCode() + "" : value;
}
viewRuleAssignmentFilter.addFilter(property, value);
}
return viewRuleAssignmentFilter;
}
use of org.jmesa.limit.FilterSet in project OpenClinica by OpenClinica.
the class SubjectIdSDVFactory method getStudySubjectSDVFilter.
protected StudySubjectSDVFilter getStudySubjectSDVFilter(Limit limit) {
StudySubjectSDVFilter studySubjectSDVFilter = new StudySubjectSDVFilter();
FilterSet filterSet = limit.getFilterSet();
Collection<Filter> filters = filterSet.getFilters();
for (Filter filter : filters) {
String property = filter.getProperty();
String value = filter.getValue();
studySubjectSDVFilter.addFilter(property, value);
}
return studySubjectSDVFilter;
}
use of org.jmesa.limit.FilterSet in project OpenClinica by OpenClinica.
the class SDVUtil method setDataAndLimitVariablesSubjects.
public int setDataAndLimitVariablesSubjects(TableFacade tableFacade, int studyId, int studySubjectId, HttpServletRequest request) {
Limit limit = tableFacade.getLimit();
FilterSet filterSet = limit.getFilterSet();
int totalRows = getTotalRowCountSubjects(filterSet, studyId, studySubjectId);
tableFacade.setTotalRows(totalRows);
SortSet sortSet = limit.getSortSet();
int rowStart = limit.getRowSelect().getRowStart();
int rowEnd = limit.getRowSelect().getRowEnd();
Collection<SubjectSDVContainer> items = getFilteredItemsSubject(filterSet, sortSet, rowStart, rowEnd, studyId, studySubjectId, request);
tableFacade.setItems(items);
return totalRows;
}
use of org.jmesa.limit.FilterSet in project OpenClinica by OpenClinica.
the class ListEventsForSubjectTableFactory method getListEventsForSubjectFilter.
protected ListEventsForSubjectFilter getListEventsForSubjectFilter(Limit limit) {
ListEventsForSubjectFilter listEventsForSubjectFilter = new ListEventsForSubjectFilter(selectedStudyEventDefinition.getId());
FilterSet filterSet = limit.getFilterSet();
Collection<Filter> filters = filterSet.getFilters();
for (Filter filter : filters) {
String property = filter.getProperty();
String value = filter.getValue();
if ("studySubject.status".equalsIgnoreCase(property)) {
value = Status.getByName(value).getId() + "";
} else if ("event.status".equalsIgnoreCase(property)) {
value = SubjectEventStatus.getByName(value).getId() + "";
} else if (property.startsWith("sgc_")) {
int studyGroupClassId = property.endsWith("_") ? 0 : Integer.valueOf(property.split("_")[1]);
value = studyGroupDAO.findByNameAndGroupClassID(value, studyGroupClassId).getId() + "";
} else if (property.startsWith("crf_")) {
value = DataEntryStage.getByName(value).getId() + "";
}
listEventsForSubjectFilter.addFilter(property, value);
}
return listEventsForSubjectFilter;
}
Aggregations