@Override
  public void createFilterWidgets() {

    castb_patient_identifiantBox = new TextBox();
    castb_patient_identifiantFilterBox = new ImogFilterBox(castb_patient_identifiantBox);
    castb_patient_identifiantFilterBox.setFilterLabel(NLS.constants().patient_field_identifiant());
    addTableFilter(castb_patient_identifiantFilterBox);
    castb_patient_nomBox = new TextBox();
    castb_patient_nomFilterBox = new ImogFilterBox(castb_patient_nomBox);
    castb_patient_nomFilterBox.setFilterLabel(NLS.constants().patient_field_nom());
    addTableFilter(castb_patient_nomFilterBox);

    dateExamenAfterBox = new DateBox();
    dateExamenAfterBox.setFormat(new SimpleImogDateFormat(DateUtil.getDateFormater()));
    dateExamenAfterFilterBox = new ImogFilterBox(dateExamenAfterBox);
    dateExamenAfterFilterBox.setFilterLabel(
        NLS.constants().examenATB_field_dateExamen()
            + BaseNLS.constants().search_operator_superior());
    addTableFilter(dateExamenAfterFilterBox);

    dateExamenBeforeBox = new DateBox();
    dateExamenBeforeBox.setFormat(new SimpleImogDateFormat(DateUtil.getDateFormater()));
    dateExamenBeforeFilterBox = new ImogFilterBox(dateExamenBeforeBox);
    dateExamenBeforeFilterBox.setFilterLabel(
        NLS.constants().examenATB_field_dateExamen()
            + BaseNLS.constants().search_operator_inferior());
    addTableFilter(dateExamenBeforeFilterBox);

    raisonDepistageBox = new ListBox();
    raisonDepistageBox.addItem("", BaseNLS.constants().enumeration_unknown());
    raisonDepistageBox.setSelectedIndex(0);
    raisonDepistageBox.addItem(
        NLS.constants().examenATB_raisonDepistage_diagnostic_option(),
        EpicamEnumConstants.EXAMENATB_RAISONDEPISTAGE_DIAGNOSTIC);
    raisonDepistageBox.addItem(
        NLS.constants().examenATB_raisonDepistage_suivi_option(),
        EpicamEnumConstants.EXAMENATB_RAISONDEPISTAGE_SUIVI);
    raisonDepistageFilterBox = new ImogFilterBox(raisonDepistageBox);
    raisonDepistageFilterBox.setFilterLabel(NLS.constants().examenATB_field_raisonDepistage());
    addTableFilter(raisonDepistageFilterBox);

    resultatBox = new TextBox();
    resultatFilterBox = new ImogFilterBox(resultatBox);
    resultatFilterBox.setFilterLabel(NLS.constants().examenATB_field_resultat());
    addTableFilter(resultatFilterBox);

    deletedEntityBox = new ImogBooleanAsRadio();
    deletedEntityBox.isStrict(true);
    deletedEntityBox.setEnabled(true);
    deletedEntityBox.setValue(false);
    deletedEntityBoxFilterBox = new ImogFilterBox(deletedEntityBox);
    deletedEntityBoxFilterBox.setFilterLabel(BaseNLS.constants().entity_field_deleted());
    addTableFilter(deletedEntityBoxFilterBox);
  }
示例#2
0
 /**
  * Constructor Can be used when the box is not used as an editor but just as a widget
  *
  * @param withExceptions true if the box shall throw exceptions when an unvalid date is entered
  */
 public ImogDateBox(boolean withExceptions) {
   initWidget(uiBinder.createAndBindUi(this));
   if (withExceptions)
     dateBox.setFormat(new ImogDateFormatWithExceptions(DateUtil.getDateFormater()));
   else dateBox.setFormat(new ImogDateFormat(DateUtil.getDateFormater()));
 }
