private void repopulateFromMyOrder() throws PresentationLogicException { SelectedComponentFromSelectOrderVoCollection voCollSelectedComponents = new SelectedComponentFromSelectOrderVoCollection(); MyOrderComponentVoCollection voCollMyOrderComponents = form.getGlobalContext().OCRR.getMyOrderComponents(); if(voCollMyOrderComponents != null) { for (int i = 0; i < voCollMyOrderComponents.size(); i++) { voCollSelectedComponents.add(voCollMyOrderComponents.get(i)); if (voCollMyOrderComponents.get(i).getComponentsIsNotNull()) { for (int p = 0; p < voCollMyOrderComponents.get(i).getComponents().size(); p++) voCollSelectedComponents.add(voCollMyOrderComponents.get(i).getComponents().get(p)); } } } form.getLocalContext().setSelectedComponents(voCollSelectedComponents); switchToPreviewView(); switchToSearchView(); form.treDetails().setValue(searchNodeValue); }
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 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 void resetOrder() throws PresentationLogicException { form.getLocalContext().setSelectedComponents(new SelectedComponentFromSelectOrderVoCollection()); form.getGlobalContext().OCRR.setGenderInvestigations(null);//WDEV-16762 form.getGlobalContext().OCRR.setRefusedInvestigation(null);// WDEV-16762 form.getLocalContext().setBreachedInvestigations(null);// WDEV-16762 clearAnalyzedChildComponents(); if (isTemplateNodeSelected()) populateTemplateIfSelected(); if (isSearchNodeSelected()) new OrderEntryTemplatePopulation(form.lyrTemplates().tabSearch().dyngrdSearch(), form.getImages().OCRR.Investigation, form.getImages().OCRR.Profile, form.getImages().OCRR.OrderSet).populateSearch(form.getLocalContext().getLastSearchResults(), new SelectedComponentFromSelectOrderVoCollection(), new SelectedComponentFromSelectOrderVoCollection()); if (isPreviewNodeSelected()) populateMyOrderPreview(); addRemoveOrderRelatedNodes(); //WDEV-17035 updateControlsState(); }
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 boolean wasAnalyzed(SelectedComponentFromSelectOrderVo component) { SelectedComponentFromSelectOrderVoCollection analyzed = form.getLocalContext().getAnalyzedChildComponent(); if (analyzed == null) return false; return analyzed.contains(component); }
private void checkIfTemplatesNeedUnchecked(SelectedComponentFromSelectOrderVoCollection selectedComponents, SelectedComponentFromSelectOrderVoCollection selectedLinkedComponents) { if (selectedComponents == null || selectedLinkedComponents == null) { return; } Boolean exists; for (int a = 0; a < selectedComponents.size(); a++) { exists = Boolean.FALSE; if (SelectAndOrderComponentType.ORDERSET.equals(selectedComponents.get(a).getComponentType())) { ComponentSelectOrderVoCollection childComponents = domain.getChildComponentsForOrderSet(selectedComponents.get(a).getID(), form.getGlobalContext().OCRR.getRoleDisciplineSecurityLevels()); for (int b = 0; b < selectedLinkedComponents.size(); b++) { for (int c = 0; c < childComponents.size(); c++) { if (selectedLinkedComponents.get(b).getID().equals(childComponents.get(c).getInvestigation().getID_Investigation())) { exists = Boolean.TRUE; break; } } if (exists) break; } if (!exists) { selectedComponents.remove(selectedComponents.get(a)); } } } }
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 }
private CategoryCollection getCategories(SelectedComponentFromSelectOrderVoCollection voColl) { CategoryCollection coll = new CategoryCollection(); for (int i = 0; voColl != null && i < voColl.size(); i++) { if(voColl.get(i).getCategoryIsNotNull()) coll.add(voColl.get(i).getCategory()); } return coll; }
private Integer[] getInvestigationIdCollection(SelectedComponentFromSelectOrderVoCollection voColl) { List<Integer> ids = new ArrayList<Integer>(); for (int i = 0; voColl != null && i < voColl.size(); i++) { //WDEV-3306 if(voColl.get(i).getComponentTypeIsNotNull() && voColl.get(i).getComponentType().equals(SelectAndOrderComponentType.PROFILE)) { InvestigationSelectOrderVo voInvSelOrder = domain.getChildComponentsForInvestigationOrProfile(voColl.get(i).getID(),form.getGlobalContext().OCRR.getRoleDisciplineSecurityLevels()); for (int j = 0; voInvSelOrder != null && voInvSelOrder.getAssocInvestigationsIsNotNull() && j < voInvSelOrder.getAssocInvestigations().size(); j++) { //WDEV-16762 if(voInvSelOrder.getAssocInvestigations().get(j) == null || voInvSelOrder.getAssocInvestigations().get(j).getID_Investigation() == null) continue; //WDEV-16762 if(!investigationIdIsInRefusedList(voInvSelOrder.getAssocInvestigations().get(j).getID_Investigation())) { ids.add(voInvSelOrder.getAssocInvestigations().get(j).getID_Investigation()); } } } else { if(voColl.get(i).getIDIsNotNull() && voColl.get(i).getParentInvestigationId() == null && (voColl.get(i).getComponentTypeIsNotNull() && !voColl.get(i).getComponentType().equals(SelectAndOrderComponentType.ORDERSET))) //WDEV-11408 ids.add(voColl.get(i).getID()); } } if (ids.size() > 0) { Integer[] intValues = new Integer[ids.size()]; ids.toArray(intValues); return intValues; } return null; }