示例#1
0
  private String[] validateSearchCriteria() {
    ArrayList<String> listOfErrors = new ArrayList<String>();
    SurgicalOPNotesFilterVo sonf = populateSearchDataFromScreen();

    if (sonf.countFieldsWithValue() == 0) {
      listOfErrors.add("Please fill in at least one search field");
    } else {
      Date today = new Date();
      if (today.isLessThan(sonf.getDateFrom())) {
        listOfErrors.add("'Date From' cannot be set to a date in the future."); // WDEV-18762
      }
      if (today.isLessThan(sonf.getDateTo())) {
        listOfErrors.add("'Date To' cannot be set to a date in the future."); // WDEV-18762
      }
      if (sonf.getDateToIsNotNull()
          && sonf.getDateFromIsNotNull()
          && sonf.getDateFrom().isGreaterThan(sonf.getDateTo())) {

        listOfErrors.add("'Date From' cannot be later than 'Date To'."); // WDEV-18762
      }
    }
    if (listOfErrors.size() == 0) return null;
    String[] errors = new String[listOfErrors.size()];
    errors = listOfErrors.toArray(errors);
    return errors;
  }
示例#2
0
  private void populateSearchScreenFromData(SurgicalOPNotesFilterVo record) {
    clearSearchScreen();
    if (record == null) return;

    if (record.getProcedureIsNotNull()) {
      form.qmbProcedure().newRow(record.getProcedure(), record.getProcedure().getProcedureName());
      form.qmbProcedure().setValue(record.getProcedure());
    }

    if (record.getDiagnosisIsNotNull()) {
      form.qmbDiagnosis().newRow(record.getDiagnosis(), record.getDiagnosis().getDiagnosisName());
      form.qmbDiagnosis().setValue(record.getDiagnosis());
    }
    if (record.getDiagramIsNotNull()) {
      form.qmbDiagram().newRow(record.getDiagram(), record.getDiagram().getName());
      form.qmbDiagram().setValue(record.getDiagram());
    }
    if (record.getHospitalIsNotNull()) {
      form.qmbHospital().newRow(record.getHospital(), record.getHospital().getName());
      form.qmbHospital().setValue(record.getHospital());
    }
    if (record.getOperatingSurgeonIsNotNull()) {
      form.qmbOpSurgeon()
          .newRow(record.getOperatingSurgeon(), record.getOperatingSurgeon().getIMosName());
      form.qmbOpSurgeon().setValue(record.getOperatingSurgeon());
    }
    if (record.getCompletingClinicianIsNotNull()) {
      form.qmbCompletingClinian()
          .newRow(record.getCompletingClinician(), record.getCompletingClinician().getIMosName());
      form.qmbCompletingClinian().setValue(record.getCompletingClinician());
    }
    if (record.getConsultantIsNotNull()) {
      form.qmbConsultant().newRow(record.getConsultant(), record.getConsultant().getIMosName());
      form.qmbConsultant().setValue(record.getConsultant());
    }
    form.cmbFollowUpOrdered().setValue(record.getFollowupOrdered());
    form.dteFrom().setValue(record.getDateFrom());
    form.dteTo().setValue(record.getDateTo());
  }