private void openCmbUnits() { if (form.cmbDoseUnit().getValues().size() == 0) return; if (form.cmbDoseUnit().getValues().size()==1) form.cmbDoseUnit().setValue((MedicationDoseUnit) form.cmbDoseUnit().getValues().get(0)); else form.cmbDoseUnit().showOpened(); }
private String[] validateUI(TTAMedicationAndPharmacyVo currentRecord) { ArrayList<String> errors = new ArrayList<String>(); if (form.Group1().getValue().equals(Group1Enumeration.None)) { errors.add("TTA Required is mandatory!"); } else { if(currentRecord != null && currentRecord.getCurrentTTAStatusIsNotNull()) { TTAStatusVo tta = currentRecord.getCurrentTTAStatus(); if (!tta.getStatus().equals(TTAStatus.NOT_REQUIRED)) { if (form.ccOrderingClinician().getValue() == null) { errors.add("Ordering Clinician is mandatory"); } if (form.dtimOrderingDateTime().getValue() == null) { errors.add("Ordering DateTime is mandatory"); } else { if (form.dtimOrderingDateTime().getValue().isGreaterThan(new DateTime())) { errors.add("Ordering DateTime can not be in the future"); } } if (form.txtClinicianBleepNo().getValue() == null) { errors.add("Clinician Bleep No. is mandatory"); } //WDEV-11849 - Start for (int i = 0 ; currentRecord.getTTAMedicationsIsNotNull() && i < currentRecord.getTTAMedications().size(); i++) { TTAMedicationDetailVo detail = currentRecord.getTTAMedications().get(i); if (detail != null) { Float dose = detail.getDoseValue(); MedicationDoseUnit doseUnit = detail.getDoseUnit(); String unitText = detail.getUnitText(); DoseFormIndicator formm = detail.getForm(); MedicationRoute route = detail.getRoute(); //WDEV-11894Integer frequency = detail.getFrequencyValue(); MedicationFrequency frequencyUnit = detail.getFrequencyUnit(); //WDEV-11894Integer duration = detail.getDurationValue(); //WDEV-11894MedicationDuration durationUnit = detail.getDurationUnit(); String clinicianComments = detail.getClinicalCommentsForPharmacy(); if ((dose == null || (doseUnit == null && unitText==null) || formm == null || route == null || frequencyUnit == null ) && clinicianComments == null)//WDEV-11894 { errors.add("Medication: "+(i+1)+" If Dose, Form, Route or Frequency are empty, Additional Prescribing Instructions field become mandatory");//WDEV-11894 } } } //WDEV-11849 - End } } } if (errors.size() > 0) { String[] searchErrors = new String[errors.size()]; errors.toArray(searchErrors); engine.showErrors("Invalid TTA Medication Record", searchErrors); return searchErrors; } return null; }
private String[] validateUI(TTAMedicationAndPharmacyVo currentRecord) { ArrayList<String> errors = new ArrayList<String>(); if (form.Group1().getValue().equals(Group1Enumeration.None)) { errors.add("TTA Required is mandatory!"); } else { if(currentRecord != null && currentRecord.getCurrentTTAStatusIsNotNull()) { TTAStatusVo tta = currentRecord.getCurrentTTAStatus(); if (!tta.getStatus().equals(TTAStatus.NOT_REQUIRED)) { if (form.ccOrderingClinician().getValue() == null) { errors.add("Ordering Clinician is mandatory"); } if (form.dtimOrderingDateTime().getValue() == null) { errors.add("Ordering DateTime is mandatory"); } else { if (form.dtimOrderingDateTime().getValue().isGreaterThan(new DateTime())) { errors.add("Ordering Date Time cannot be set to a date in the future."); //WDEV-18762 } } if (form.txtClinicianBleepNo().getValue() == null) { errors.add("Clinician Bleep No. is mandatory"); } //WDEV-11849 - Start for (int i = 0 ; currentRecord.getTTAMedicationsIsNotNull() && i < currentRecord.getTTAMedications().size(); i++) { TTAMedicationDetailVo detail = currentRecord.getTTAMedications().get(i); if (detail != null) { Float dose = detail.getDoseValue(); MedicationDoseUnit doseUnit = detail.getDoseUnit(); String unitText = detail.getUnitText(); DoseFormIndicator formm = detail.getForm(); MedicationRoute route = detail.getRoute(); //WDEV-11894Integer frequency = detail.getFrequencyValue(); MedicationFrequency frequencyUnit = detail.getFrequencyUnit(); //WDEV-11894Integer duration = detail.getDurationValue(); //WDEV-11894MedicationDuration durationUnit = detail.getDurationUnit(); String clinicianComments = detail.getClinicalCommentsForPharmacy(); if ((dose == null || (doseUnit == null && unitText==null) || formm == null || route == null || frequencyUnit == null ) && clinicianComments == null)//WDEV-11894 { errors.add("Medication: "+(i+1)+" If Dose, Form, Route or Frequency are empty, Additional Prescribing Instructions field become mandatory");//WDEV-11894 } } } //WDEV-11849 - End } } } if (errors.size() > 0) { String[] searchErrors = new String[errors.size()]; errors.toArray(searchErrors); engine.showErrors("Invalid TTA Medication Record", searchErrors); return searchErrors; } return null; }