Search in sources :

Example 6 with FilterSet

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;
}
Also used : ListDiscNotesSubjectFilter(org.akaza.openclinica.dao.managestudy.ListDiscNotesSubjectFilter) FilterSet(org.jmesa.limit.FilterSet) ListDiscNotesSubjectFilter(org.akaza.openclinica.dao.managestudy.ListDiscNotesSubjectFilter) Filter(org.jmesa.limit.Filter)

Example 7 with FilterSet

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;
}
Also used : Status(org.akaza.openclinica.domain.Status) LoginStatus(org.akaza.openclinica.domain.technicaladmin.LoginStatus) FilterSet(org.jmesa.limit.FilterSet) ActionType(org.akaza.openclinica.domain.rule.action.ActionType) Filter(org.jmesa.limit.Filter) ViewRuleAssignmentFilter(org.akaza.openclinica.dao.hibernate.ViewRuleAssignmentFilter) ViewRuleAssignmentFilter(org.akaza.openclinica.dao.hibernate.ViewRuleAssignmentFilter)

Example 8 with FilterSet

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;
}
Also used : FilterSet(org.jmesa.limit.FilterSet) StudySubjectSDVFilter(org.akaza.openclinica.dao.StudySubjectSDVFilter) Filter(org.jmesa.limit.Filter) StudySubjectSDVFilter(org.akaza.openclinica.dao.StudySubjectSDVFilter)

Example 9 with FilterSet

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;
}
Also used : FilterSet(org.jmesa.limit.FilterSet) Limit(org.jmesa.limit.Limit) SubjectSDVContainer(org.akaza.openclinica.controller.helper.table.SubjectSDVContainer) SortSet(org.jmesa.limit.SortSet)

Example 10 with FilterSet

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;
}
Also used : FilterSet(org.jmesa.limit.FilterSet) ListEventsForSubjectFilter(org.akaza.openclinica.dao.managestudy.ListEventsForSubjectFilter) Filter(org.jmesa.limit.Filter) ListEventsForSubjectFilter(org.akaza.openclinica.dao.managestudy.ListEventsForSubjectFilter)

Aggregations

FilterSet (org.jmesa.limit.FilterSet)14 Filter (org.jmesa.limit.Filter)13 ListDiscNotesSubjectFilter (org.akaza.openclinica.dao.managestudy.ListDiscNotesSubjectFilter)2 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 MissingResourceException (java.util.MissingResourceException)1 ResourceBundle (java.util.ResourceBundle)1 DropdownFilter (org.akaza.openclinica.control.DropdownFilter)1 SubjectSDVContainer (org.akaza.openclinica.controller.helper.table.SubjectSDVContainer)1 EventCRFSDVFilter (org.akaza.openclinica.dao.EventCRFSDVFilter)1 StudySubjectSDVFilter (org.akaza.openclinica.dao.StudySubjectSDVFilter)1 AuditUserLoginFilter (org.akaza.openclinica.dao.hibernate.AuditUserLoginFilter)1 ViewRuleAssignmentFilter (org.akaza.openclinica.dao.hibernate.ViewRuleAssignmentFilter)1 FindSubjectsFilter (org.akaza.openclinica.dao.managestudy.FindSubjectsFilter)1 ListDiscNotesForCRFFilter (org.akaza.openclinica.dao.managestudy.ListDiscNotesForCRFFilter)1 ListEventsForSubjectFilter (org.akaza.openclinica.dao.managestudy.ListEventsForSubjectFilter)1 ListNotesFilter (org.akaza.openclinica.dao.managestudy.ListNotesFilter)1 StudyAuditLogFilter (org.akaza.openclinica.dao.managestudy.StudyAuditLogFilter)1 ListSubjectFilter (org.akaza.openclinica.dao.submit.ListSubjectFilter)1