private void displayConfiguredTreatmentItemsOnly(grdPaymentHospRow rowCurrent) { form.grdTreatmentHosp().getRows().clear(); if ((rowCurrent != null && rowCurrent.getValue() != null && rowCurrent.getValue() instanceof PaymentTreatmentHospitalLinkVo)) { PaymentTreatmentHospitalLinkVo voPayment = (PaymentTreatmentHospitalLinkVo) rowCurrent.getValue(); for (int i = 0 ; i < voPayment.getTreatingHospital().size() ; i++) { grdTreatmentHospRow row = form.grdTreatmentHosp().getRows().newRow(); row.setColTreatingHosp(voPayment.getTreatingHospital().get(i).getName().toString()); row.setColSelect(true); row.setValue(voPayment.getTreatingHospital().get(i)); } } }
private void paymentSelectionChanged() { displayConfiguredTreatmentItemsOnly(form.grdPaymentHosp().getSelectedRow()); if (form.grdPaymentHosp().getSelectedRow() == null || form.grdPaymentHosp().getSelectedRow().getValue() == null) return; if (form.grdPaymentHosp().getSelectedRow().getValue() instanceof LocationLiteVo) { form.btnNew().setEnabled(true); form.btnEdit().setEnabled(false); } else if (form.grdPaymentHosp().getSelectedRow().getValue() instanceof PaymentTreatmentHospitalLinkVo) { form.btnNew().setEnabled(false); form.btnEdit().setEnabled(true); } }
private void displayAllPayment(PaymentTreatmentHospitalLinkVo voPayment) { form.grdPaymentHosp().getRows().clear(); form.grdTreatmentHosp().getRows().clear(); for (int k = 0 ; form.getLocalContext().getAllTreatingHospsIsNotNull() && k < form.getLocalContext().getAllTreatingHosps().size() ; k++) { grdPaymentHospRow row = form.grdPaymentHosp().getRows().newRow(); row.setCoHosp(form.getLocalContext().getAllTreatingHosps().get(k).getName().toString()); row.setValue(form.getLocalContext().getAllTreatingHosps().get(k)); for (int i = 0 ; i < form.getLocalContext().getCurrentConfiguredPaymentHOSPS().size() ; i++) { if (form.getLocalContext().getAllTreatingHosps().get(k).equals(form.getLocalContext().getCurrentConfiguredPaymentHOSPS().get(i).getPaymentHospital())) row.setValue(form.getLocalContext().getCurrentConfiguredPaymentHOSPS().get(i)); if (voPayment != null && voPayment.getID_PaymentTreatingHospitalLinkIsNotNull() && voPayment.getID_PaymentTreatingHospitalLink().equals(form.getLocalContext().getCurrentConfiguredPaymentHOSPS().get(i).getID_PaymentTreatingHospitalLink())) displayConfiguredTreatmentItemsOnly(row); } } if (voPayment != null) { form.grdPaymentHosp().setValue(voPayment); paymentSelectionChanged(); } }
@Override protected void onBtnEditClick() throws ims.framework.exceptions.PresentationLogicException { if (form.grdPaymentHosp().getSelectedRow() != null && form.grdPaymentHosp().getSelectedRow().getValue() != null && form.grdPaymentHosp().getSelectedRow().getValue() instanceof LocationLiteVo) { PaymentTreatmentHospitalLinkVo voConfig = domain.getPaymentHospitalConfig((LocationLiteVo)form.grdPaymentHosp().getSelectedRow().getValue()); if (voConfig != null) form.grdPaymentHosp().getSelectedRow().setValue(voConfig); } displayConfiguredAndUnconfiguredTreatmentItems(); form.setMode(FormMode.EDIT); }
private void open(PaymentTreatmentHospitalLinkVo voPayment) { form.getLocalContext().setCurrentConfiguredPaymentHOSPS(domain.listPaymentTreatmentHospitalLinks()); displayAllPayment(voPayment); }