private void populateScreenFromData(DischargeMedicationDetailsVo voMeds) { clearInstanceControls(); //WDEV-8183 form.grdMedication().getRows().clear(); //Should clear even if the new value is null form.grdJAC().getRows().clear(); if (voMeds == null) return; form.cmbRequired().setValue(voMeds.getTTARequired()); //----------------------------------------------------- if (form.getMode().equals(FormMode.EDIT)) form.btnOrderTTO().setVisible(TTORequired.REQUIRED.equals(form.cmbRequired().getValue())?true:false); //-------------------------------------------------------- if (voMeds.getTTAsIsNotNull() ) { // WDEV-9537 TTAMedicationVoCollection ttas = voMeds.getTTAs(); ttas.sort(new TTANameCaseInsensitiveComparator<TTAMedicationVo>() ); for ( int i = 0 ; i < ttas.size() ; i++) { TTAMedicationVo voTTA = ttas.get(i); grdJACRow row = form.grdJAC().getRows().newRow(); row.setColMedication(voTTA.getMedication()); //------------------ row.setTooltipForColMedication(voTTA.getMedication()); //------------------ row.setColDose(voTTA.getDoseAmount().toString() + " " + (voTTA.getDoseUnitIsNotNull() ? voTTA.getDoseUnit().toString() : "")); //------------ row.setTooltipForColDose(voTTA.getDoseAmount().toString() + " " + (voTTA.getDoseUnitIsNotNull() ? voTTA.getDoseUnit().toString() : "")); //------------- row.setColRoute(voTTA.getRouteIsNotNull() ? voTTA.getRoute().toString() : null); row.setTooltipForColRoute(voTTA.getRouteIsNotNull() ? voTTA.getRoute().toString() : ""); row.setColUFreq(voTTA.getFrequency()); row.setTooltipForColUFreq(voTTA.getFrequency()); row.setColDays(voTTA.getDaysSupply().toString()); //------ row.setTooltipForColDays(voTTA.getDaysSupply().toString()); //---------- row.setColGpCont(voTTA.getGpToContinueIsNotNull() ? voTTA.getGpToContinue().toString() : null); //--------------- row.setTooltipForColGpCont(voTTA.getGpToContinueIsNotNull() ? voTTA.getGpToContinue().toString() : ""); //--------- row.setValue(voTTA); form.lblRefreshDateTime().setValue(voTTA.getSysInfoIsNotNull() ? voTTA.getSysInfo().getCreationDateTime().toString() : ""); } } //form.grdJAC().sort(0); if (voMeds.getAdmissionMedicationChangesIsNotNull()) { // WDEV-9537 AdmissionMedicationChangesVoCollection admissionMedicationChanges = voMeds.getAdmissionMedicationChanges(); admissionMedicationChanges.sort(new TTANameCaseInsensitiveComparator<AdmissionMedicationChangesVo>()); for ( int i = 0 ;i < admissionMedicationChanges.size() ; i++) { AdmissionMedicationChangesVo voChanges = admissionMedicationChanges.get(i); grdMedicationRow rowMeds = form.grdMedication().getRows().newRow(); rowMeds.setcolAdm(voChanges.getMedication()); rowMeds.setcolChange(voChanges.getMedicationChanges()); rowMeds.setValue(voChanges); } //form.grdMedication().sort(0); } form.txtMedicationRecommendations().setValue(voMeds.getMedicationRecommendations()); }
private void populateScreenFromData(DischargeMedicationDetailsVo voMeds) { clearInstanceControls(); //WDEV-8183 form.grdMedication().getRows().clear(); //Should clear even if the new value is null if (voMeds == null) return; form.cmbRequired().setValue(voMeds.getTTARequired()); //----------------------------------------------------- if (form.getMode().equals(FormMode.EDIT)) form.btnOrderTTO().setVisible(TTORequired.REQUIRED.equals(form.cmbRequired().getValue())?true:false); //-------------------------------------------------------- if (voMeds.getTTAsIsNotNull()) { // WDEV-9537 TTAMedicationVoCollection ttas = voMeds.getTTAs(); //ttas.sort(new TTANameCaseInsensitiveComparator<TTAMedicationVo>() ); populateTTAsFromData(ttas.sort()); //WDEV-19289 //WDEV-19789 } //form.grdJAC().sort(0); if (voMeds.getAdmissionMedicationChangesIsNotNull()) { // WDEV-9537 AdmissionMedicationChangesVoCollection admissionMedicationChanges = voMeds.getAdmissionMedicationChanges(); admissionMedicationChanges.sort(new TTANameCaseInsensitiveComparator<AdmissionMedicationChangesVo>()); for ( int i = 0 ;i < admissionMedicationChanges.size() ; i++) { AdmissionMedicationChangesVo voChanges = admissionMedicationChanges.get(i); grdMedicationRow rowMeds = form.grdMedication().getRows().newRow(); rowMeds.setcolAdm(voChanges.getMedication()); rowMeds.setcolChange(voChanges.getMedicationChanges()); rowMeds.setValue(voChanges); } //form.grdMedication().sort(0); } form.txtMedicationRecommendations().setValue(voMeds.getMedicationRecommendations()); }