private boolean selectionIsEmpty() { SelectedComponentFromSelectOrderVoCollection selection = form.getLocalContext().getSelectedComponents(); if (selection == null || selection.size() == 0) return true; for (int x = 0; x < selection.size(); x++) { SelectedComponentFromSelectOrderVo component = selection.get(x); if (component != null && component.getComponentTypeIsNotNull() && component.getComponentType().equals(SelectAndOrderComponentType.INVESTIGATION)) return false; } return true; }
private MyOrderComponentVo addComponentToTree(TreeNode node, SelectedComponentFromSelectOrderVo component, Image image) { node.setTooltip(escapeAmpersandInTooltip(component.getTooltip())); node.setCollapsedImage(image); MyOrderComponentVo orderComponent = new MyOrderComponentVo(); orderComponent.setID(component.getID()); orderComponent.setComponentType(component.getComponentType()); orderComponent.setText(component.getText()); orderComponent.setCategory(component.getCategory()); orderComponent.setTooltip(escapeAmpersandInTooltip(component.getTooltip())); orderComponent.setParentInvestigationId(component.getParentInvestigationId()); orderComponent.setIsAddon(component.getIsAddon()); orderComponent.setRequiresSite(component.getRequiresSite()); orderComponent.setServiceID(component.getServiceID()); orderComponent.setMinReOrderPeriod(component.getMinReOrderPeriod()); orderComponent.setMinReOrderVal(component.getMinReOrderVal()); orderComponent.setMinReOrderFemalePeriod(component.getMinReOrderFemalePeriod()); orderComponent.setMinReOrderFemaleVal(component.getMinReOrderFemaleVal()); orderComponent.setPhlebMayCollect(component.getPhlebMayCollect()); orderComponent.setGenderSpecific(component.getGenderSpecific()); orderComponent.setReOrderReason(component.getReOrderReason());//WDEV-16624 return orderComponent; }
private GenderInvestigationVo getGenderInvestigationFromSelectedComponentFromSelectOrder(SelectedComponentFromSelectOrderVo component) { if(component == null) return null; GenderInvestigationVo inv = new GenderInvestigationVo(); inv.setID_Investigation(component.getID()); InvestigationIndexForGenderInvestigationVo invIndex = new InvestigationIndexForGenderInvestigationVo(); invIndex.setName(component.getText()); invIndex.setIsProfile(SelectAndOrderComponentType.PROFILE.equals(component.getComponentType())); inv.setInvestigationIndex(invIndex); return inv; }
private void removeFromRefusedInvestigationsList(SelectedComponentFromSelectOrderVo newComponent) { if(newComponent == null) return; if(form.getGlobalContext().OCRR.getRefusedInvestigation() == null ||form.getGlobalContext().OCRR.getRefusedInvestigation().size() == 0) return; if(SelectAndOrderComponentType.INVESTIGATION.equals(newComponent.getComponentType()) || SelectAndOrderComponentType.PROFILE.equals(newComponent.getComponentType())) { removeComponentFromRefusedInvestigations(newComponent.getID()); } if(newComponent.getAssociatedInvestigations() != null) { for(int i=0; i<newComponent.getAssociatedInvestigations().size(); i++) { InvestigationRefVo invId = newComponent.getAssociatedInvestigations().get(i); if(invId == null) continue; removeComponentFromRefusedInvestigations(invId.getID_Investigation()); } } }
private void removeProfilesWithoutAnyInvestigationsSelected() { SelectedComponentFromSelectOrderVoCollection selectedComponents = form.getLocalContext().getSelectedComponents(); if(selectedComponents == null || selectedComponents.size() == 0) return; for(int i = selectedComponents.size() - 1; i >= 0; i--) { SelectedComponentFromSelectOrderVo selectedComponent = selectedComponents.get(i); if(selectedComponent == null || !SelectAndOrderComponentType.PROFILE.equals(selectedComponent.getComponentType())) continue; if(!doesProfileHasInvestigationsSelected(selectedComponent)) { selectedComponents.remove(selectedComponent); } } }
private boolean doesProfileHasInvestigationsSelected(SelectedComponentFromSelectOrderVo profile) { if(profile == null) return true; SelectedComponentFromSelectOrderVoCollection selectedComponents = form.getLocalContext().getSelectedComponents(); if(selectedComponents == null || selectedComponents.size() == 0) return true; for(SelectedComponentFromSelectOrderVo selectedComponent : selectedComponents) { if(selectedComponent == null || selectedComponent.getParentInvestigationId() == null) continue; if(selectedComponent.getParentInvestigationId().equals(profile.getID())) return true; } return false; }
private boolean componentIsInRefusedList(SelectedComponentFromSelectOrderVo newComponent) { if(form.getGlobalContext().OCRR.getRefusedInvestigation() == null || form.getGlobalContext().OCRR.getRefusedInvestigation().size() == 0) return false; if(newComponent == null || SelectAndOrderComponentType.ORDERSET.equals(newComponent.getComponentType()))// WDEV-16762 return false; for(InvestigationRefVo refusedInv : form.getGlobalContext().OCRR.getRefusedInvestigation()) { if(refusedInv == null || refusedInv.getID_Investigation() == null) continue; if(refusedInv.getID_Investigation().equals(newComponent.getID()) || (refusedInv.getID_Investigation().equals(newComponent.getParentInvestigationId()))) return true; } return false; }
private SelectedComponentFromSelectOrderVoCollection getChildInvestigationsForProfile(SelectedComponentFromSelectOrderVo profile) { if (profile == null) return new SelectedComponentFromSelectOrderVoCollection(); clearAnalyzedChildComponents(); analyzeProfile(domain.getChildComponentsForInvestigationOrProfile(profile.getID(),form.getGlobalContext().OCRR.getRoleDisciplineSecurityLevels())); return form.getLocalContext().getAnalyzedChildComponent(); }
private void processSearchComponentSelection(DynamicGridCell cell) { if (cell.getType().getID() == DynamicCellType.BOOL.getID()) { DynamicGrid grid = form.lyrTemplates().tabSearch().dyngrdSearch(); int columnIndex = grid.getColumns().indexOf(cell.getColumn()); DynamicGridColumn valueColumn = grid.getColumns().get(columnIndex + 2); Object value = cell.getRow().getCells().get(valueColumn).getIdentifier(); if (value != null && value instanceof SelectedComponentFromSelectOrderVo) { SelectedComponentFromSelectOrderVo component = (SelectedComponentFromSelectOrderVo) value; form.getLocalContext().setSelectedCell(null); form.getLocalContext().setSelectedGrid(null); if (((Boolean) cell.getValue()).booleanValue()) { if(validateSelectionHasLaunchedConfirmationDialog(cell, component)) return; } doSelection(cell, component); } populateSearch(); addRemoveOrderRelatedNodes(); } }
private GenderInvestigationVoCollection isInvAppropriateFromComponent(GenderSpecific instGenderSpecific, boolean isFemale, SelectedComponentFromSelectOrderVo component) { GenderInvestigationVoCollection invColl = new GenderInvestigationVoCollection(); if (instGenderSpecific != null) { if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE)) { if (instGenderSpecific.equals(GenderSpecific.FEMALE)) { if (!isFemale) { invColl.add(getGenderInvestigationFromSelectedComponentFromSelectOrder(component)); } } else if (instGenderSpecific.equals(GenderSpecific.MALE)) { if (isFemale) { invColl.add(getGenderInvestigationFromSelectedComponentFromSelectOrder(component)); } } } } return invColl.size() > 0 ? invColl : null; }
private void doSelection(DynamicGridCell cell, SelectedComponentFromSelectOrderVo component) { addRemoveSelection(component, ((Boolean) cell.getValue()).booleanValue(), false); //if (((Boolean) cell.getValue()).booleanValue()) { InvestigationSelectOrderVo investigation = domain.getChildComponentsForInvestigationOrProfile(component.getID(),form.getGlobalContext().OCRR.getRoleDisciplineSecurityLevels()); clearAnalyzedChildComponents(); markUnmarkChildComponentsRecursive(investigation, false, component.getID(), null, 0, ((Boolean) cell.getValue()).booleanValue(), component.getReOrderReason());//WDEV-16624 clearAnalyzedChildComponents(); } }
private boolean wasAnalyzed(Integer id, SelectAndOrderComponentType type) { SelectedComponentFromSelectOrderVo component = new SelectedComponentFromSelectOrderVo(); component.setID(id); component.setComponentType(type); return wasAnalyzed(component); }
private boolean wasAnalyzed(SelectedComponentFromSelectOrderVo component) { SelectedComponentFromSelectOrderVoCollection analyzed = form.getLocalContext().getAnalyzedChildComponent(); if (analyzed == null) return false; return analyzed.contains(component); }
private void markAsAnalyzed(Integer id, SelectAndOrderComponentType type) { SelectedComponentFromSelectOrderVo component = new SelectedComponentFromSelectOrderVo(); component.setID(id); component.setComponentType(type); markAsAnalyzed(component); }
private void markUnmarkComponent(InvestShortVo item, boolean isProfile, boolean mark, boolean isChildComponent, String reorderReason) { if (item != null && item.getID_InvestigationIsNotNull() && item.getInvestigationIndexIsNotNull()) { SelectedComponentFromSelectOrderVo component = new SelectedComponentFromSelectOrderVo(); component.setID(item.getID_Investigation()); component.setComponentType(isProfile ? SelectAndOrderComponentType.PROFILE : SelectAndOrderComponentType.INVESTIGATION); component.setText(item.getInvestigationIndex().getName()); component.setCategory(item.getInvestigationIndex().getCategory()); component.setTooltip(getComponentInvestigationTooltip(item)); component.setIsAddon(item.getIsAddon()); component.setRequiresSite(item.getInvestigationIndex().getRequiresSiteSpecifier()); component.setMinReOrderPeriod(item.getMinReorderPeriodUnit()); component.setMinReOrderVal(item.getMinReorderPeriodVal()); component.setMinReOrderFemalePeriod(item.getFemaleMinReorderPeriodUnit()); component.setMinReOrderFemaleVal(item.getFemaleMinReorderPeriodVal()); component.setPhlebMayCollect(item.getInvestigationIndex().getPhlebMayCollect()); component.setGenderSpecific(item.getInvestigationIndex().getGenderSpecific()); component.setReOrderReason(reorderReason);//WDEV-16624 component.setAssociatedInvestigations(item.getAssocInvestigations());//WDEV-16624 if (item.getProviderServiceIsNotNull() && item.getProviderService().getLocationServiceIsNotNull() && item.getProviderService().getLocationService().getServiceIsNotNull()) component.setServiceID(item.getProviderService().getLocationService().getService().getID_Service()); if (item.getActiveStatusIsNotNull() && item.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)) addRemoveSelection(component, mark, isChildComponent); } }
private void markUnmarkComponent(OrderSetForHelpTextVo item, boolean mark, boolean isChildComponent)//WDEV-16624 { if (item != null && item.getID_OrderSetIsNotNull()) { SelectedComponentFromSelectOrderVo component = new SelectedComponentFromSelectOrderVo(); component.setID(item.getID_OrderSet()); component.setComponentType(SelectAndOrderComponentType.ORDERSET); component.setText(item.getName()); component.setTooltip(escapeAmpersandInTooltip(item.getDescription())); component.setAssociatedInvestigations(getInvestigationsFromOrderSet(item));//WDEV-16624 addRemoveSelection(component, mark, isChildComponent); } }
private void removeFromBreachedInvestigationsList(SelectedComponentFromSelectOrderVo newComponent) { if(newComponent == null) return; if(form.getLocalContext().getBreachedInvestigations() == null || form.getLocalContext().getBreachedInvestigations().size() == 0) return; if(SelectAndOrderComponentType.INVESTIGATION.equals(newComponent.getComponentType())) { removeComponentFromBreachedInvestigations(newComponent.getID());// WDEV-16762 } else { if(newComponent.getAssociatedInvestigations() != null) { for(int i=0; i<newComponent.getAssociatedInvestigations().size(); i++) { InvestigationRefVo invId = newComponent.getAssociatedInvestigations().get(i); if(invId == null) continue; removeComponentFromBreachedInvestigations(invId.getID_Investigation());// WDEV-16762 } } } }
private void unselectComponent(SelectedComponentFromSelectOrderVo component, boolean markAsUnselected) { if (component == null) return; SelectedComponentFromSelectOrderVoCollection selection = form.getLocalContext().getSelectedComponents(); if (selection.contains(component)) { selection.remove(component); form.getLocalContext().setSelectedComponents(selection); } checkIfTemplatesNeedUnchecked(selection, form.getLocalContext().getSelectedComponents()); //WDEV-16908 }
public int compare(SelectedComponentFromSelectOrderVo o1, SelectedComponentFromSelectOrderVo o2) { if(o1 != null && o1.getTextIsNotNull() && o2 != null && o2.getTextIsNotNull()) return order*o1.getText().compareToIgnoreCase(o2.getText()); if (o1 == null || !o1.getTextIsNotNull()) return -1 * order; if (o2 == null || !o2.getTextIsNotNull()) return order; return 0; }