private void open() { OrderSpecimenVoCollection potentialSpecimens = form.getGlobalContext().OCRR.getMyOrderPotentialSpecimens(); // Sort potential specimens potentialSpecimens.sort(); // Build alternative containers hash map HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers = buildHashMapOfAlternativeContainers(potentialSpecimens); // Check for alternative options if (!choicesAvailable(alternativeContainers)) { engine.close(DialogResult.CANCEL); return; } populateSpecimensWithAlternateContainers(potentialSpecimens, alternativeContainers); }
/** * WDEV-16498 * Function used to set the tool tip for Pathology Specimen Details grids */ private void setTooltipsForGrid(DynamicGrid dynGrid) { for (int i = 0; i < dynGrid.getRows().size(); i++) { DynamicGridRow parentRow = dynGrid.getRows().get(i); if (!(parentRow.getIdentifier() instanceof OrderInvestigationVoCollection)) throw new CodingRuntimeException("Logical error - parent row identifier must be an OrderInvestigationVoCollection"); OrderInvestigationVoCollection investigations = (OrderInvestigationVoCollection) parentRow.getIdentifier(); StringBuilder tooltip = new StringBuilder(); for (OrderInvestigationVo investigation : investigations) { if (tooltip.length() > 0) tooltip.append(", "); tooltip.append(investigation.getInvestigation().getInvestigationIndex().getName()); } parentRow.getCells().get(dynGrid.getColumns().getByIdentifier(DISCIPLINE_COLUMN)).setTooltip(tooltip.toString()); } }
private OrderPriority getPriorityIfExists(InvestigationIndexShortVo investigationIndex, OrderInvestigationVoCollection orderInvestigations) { if (orderInvestigations == null) return null; if (investigationIndex == null || investigationIndex.getID_InvestigationIndex() == null) return null; for (OrderInvestigationVo investigation : orderInvestigations) { if (investigation.getInvestigation() != null && investigation.getInvestigation().getInvestigationIndex() != null) { if (investigationIndex.getID_InvestigationIndex() == investigation.getInvestigation().getInvestigationIndex().getID_InvestigationIndex()) return investigation.getOrderPriority(); } } return null; }
private OrderInvestigationVo getOrderInvestigationFromContextByInvestID(Integer investigationId) { OrderInvestigationVo voOrderInvest = null; OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection(); if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0) { for (int i = 0; i < voCollOrderInvestigation.size(); i++) { if (voCollOrderInvestigation.get(i).getInvestigationIsNotNull() && voCollOrderInvestigation.get(i).getInvestigation().getID_Investigation().equals(investigationId)) { voOrderInvest = voCollOrderInvestigation.get(i); return voOrderInvest; } } } return null; }
private boolean doesOrderContainInvType(Category category) { if (category == null) return false; OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection(); if (voCollOrderInvest == null) return false; boolean isClinicalImagingFound = false; for (int i = 0; i < voCollOrderInvest.size(); i++) { if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null || (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()))) { if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category)) { isClinicalImagingFound = true; break; } } } return isClinicalImagingFound; }
private boolean isPrioritySet(OrderInvestigationVoCollection voCollOrderInvest) { boolean bPrioritiesSet = false; for (int i = 0; i < voCollOrderInvest.size();) { if (voCollOrderInvest.get(i).getOrderPriorityIsNotNull()) //WDEV-16875 { bPrioritiesSet = voCollOrderInvest.get(i).getOrderPriorityIsNotNull(); break; } else i++; } return bPrioritiesSet; }
private void populateSpecimensWithAlternateContainers(OrderSpecimenVoCollection potentialSpecimens, HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers) { // Clear grid form.grdItems().getRows().clear(); if (potentialSpecimens == null) return; for (OrderSpecimenVo specimen : potentialSpecimens) { HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers = alternativeContainers.get(specimen); if (specimenHasOptions(specimenAlternateContainers)) { // Create Specimen parent row grdItemsRow specimenRow = form.grdItems().getRows().newRow(); // Add investigation rows float totalRequiredVolume = addInvestigationsWithAlternates(specimen.getInvestigations(), specimenRow, specimenAlternateContainers); // Set specimen text specimenRow.setColText(getSpecimenDisplayText(specimen, totalRequiredVolume)); // Expand Specimen parent row specimenRow.setExpanded(true); } } }
private boolean choicesAvailable(HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers) { Collection<HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> specimenMaps = alternativeContainers.values(); for (HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenMap : specimenMaps) { if (specimenHasOptions(specimenMap)) return true; } return false; }
private boolean specimenHasOptions(HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers) { Set<PathSpecimenContainerDetailVo> keys = specimenAlternateContainers.keySet(); for (PathSpecimenContainerDetailVo specimenContainer : keys) { OrderInvestigationVoCollection values = specimenAlternateContainers.get(specimenContainer); if (values != null && values.size() > 1) { for (OrderInvestigationVo investigation : values) { PathInvDetailsVo pathologyDetails = null; if (investigation.getInvestigation().getParentInvestigationPathDetails() != null) { pathologyDetails = investigation.getInvestigation().getParentInvestigationPathDetails(); } else { pathologyDetails = investigation.getInvestigation().getPathInvDetails(); } SpecimenVo specimenVo = pathologyDetails.getSpecimens().get(0); if (specimenVo.getAlternativePaediatricContainers() != null) { for (SpecimenContainerVo container : specimenVo.getAlternativePaediatricContainers()) { if (container.getSpecContainer().equals(specimenContainer)) return true; } } } } } return false; }
private void updateInvestigationsGridAndRecalculateContainers() { // this takes the modified investigations from container choice dialog and repopulates the grid and does container calculation again if (form.getGlobalContext().OCRR.getReWrittenOrderInvestigationsIsNotNull()) { OrderInvestigationVoCollection voCollRewrittenOrderInv = form.getGlobalContext().OCRR.getReWrittenOrderInvestigations(); for (int i = 0; i < form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().size(); i++) { grdTestRow row = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().get(i); if (voCollRewrittenOrderInv.contains(row.getValue())) row.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(row.getValue()))); for (int p = 0; p < row.getRows().size(); p++) { grdTestRow cRow = row.getRows().get(p); if (voCollRewrittenOrderInv.contains(cRow.getValue())) cRow.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(cRow.getValue()))); } } } try { form.getGlobalContext().OCRR.setMyOrderPotentialSpecimens(null); btnGenerateSpecimensClick(-1); } catch (PresentationLogicException e) { e.printStackTrace(); } }
private void cmPriorityValueChanged() { if (form.lyrDetails().tabGenDetails().cmbPriority().getValue() != null && form.lyrDetails().tabGenDetails().cmbPriority().getValue().equals(OrderPriority.VARIOUS)) return; OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection(); if (voCollOrderInvestigation == null) throw new CodingRuntimeException("Coding Error - OrderInvestigation Collection is null (onCmbPriorityValueChanged)"); for (int i = 0; i < voCollOrderInvestigation.size(); i++) voCollOrderInvestigation.get(i).setOrderPriority(form.lyrDetails().tabGenDetails().cmbPriority().getValue()); form.getGlobalContext().OCRR.setOrderInvestigationCollection(voCollOrderInvestigation); setOrderPriorityInGrid(); }
private void prePopulateRadPrintItems() { OrderInvestigationVoCollection voCollOrderInv = form.getGlobalContext().OCRR.getOrderInvestigationCollection(); SelectItemVoCollection voCollItems = new SelectItemVoCollection(); if (voCollOrderInv != null) { for (int i = 0; i < voCollOrderInv.size(); i++) { if (voCollOrderInv.get(i).getInvestigationIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(Category.CLINICALIMAGING)) { SelectItemVo voSelectItem = new SelectItemVo(); voSelectItem.setItem(voCollOrderInv.get(i).getInvestigation().getInvestigationIndex()); voSelectItem.setSelected(Boolean.FALSE); voCollItems.add(voSelectItem); } } } form.getGlobalContext().Core.setItems(voCollItems.size() > 0 ? voCollItems : null); InvestigationIndexRefVoCollection voCollInvIndex = new InvestigationIndexRefVoCollection(); if (voCollItems != null) { for (int i = 0; i < voCollItems.size(); i++) { if (voCollItems.get(i).getItemIsNotNull()) { if (voCollItems.get(i).getItem() instanceof InvestigationIndexLiteVo && voCollItems.get(i).getSelectedIsNotNull() && voCollItems.get(i).getSelected().equals(Boolean.FALSE)) { voCollInvIndex.add((InvestigationIndexRefVo) voCollItems.get(i).getItem()); } } } } form.getGlobalContext().OCRR.PrintOrder.setNotLocalInvestigations(voCollInvIndex.size() > 0 ? voCollInvIndex : null); }
private boolean isTimeSeriesInvestigationIdentifier(Object identifier) { if (identifier instanceof OrderInvestigationVoCollection) { OrderInvestigationVoCollection investigationCollection = (OrderInvestigationVoCollection) identifier; if (investigationCollection.size() == 1) { if (InvEventType.TIME_SERIES.equals(investigationCollection.get(0).getInvestigation().getEventType())) return true; } } return false; }
private InvestigationUnderSpecimenVo getInvestUnderSpecimenVoFromContextByOrderInvestigation(OrderInvestigationRefVo voOrderInvestigation) { OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection(); if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0) { for (int i = 0; i < voCollOrderInvestigation.size(); i++) { if (voCollOrderInvestigation.get(i).equals(voOrderInvestigation)) return voCollOrderInvestigation.get(i).getInvestigation(); } } return null; }
private boolean isAnyAddOnsSelected() { OrderInvestigationVoCollection voCollOrderInv = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getValues(); for (int i = 0; i < voCollOrderInv.size(); i++) { if (voCollOrderInv.get(i) != null) { if (voCollOrderInv.get(i).getInvestigation().getIsAddonIsNotNull() && voCollOrderInv.get(i).getInvestigation().getIsAddon().booleanValue()) return true; } } return false; }
public String getCentricityPacsAccessionNumber(OrderInvestigationRefVo voOrderInvRefVo) { if(voOrderInvRefVo == null || voOrderInvRefVo.getID_OrderInvestigation() == null) throw new DomainRuntimeException("Invalid OrderInvestigation id"); if(voOrderInvRefVo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" select o1_1 from OrderInvestigation as o1_1 where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " o1_1.id = :OrderInvId"); markers.add("OrderInvId"); values.add(voOrderInvRefVo.getID_OrderInvestigation()); andStr = " and "; List<?> list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { OrderInvestigationVoCollection voColl = OrderInvestigationVoAssembler.createOrderInvestigationVoCollectionFromOrderInvestigation(list); if(voColl != null && voColl.size() > 0) return voColl.get(0).getAccessionNumber(); } } return null; }