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)); } } } }
/** * method will filter any items that don't pass security checks WDEV-11071,WDEV-11109 */ public ComponentSelectOrderVoCollection getChildComponentsForOrderSet(Integer orderSetID, RoleDisciplineSecurityLevelLiteGCVo voSecurity) { ComponentSelectOrderVoCollection components = OrderSetSelectOrderVoAssembler.create((OrderSet)getDomainFactory().getDomainObject(OrderSet.class, orderSetID.intValue())).getComponents(); //enforce Security here ComponentSelectOrderVoCollection removableComponenets = new ComponentSelectOrderVoCollection(); for(ComponentSelectOrderVo comp : components) { if(comp.getInvestigationIsNotNull()) { if(voSecurity != null) { SecurityLevelAndServiceCheckVo voSecLevelAndService = getSecurityLevelAndServiceForInvestigation(comp.getInvestigation().getInvestigationIndex().getID_InvestigationIndex()); if(voSecLevelAndService != null && voSecLevelAndService.getSecurityLevelIsNotNull() && voSecLevelAndService.getServiceIsNotNull()) { if(!voSecurity.doesInvPassSecurityCheck(voSecLevelAndService.getService(),voSecLevelAndService.getSecurityLevel(),true)) //WDEV-11622 { removableComponenets.add(comp); continue; } } } } } if(removableComponenets.size() > 0) { for(ComponentSelectOrderVo compToRemove : removableComponenets) { components.remove(compToRemove); } } return components; }
private void markUnmarkComponent(OrderEntryTemplateComponentShortVo component, boolean mark, String reorderReason)//WDEV-16624 { if (component.getInvestigationIsNotNull()) { // Investigation or profile selected, will check the type now boolean isProfile = false; if (component.getInvestigation().getInvestigationIndexIsNotNull()) { if (component.getInvestigation().getInvestigationIndex().getIsProfileIsNotNull()) isProfile = component.getInvestigation().getInvestigationIndex().getIsProfile().booleanValue(); } markUnmarkComponent(component.getInvestigation(), isProfile, mark, false, reorderReason);//WDEV-16624 // mark/unmark all child components //if (mark) { InvestigationSelectOrderVo investigation = domain.getChildComponentsForInvestigationOrProfile(component.getInvestigation().getID_Investigation(),form.getGlobalContext().OCRR.getRoleDisciplineSecurityLevels()); clearAnalyzedChildComponents(); markUnmarkChildComponentsRecursive(investigation, false, null, null, 0, mark, reorderReason);//WDEV-16624 clearAnalyzedChildComponents(); } } else if (component.getOrderSetIsNotNull()) { // Order set selected markUnmarkComponent(component.getOrderSet(), mark, false); // mark/unmark all child components //if (mark) { ComponentSelectOrderVoCollection childComponents = domain.getChildComponentsForOrderSet(component.getOrderSet().getID_OrderSet(),form.getGlobalContext().OCRR.getRoleDisciplineSecurityLevels()); if (childComponents != null) { for (int x = 0; x < childComponents.size(); x++) { if (childComponents.get(x) != null) { clearAnalyzedChildComponents(); markUnmarkChildComponentsRecursive(childComponents.get(x).getInvestigation(), null, new Integer(0), 0, component.getOrderSetIsNotNull(), mark, reorderReason);//WDEV-16624 clearAnalyzedChildComponents(); } } } } } }