示例#3
0
 /** Constructor */
 public ImogDateBox() {
   initWidget(uiBinder.createAndBindUi(this));
   dateBox.setFormat(new ImogDateFormat(DateUtil.getDateFormater()));
 }
  @Override
  public List<FilterCriteria> getFilterCriteria() {

    String locale = NLS.constants().locale();

    List<FilterCriteria> criteria = new ArrayList<FilterCriteria>();

    FilterCriteria castb_patient_identifiantCrit = new FilterCriteria();
    castb_patient_identifiantCrit.setField("casTb.patient.identifiant");
    castb_patient_identifiantCrit.setFieldDisplayName(NLS.constants().patient_field_identifiant());
    castb_patient_identifiantCrit.setOperation(CriteriaConstants.STRING_OPERATOR_CONTAINS);
    castb_patient_identifiantCrit.setValue(castb_patient_identifiantBox.getValue());
    castb_patient_identifiantCrit.setValueDisplayName(castb_patient_identifiantBox.getValue());
    criteria.add(castb_patient_identifiantCrit);
    FilterCriteria castb_patient_nomCrit = new FilterCriteria();
    castb_patient_nomCrit.setField("casTb.patient.nom");
    castb_patient_nomCrit.setFieldDisplayName(NLS.constants().patient_field_nom());
    castb_patient_nomCrit.setOperation(CriteriaConstants.STRING_OPERATOR_CONTAINS);
    castb_patient_nomCrit.setValue(castb_patient_nomBox.getValue());
    castb_patient_nomCrit.setValueDisplayName(castb_patient_nomBox.getValue());
    criteria.add(castb_patient_nomCrit);

    if (dateExamenBeforeBox.getValue() != null) {
      FilterCriteria dateExamenBeforeCrit = new FilterCriteria();
      dateExamenBeforeCrit.setField("dateExamen");
      dateExamenBeforeCrit.setFieldDisplayName(
          NLS.constants().examenATB_field_dateExamen()
              + BaseNLS.constants().search_operator_inferior());
      dateExamenBeforeCrit.setOperation(CriteriaConstants.DATE_OPERATOR_BEFORE);
      dateExamenBeforeCrit.setValue(DateUtil.getDate(dateExamenBeforeBox.getValue()));
      dateExamenBeforeCrit.setValueDisplayName(DateUtil.getDate(dateExamenBeforeBox.getValue()));
      criteria.add(dateExamenBeforeCrit);
    }

    if (dateExamenAfterBox.getValue() != null) {
      FilterCriteria dateExamenAfterCrit = new FilterCriteria();
      dateExamenAfterCrit.setField("dateExamen");
      dateExamenAfterCrit.setFieldDisplayName(
          NLS.constants().examenATB_field_dateExamen()
              + BaseNLS.constants().search_operator_superior());
      dateExamenAfterCrit.setOperation(CriteriaConstants.DATE_OPERATOR_AFTER);
      dateExamenAfterCrit.setValue(DateUtil.getDate(dateExamenAfterBox.getValue()));
      dateExamenAfterCrit.setValueDisplayName(DateUtil.getDate(dateExamenAfterBox.getValue()));
      criteria.add(dateExamenAfterCrit);
    }

    FilterCriteria raisonDepistageCrit = new FilterCriteria();
    raisonDepistageCrit.setField("raisonDepistage");
    raisonDepistageCrit.setFieldDisplayName(NLS.constants().examenATB_field_raisonDepistage());
    raisonDepistageCrit.setOperation(CriteriaConstants.STRING_OPERATOR_EQUAL);
    raisonDepistageCrit.setValue(
        raisonDepistageBox.getValue(raisonDepistageBox.getSelectedIndex()));
    raisonDepistageCrit.setValueDisplayName(
        EpicamRenderer.get()
            .getEnumDisplayValue(
                ExamenATBProxy.class,
                "raisonDepistage",
                raisonDepistageBox.getValue(raisonDepistageBox.getSelectedIndex())));
    criteria.add(raisonDepistageCrit);

    FilterCriteria resultatCrit = new FilterCriteria();
    resultatCrit.setField("resultat");
    resultatCrit.setFieldDisplayName(NLS.constants().examenATB_field_resultat());
    resultatCrit.setOperation(CriteriaConstants.STRING_OPERATOR_CONTAINS);
    resultatCrit.setValue(resultatBox.getValue());
    resultatCrit.setValueDisplayName(resultatBox.getValue());
    criteria.add(resultatCrit);

    FilterCriteria deletedEntityCrit = new FilterCriteria();
    deletedEntityCrit.setField("deleted");
    deletedEntityCrit.setFieldDisplayName(BaseNLS.constants().entity_field_deleted());
    if (deletedEntityBox.getValue()) {
      deletedEntityCrit.setOperation(CriteriaConstants.OPERATOR_ISNOTNULL);
      deletedEntityCrit.setValue("true");
      deletedEntityCrit.setValueDisplayName(BaseNLS.constants().boolean_true());
    } else {
      deletedEntityCrit.setOperation(CriteriaConstants.OPERATOR_ISNULL);
      deletedEntityCrit.setValue("false");
      deletedEntityCrit.setValueDisplayName(BaseNLS.constants().boolean_false());
    }
    criteria.add(deletedEntityCrit);

    return criteria;
  }