private boolean checkCancelledInvestions(OcsOrderInvVo voOcsOrder) { boolean flag = true; if( voOcsOrder == null ) return false; if(!voOcsOrder.getInvestigationsIsNotNull()) return false; if(voOcsOrder.getInvestigations().size() < 1) return false; for(OrderInvestigationOcsOrderVo item : voOcsOrder.getInvestigations()) { if(OrderInvStatus.CANCELLED.equals(item.getOrdInvCurrentStatusIsNotNull() ? item.getOrdInvCurrentStatus().getOrdInvStatus() : null) || OrderInvStatus.CANCEL_REQUEST.equals(item.getOrdInvCurrentStatusIsNotNull() ? item.getOrdInvCurrentStatus().getOrdInvStatus():null)) { } else { flag = false; } } return flag; }
private String getOrderTooltip(OcsOrderInvVo voOcsOrder) { if(voOcsOrder == null) return ""; StringBuffer tooltip = new StringBuffer(); String htmlSeparator = "<br>"; for (int i = 0; voOcsOrder.getInvestigationsIsNotNull() && i < voOcsOrder.getInvestigations().size(); i++) { OrderInvestigationOcsOrderVo orderInvestigationOcsOrderVo = voOcsOrder.getInvestigations().get(i); if(OrderInvStatus.CANCELLED.equals(orderInvestigationOcsOrderVo.getOrdInvCurrentStatusIsNotNull() ? orderInvestigationOcsOrderVo.getOrdInvCurrentStatus().getOrdInvStatus():null) || OrderInvStatus.CANCEL_REQUEST.equals(orderInvestigationOcsOrderVo.getOrdInvCurrentStatusIsNotNull() ? orderInvestigationOcsOrderVo.getOrdInvCurrentStatus().getOrdInvStatus():null)) //wdev-13275 continue; String invName = orderInvestigationOcsOrderVo.getInvestigationIsNotNull() && orderInvestigationOcsOrderVo.getInvestigation().getInvestigationIndexIsNotNull()?orderInvestigationOcsOrderVo.getInvestigation().getInvestigationIndex().getName():null; if(invName != null) { tooltip.append(invName); tooltip.append(htmlSeparator); } } if(tooltip.length() > 0) { tooltip.insert(0, "<b>Investigations:</b>" + htmlSeparator); //remove last <br> int lastIndex = tooltip.lastIndexOf(htmlSeparator); if (lastIndex >= 0) tooltip.replace(lastIndex, lastIndex + htmlSeparator.length(), ""); } return tooltip.toString(); }
private void populateGrdOrdersFromData(OcsOrderInvVoCollection voCollOrders, boolean bShowMessage) { form.grdOrders().getRows().clear(); if(voCollOrders != null && voCollOrders.size() > 0) { for(int i=0;i<voCollOrders.size();i++) { OcsOrderInvVo voOcsOrder = voCollOrders.get(i); if(checkCancelledInvestions(voOcsOrder) == true) //wdev-13275 continue; GenForm.grdOrdersRow row = form.grdOrders().getRows().newRow(); row.setcolDateTime(voOcsOrder.getSysInfo().getCreationDateTime().toString()); PatientShort voPatient = voOcsOrder.getPatient(); if(voPatient != null) { if (voPatient.getDisplayId() != null) row.setcolHospNo(voPatient.getDisplayId().getValue()); if(voPatient.getNameIsNotNull()) row.setcolPatName(voPatient.getName().toString()); if(voPatient.getSexIsNotNull()) row.setcolSex(voPatient.getSex().getText()); } if(voOcsOrder.getPatientClinicIsNotNull()) row.setcolLocation(voOcsOrder.getPatientClinic().getClinicName()); else if(voOcsOrder.getPatientLocationIsNotNull()) row.setcolLocation(voOcsOrder.getPatientLocation().getName()); else if (voOcsOrder.getOutpatientDepartmentIsNotNull()) { row.setcolLocation(voOcsOrder.getOutpatientDepartment().getName()); } if(voOcsOrder.getOrderedByIsNotNull()) row.setcolRequester(voOcsOrder.getOrderedBy().toString()); row.setTooltip(getOrderTooltip(voOcsOrder)); row.setValue(voOcsOrder); } } else { if(bShowMessage) engine.showMessage("No matching orders found"); } }